diff options
Diffstat (limited to 'js/src/tests/js1_5/Regress/regress-253150.js')
-rw-r--r-- | js/src/tests/js1_5/Regress/regress-253150.js | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/js/src/tests/js1_5/Regress/regress-253150.js b/js/src/tests/js1_5/Regress/regress-253150.js new file mode 100644 index 000000000..dc6a0de10 --- /dev/null +++ b/js/src/tests/js1_5/Regress/regress-253150.js @@ -0,0 +1,90 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 253150; +var summary = 'Do not warn on detecting properties'; +var actual = ''; +var expect = 'No warning'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +var testobject = {}; + +options('strict'); +options('werror'); + +try +{ + var testresult = testobject.foo; + actual = 'No warning'; +} +catch(ex) +{ + actual = ex + ''; +} + +reportCompare(expect, actual, summary + ': 1'); + +try +{ + if (testobject.foo) + { + ; + } + actual = 'No warning'; +} +catch(ex) +{ + actual = ex + ''; +} + +reportCompare(expect, actual, summary + ': 2'); + +try +{ + if (typeof testobject.foo == 'undefined') + { + ; + } + actual = 'No warning'; +} +catch(ex) +{ + actual = ex + ''; +} + +reportCompare(expect, actual, summary + ': 3'); + +try +{ + if (testobject.foo == null) + { + ; + } + actual = 'No warning'; +} +catch(ex) +{ + actual = ex + ''; +} + +reportCompare(expect, actual, summary + ': 4'); + +try +{ + if (testobject.foo == undefined) + { + ; + } + actual = 'No warning'; +} +catch(ex) +{ + actual = ex + ''; +} + +reportCompare(expect, actual, summary + ': 3'); |