js/src/tests/js1_5/Regress/regress-253150.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 //-----------------------------------------------------------------------------
     7 var BUGNUMBER = 253150;
     8 var summary = 'Do not warn on detecting properties';
     9 var actual = '';
    10 var expect = 'No warning';
    12 printBugNumber(BUGNUMBER);
    13 printStatus (summary);
    15 var testobject = {};
    17 options('strict');
    18 options('werror');
    20 try
    21 {
    22   var testresult = testobject.foo;
    23   actual = 'No warning';
    24 }
    25 catch(ex)
    26 {
    27   actual = ex + '';
    28 }
    30 reportCompare(expect, actual, summary + ': 1');
    32 try
    33 {
    34   if (testobject.foo)
    35   {
    36     ;
    37   }
    38   actual = 'No warning';
    39 }
    40 catch(ex)
    41 {
    42   actual = ex + '';
    43 }
    45 reportCompare(expect, actual, summary + ': 2');
    47 try
    48 {
    49   if (typeof testobject.foo == 'undefined')
    50   {
    51     ;
    52   }
    53   actual = 'No warning';
    54 }
    55 catch(ex)
    56 {
    57   actual = ex + '';
    58 }
    60 reportCompare(expect, actual, summary + ': 3');
    62 try
    63 {
    64   if (testobject.foo == null)
    65   {
    66     ;
    67   }
    68   actual = 'No warning';
    69 }
    70 catch(ex)
    71 {
    72   actual = ex + '';
    73 }
    75 reportCompare(expect, actual, summary + ': 4');
    77 try
    78 {
    79   if (testobject.foo == undefined)
    80   {
    81     ;
    82   }
    83   actual = 'No warning';
    84 }
    85 catch(ex)
    86 {
    87   actual = ex + '';
    88 }
    90 reportCompare(expect, actual, summary + ': 3');

mercurial