diff options
Diffstat (limited to 'js/src/tests/test262/ch10/10.2')
57 files changed, 1593 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js new file mode 100644 index 000000000..bfc1f5ece --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js @@ -0,0 +1,23 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js
+ * @description Strict Mode - TypeError is thrown when changing the value of a Value Property of the Global Object under strict mode (NaN)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+
+ try {
+ NaN = 12;
+ return false;
+ } catch (e) {
+ return e instanceof TypeError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.js b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.js new file mode 100644 index 000000000..e60836978 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.js @@ -0,0 +1,22 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.js
+ * @description Strict Mode - TypeError is thrown when changing the value of a Value Property of the Global Object under strict mode (undefined)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ try {
+ undefined = 12;
+ return false;
+ } catch (e) {
+ return e instanceof TypeError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.js b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.js new file mode 100644 index 000000000..9303b79b5 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.js
+ * @description Strict Mode - TypeError is not thrown when changing the value of the Constructor Properties of the Global Object under strict mode (Object)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var objBak = Object;
+
+ try {
+ Object = 12;
+ return true;
+ } finally {
+ Object = objBak;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js new file mode 100644 index 000000000..9ecdf64a5 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js @@ -0,0 +1,24 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js
+ * @description Strict Mode - TypeError is not thrown when changing the value of the Constructor Properties of the Global Object under strict mode (Number)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+
+ var numBak = Number;
+ try {
+ Number = 12;
+ return true;
+ } finally {
+ Number = numBak;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/browser.js b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/browser.js diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/shell.js b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/shell.js diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/browser.js b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/browser.js diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/shell.js b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/shell.js diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A1.js b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A1.js new file mode 100644 index 000000000..6206633b2 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A1.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If the caller supplies fewer parameter values than there are + * formal parameters, the extra formal parameters have value undefined + * + * @path ch10/10.2/10.2.1/S10.2.1_A1.js + * @description Calling function excluding a few parameters + */ + +//CHECK#1 +function f1(a, b){ + return (b === undefined); +} +if(!(f1(1, 2) === false)){ + $ERROR('#1: f1(1, 2) === false'); +} else if(!(f1(1) === true)){ + $ERROR('#1: f1(1) === true'); +} + +//CHECK#2 +function f2(a, b, c){ + return (b === undefined) && (c === undefined); +} +if(!(f2(1) === true)){ + $ERROR('#2: f2(1, 2) === true'); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A2.js b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A2.js new file mode 100644 index 000000000..e622c5462 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A2.js @@ -0,0 +1,37 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If two or more formal parameters share the same name, hence + * the same property, the corresponding property is given the value that was + * supplied for the last parameter with this name + * + * @path ch10/10.2/10.2.1/S10.2.1_A2.js + * @description Creating functions initialized with two or more formal parameters, which have the same name + * @noStrict + */ + +//CHECK#1 +function f1(x, x) { + return x; +} +if(!(f1(1, 2) === 2)) { + $ERROR("#1: f1(1, 2) === 2"); +} + +//CHECK#2 +function f2(x, x, x){ + return x*x*x; +} +if(!(f2(1, 2, 3) === 27)){ + $ERROR("f2(1, 2, 3) === 27"); +} + +//CHECK#3 +function f3(x, x) { + return 'a' + x; +} +if(!(f3(1, 2) === 'a2')){ + $ERROR("#3: f3(1, 2) === 'a2'"); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A3.js b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A3.js new file mode 100644 index 000000000..1c15c0621 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A3.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If the value of this last parameter (which has the same + * name as some previous parameters do) was not supplied by the + * caller, the value of the corresponding property is undefined + * + * @path ch10/10.2/10.2.1/S10.2.1_A3.js + * @description Creating functions with two or more formal parameters, + * that have the same name. Calling this function excluding a few last parameters + */ + +//CHECK#1 +function f1(x, a, b, x){ + return x; +} +if(!(f1(1, 2) === undefined)){ + $ERROR('#1: f1(1, 2) === undefined'); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A4_T1.js b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A4_T1.js new file mode 100644 index 000000000..a153af430 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A4_T1.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Function declaration in function code - If the variable object + * already has a property with the name of Function Identifier, replace its + * value and attributes. Semantically, this step must follow the creation of + * FormalParameterList properties + * + * @path ch10/10.2/10.2.1/S10.2.1_A4_T1.js + * @description Checking existence of a function with passed parameter + * @noStrict + */ + +//CHECK#1 +function f1(x){ + return x; + + function x(){ + return 7; + } +} +if(!(f1().constructor.prototype === Function.prototype)){ + $ERROR('#1: f1() returns function'); +} + +//CHECK#2 +function f2(x){ + return typeof x; + + function x(){ + return 7; + } +} +if(!(f2() === "function")){ + $ERROR('#2: f2() === "function"'); +} + +//CHECK#3 +function f3() { + return typeof arguments; + function arguments() { + return 7; + } +} +if (!(f3() === "function")){ + $ERROR('#3: f3() === "function"'); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A4_T2.js b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A4_T2.js new file mode 100644 index 000000000..16661df91 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A4_T2.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Function declaration in function code - If the variable object + * already has a property with the name of Function Identifier, replace its + * value and attributes. Semantically, this step must follow the creation of + * FormalParameterList properties + * + * @path ch10/10.2/10.2.1/S10.2.1_A4_T2.js + * @description Checking existence of a function with declared variable + */ + +//CHECK#1 +function f1(){ + var x; + + return x; + + function x(){ + return 7; + } +} +if(!(f1().constructor.prototype === Function.prototype)){ + $PRINT('#1: f1() returns function'); +} + +//CHECK#2 +function f2(){ + var x; + + return typeof x; + + function x(){ + return 7; + } +} +if(!(f2() === "function")){ + $PRINT('#2: f2() === "function"'); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A5.1_T1.js b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A5.1_T1.js new file mode 100644 index 000000000..824aedeee --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A5.1_T1.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * For each VariableDeclaration or VariableDeclarationNoIn in the + * code, create a property of the variable object whose name is the Identifier + * in the VariableDeclaration or VariableDeclarationNoIn, whose value is + * undefined and whose attributes are determined by the type of code + * + * @path ch10/10.2/10.2.1/S10.2.1_A5.1_T1.js + * @description Checking variable existence only + */ + +//CHECK#1 +function f1(){ + var x; + + return typeof x; +} + +if(!(f1() === "undefined")){ + $PRINT('#1: f1() === "undefined"'); +} + +//CHECK#2 +function f2(){ + var x; + + return x; +} + +if(!(f2() === undefined)){ + $PRINT('#1: f2() === undefined'); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A5.1_T2.js b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A5.1_T2.js new file mode 100644 index 000000000..adef8b5c5 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A5.1_T2.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * For each VariableDeclaration or VariableDeclarationNoIn in the + * code, create a property of the variable object whose name is the Identifier + * in the VariableDeclaration or VariableDeclarationNoIn, whose value is + * undefined and whose attributes are determined by the type of code + * + * @path ch10/10.2/10.2.1/S10.2.1_A5.1_T2.js + * @description Checking existence of the variable object property with formal parameter + */ + +//CHECK#1 +function f1(x){ + var x; + + return typeof x; +} + +if(!(f1() === "undefined")){ + $PRINT('#1: f1(1) === "undefined"'); +} + +//CHECK#2 +function f2(x){ + var x; + + return x; +} + +if(!(f2() === undefined)){ + $PRINT('#1: f2(1) === undefined'); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A5.2_T1.js b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A5.2_T1.js new file mode 100644 index 000000000..d5321c907 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A5.2_T1.js @@ -0,0 +1,34 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If there is already a property of the variable object with the + * name of a declared variable, the value of the property and its attributes + * are not changed + * + * @path ch10/10.2/10.2.1/S10.2.1_A5.2_T1.js + * @description Checking existence of the variable object property with formal parameter + */ + +//CHECK#1 +function f1(x){ + var x; + + return typeof x; +} + +if(!(f1(1) === "number")){ + $PRINT('#1: f1(1) === "number"'); +} + +//CHECK#2 +function f2(x){ + var x; + + return x; +} + +if(!(f2(1) === 1)){ + $PRINT('#1: f2(1) === 1'); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/browser.js b/js/src/tests/test262/ch10/10.2/10.2.1/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/browser.js diff --git a/js/src/tests/test262/ch10/10.2/10.2.1/shell.js b/js/src/tests/test262/ch10/10.2/10.2.1/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.1/shell.js diff --git a/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T1.js b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T1.js new file mode 100644 index 000000000..7aba918d1 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T1.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier + * + * @path ch10/10.2/10.2.2/S10.2.2_A1_T1.js + * @description Checking scope chain containing function declarations + */ + +var x = 0; + +function f1(){ + var x = 1; + function f2(){ + return x; + }; + return f2(); +} + +if(!(f1() === 1)){ + $ERROR("#1: Scope chain disturbed"); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T2.js b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T2.js new file mode 100644 index 000000000..33b472418 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T2.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier + * + * @path ch10/10.2/10.2.2/S10.2.2_A1_T2.js + * @description Checking scope chain containing function declarations + */ + +var x = 0; + +function f1(){ + function f2(){ + return x; + }; + return f2(); +} + +if(!(f1() === 0)){ + $ERROR("#1: Scope chain disturbed"); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T3.js b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T3.js new file mode 100644 index 000000000..a9a85deff --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T3.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier + * + * @path ch10/10.2/10.2.2/S10.2.2_A1_T3.js + * @description Checking scope chain containing function declarations + */ + +var x = 0; + +function f1(){ + function f2(){ + return x; + }; + return f2(); + + var x = 1; +} + +if(!(f1() === undefined)){ + $ERROR("#1: Scope chain disturbed"); +} + + diff --git a/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T4.js b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T4.js new file mode 100644 index 000000000..e32ffac35 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T4.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier + * + * @path ch10/10.2/10.2.2/S10.2.2_A1_T4.js + * @description Checking scope chain containing function declarations + */ + +var x = 0; + +function f1(){ + function f2(){ + return x; + }; + + var x = 1; + return f2(); +} + +if(!(f1() === 1)){ + $ERROR("#1: Scope chain disturbed"); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T5.js b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T5.js new file mode 100644 index 000000000..c71654f6f --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T5.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier + * + * @path ch10/10.2/10.2.2/S10.2.2_A1_T5.js + * @description Checking scope chain containing function declarations and "with" + * @noStrict + */ + +var x = 0; + +var myObj = {x : "obj"}; + +function f1(){ + var x = 1; + function f2(){ + with(myObj){ + return x; + } + }; + return f2(); +} + +if(!(f1() === "obj")){ + $ERROR("#1: Scope chain disturbed"); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T6.js b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T6.js new file mode 100644 index 000000000..990c27ef3 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T6.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier + * + * @path ch10/10.2/10.2.2/S10.2.2_A1_T6.js + * @description Checking scope chain containing function declarations and "with" + * @noStrict + */ + +var x = 0; + +var myObj = {x : "obj"}; + +function f1(){ + function f2(){ + with(myObj){ + return x; + } + }; + return f2(); +} + +if(!(f1() === "obj")){ + $ERROR("#1: Scope chain disturbed"); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T7.js b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T7.js new file mode 100644 index 000000000..cc719b504 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T7.js @@ -0,0 +1,32 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier + * + * @path ch10/10.2/10.2.2/S10.2.2_A1_T7.js + * @description Checking scope chain containing function declarations and "with" + * @noStrict + */ + +var x = 0; + +var myObj = {x : "obj"}; + +function f1(){ + function f2(){ + with(myObj){ + return x; + } + }; + return f2(); + + var x = 1; +} + +if(!(f1() === "obj")){ + $ERROR("#1: Scope chain disturbed"); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T8.js b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T8.js new file mode 100644 index 000000000..3aaefcf14 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T8.js @@ -0,0 +1,32 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier + * + * @path ch10/10.2/10.2.2/S10.2.2_A1_T8.js + * @description Checking scope chain containing function declarations and "with" + * @noStrict + */ + +var x = 0; + +var myObj = {x : "obj"}; + +function f1(){ + function f2(){ + with(myObj){ + return x; + } + }; + + var x = 1; + return f2(); +} + +if(!(f1() === "obj")){ + $ERROR("#1: Scope chain disturbed"); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T9.js b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T9.js new file mode 100644 index 000000000..c03fdd1cf --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.2/S10.2.2_A1_T9.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Every execution context has associated with it a scope chain. + * A scope chain is a list of objects that are searched when evaluating an + * Identifier + * + * @path ch10/10.2/10.2.2/S10.2.2_A1_T9.js + * @description Checking scope chain containing function declarations and "with" + * @noStrict + */ + +var x = 0; + +var myObj = {x : "obj"}; + +function f1(){ + with(myObj){ + return x; + } +} + +if(!(f1() === "obj")){ + $ERROR("#1: Scope chain disturbed"); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.2/browser.js b/js/src/tests/test262/ch10/10.2/10.2.2/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.2/browser.js diff --git a/js/src/tests/test262/ch10/10.2/10.2.2/shell.js b/js/src/tests/test262/ch10/10.2/10.2.2/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.2/shell.js diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.1_T1.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.1_T1.js new file mode 100644 index 000000000..6a133d788 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.1_T1.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc + * + * @path ch10/10.2/10.2.3/S10.2.3_A1.1_T1.js + * @description Global execution context - Value Properties + */ + +//CHECK#1 +if ( NaN === null ) { + $ERROR("#1: NaN === null"); +} + +//CHECK#2 +if ( Infinity === null ) { + $ERROR("#2: Infinity === null"); +} + +//CHECK#3 +if ( undefined === null ) { + $ERROR("#3: undefined === null"); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.1_T2.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.1_T2.js new file mode 100644 index 000000000..1fafadc99 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.1_T2.js @@ -0,0 +1,56 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc + * + * @path ch10/10.2/10.2.3/S10.2.3_A1.1_T2.js + * @description Global execution context - Function Properties + */ + +//CHECK#4 +if ( eval === null ) { + $ERROR("#4: eval === null"); +} + +//CHECK#5 +if ( parseInt === null ) { + $ERROR("#5: parseInt === null"); +} + +//CHECK#6 +if ( parseFloat === null ) { + $ERROR("#6: parseFloat === null"); +} + +//CHECK#7 +if ( isNaN === null ) { + $ERROR("#7: isNaN === null"); +} + +//CHECK#8 +if ( isFinite === null ) { + $ERROR("#8: isFinite === null"); +} + +//CHECK#9 +if ( decodeURI === null ) { + $ERROR("#9: decodeURI === null"); +} + +//CHECK#10 +if ( decodeURIComponent === null ) { + $ERROR("#10: decodeURIComponent === null"); +} + +//CHECK#11 +if ( encodeURI === null ) { + $ERROR("#11: encodeURI === null"); +} + +//CHECK#12 +if ( encodeURIComponent === null ) { + $ERROR("#12: encodeURIComponent === null"); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.1_T3.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.1_T3.js new file mode 100644 index 000000000..3407039e8 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.1_T3.js @@ -0,0 +1,87 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc + * + * @path ch10/10.2/10.2.3/S10.2.3_A1.1_T3.js + * @description Global execution context - Constructor Properties + */ + +//CHECK#13 +if ( Object === null ) { + $ERROR("#13: Object === null"); +} + +//CHECK#14 +if ( Function === null ) { + $ERROR("#14: Function === null"); +} + +//CHECK#15 +if ( String === null ) { + $ERROR("#15: String === null"); +} + +//CHECK#16 +if ( Number === null ) { + $ERROR("#16: Number === null"); +} + +//CHECK#17 +if ( Array === null ) { + $ERROR("#17: Array === null"); +} + +//CHECK#18 +if ( Boolean === null ) { + $ERROR("#20: Boolean === null"); +} + +//CHECK#18 +if ( Date === null ) { + $ERROR("#18: Date === null"); +} + +//CHECK#19 +if ( RegExp === null ) { + $ERROR("#19: RegExp === null"); +} + +//CHECK#20 +if ( Error === null ) { + $ERROR("#20: Error === null"); +} + +//CHECK#21 +if ( EvalError === null ) { + $ERROR("#21: EvalError === null"); +} + +//CHECK#22 +if ( RangeError === null ) { + $ERROR("#22: RangeError === null"); +} + +//CHECK#23 +if ( ReferenceError === null ) { + $ERROR("#23: ReferenceError === null"); +} + +//CHECK#24 +if ( SyntaxError === null ) { + $ERROR("#24: SyntaxError === null"); +} + +//CHECK#25 +if ( TypeError === null ) { + $ERROR("#25: TypeError === null"); +} + +//CHECK#26 +if ( URIError === null ) { + $ERROR("#26: URIError === null"); +} + + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.1_T4.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.1_T4.js new file mode 100644 index 000000000..f59cc646e --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.1_T4.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc + * + * @path ch10/10.2/10.2.3/S10.2.3_A1.1_T4.js + * @description Global execution context - Other Properties + */ + +//CHECK#27 +if ( Math === null ) { + $ERROR("#27: Math === null"); +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.2_T1.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.2_T1.js new file mode 100644 index 000000000..a6b6c4bbf --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.2_T1.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc + * + * @path ch10/10.2/10.2.3/S10.2.3_A1.2_T1.js + * @description Function execution context - Value Properties + */ + +function test() { + //CHECK#1 + if ( NaN === null ) { + $ERROR("#1: NaN === null"); + } + + //CHECK#2 + if ( Infinity === null ) { + $ERROR("#2: Infinity === null"); + } + + //CHECK#3 + if ( undefined === null ) { + $ERROR("#3: undefined === null"); + } +} + +test(); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.2_T2.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.2_T2.js new file mode 100644 index 000000000..45ca89f36 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.2_T2.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc + * + * @path ch10/10.2/10.2.3/S10.2.3_A1.2_T2.js + * @description Function execution context - Function Properties + */ + +function test() { + //CHECK#4 + if ( eval === null ) { + $ERROR("#4: eval === null"); + } + + //CHECK#5 + if ( parseInt === null ) { + $ERROR("#5: parseInt === null"); + } + + //CHECK#6 + if ( parseFloat === null ) { + $ERROR("#6: parseFloat === null"); + } + + //CHECK#7 + if ( isNaN === null ) { + $ERROR("#7: isNaN === null"); + } + + //CHECK#8 + if ( isFinite === null ) { + $ERROR("#8: isFinite === null"); + } + + //CHECK#9 + if ( decodeURI === null ) { + $ERROR("#9: decodeURI === null"); + } + + //CHECK#10 + if ( decodeURIComponent === null ) { + $ERROR("#10: decodeURIComponent === null"); + } + + //CHECK#11 + if ( encodeURI === null ) { + $ERROR("#11: encodeURI === null"); + } + + //CHECK#12 + if ( encodeURIComponent === null ) { + $ERROR("#12: encodeURIComponent === null"); + } +} + +test(); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.2_T3.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.2_T3.js new file mode 100644 index 000000000..295943cb7 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.2_T3.js @@ -0,0 +1,90 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc + * + * @path ch10/10.2/10.2.3/S10.2.3_A1.2_T3.js + * @description Function execution context - Constructor Properties + */ + +function test() { + //CHECK#13 + if ( Object === null ) { + $ERROR("#13: Object === null"); + } + + //CHECK#14 + if ( Function === null ) { + $ERROR("#14: Function === null"); + } + + //CHECK#15 + if ( String === null ) { + $ERROR("#15: String === null"); + } + + //CHECK#16 + if ( Number === null ) { + $ERROR("#16: Function === null"); + } + + //CHECK#17 + if ( Array === null ) { + $ERROR("#17: Array === null"); + } + + //CHECK#18 + if ( Boolean === null ) { + $ERROR("#20: Boolean === null"); + } + + //CHECK#18 + if ( Date === null ) { + $ERROR("#18: Date === null"); + } + + //CHECK#19 + if ( RegExp === null ) { + $ERROR("#19: RegExp === null"); + } + + //CHECK#20 + if ( Error === null ) { + $ERROR("#20: Error === null"); + } + + //CHECK#21 + if ( EvalError === null ) { + $ERROR("#21: EvalError === null"); + } + + //CHECK#22 + if ( RangeError === null ) { + $ERROR("#22: RangeError === null"); + } + + //CHECK#23 + if ( ReferenceError === null ) { + $ERROR("#23: ReferenceError === null"); + } + + //CHECK#24 + if ( SyntaxError === null ) { + $ERROR("#24: SyntaxError === null"); + } + + //CHECK#25 + if ( TypeError === null ) { + $ERROR("#25: TypeError === null"); + } + + //CHECK#26 + if ( URIError === null ) { + $ERROR("#26: URIError === null"); + } +} + +test(); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.2_T4.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.2_T4.js new file mode 100644 index 000000000..01d02fb39 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.2_T4.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc + * + * @path ch10/10.2/10.2.3/S10.2.3_A1.2_T4.js + * @description Function execution context - Other Properties + */ + +function test() { + //CHECK#27 + if ( Math === null ) { + $ERROR("#27: Math === null"); + } +} + +test(); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.3_T1.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.3_T1.js new file mode 100644 index 000000000..695f0acf5 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.3_T1.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc + * + * @path ch10/10.2/10.2.3/S10.2.3_A1.3_T1.js + * @description Eval execution context - Value Properties + */ + +var evalStr = +'//CHECK#1\n'+ +'if ( NaN === null ) {\n'+ +' $ERROR("#1: NaN === null");\n'+ +'}\n'+ + +'//CHECK#2\n'+ +'if ( Infinity === null ) {\n'+ +' $ERROR("#2: Infinity === null");\n'+ +'}\n'+ + +'//CHECK#3\n'+ +'if ( undefined === null ) {\n'+ +' $ERROR("#3: undefined === null");\n'+ +'}\n'+ +';\n'; + +eval(evalStr); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.3_T2.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.3_T2.js new file mode 100644 index 000000000..5afd0ef93 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.3_T2.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc + * + * @path ch10/10.2/10.2.3/S10.2.3_A1.3_T2.js + * @description Eval execution context - Function Properties + */ + +var evalStr = +'//CHECK#4\n'+ +'if ( eval === null ) {\n'+ +' $ERROR("#4: eval === null");\n'+ +'}\n'+ + +'//CHECK#5\n'+ +'if ( parseInt === null ) {\n'+ +' $ERROR("#5: parseInt === null");\n'+ +'}\n'+ + +'//CHECK#6\n'+ +'if ( parseFloat === null ) {\n'+ +' $ERROR("#6: parseFloat === null");\n'+ +'}\n'+ + +'//CHECK#7\n'+ +'if ( isNaN === null ) {\n'+ +' $ERROR("#7: isNaN === null");\n'+ +'}\n'+ + +'//CHECK#8\n'+ +'if ( isFinite === null ) {\n'+ +' $ERROR("#8: isFinite === null");\n'+ +'}\n'+ + +'//CHECK#9\n'+ +'if ( decodeURI === null ) {\n'+ +' $ERROR("#9: decodeURI === null");\n'+ +'}\n'+ + +'//CHECK#10\n'+ +'if ( decodeURIComponent === null ) {\n'+ +' $ERROR("#10: decodeURIComponent === null");\n'+ +'}\n'+ + +'//CHECK#11\n'+ +'if ( encodeURI === null ) {\n'+ +' $ERROR("#11: encodeURI === null");\n'+ +'}\n'+ + +'//CHECK#12\n'+ +'if ( encodeURIComponent === null ) {\n'+ +' $ERROR("#12: encodeURIComponent === null");\n'+ +'}\n'+ +';\n'; + +eval(evalStr); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.3_T3.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.3_T3.js new file mode 100644 index 000000000..b34b1e252 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.3_T3.js @@ -0,0 +1,90 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc + * + * @path ch10/10.2/10.2.3/S10.2.3_A1.3_T3.js + * @description Eval execution context - Constructor Properties + */ + +var evalStr = +'//CHECK#13\n'+ +'if ( Object === null ) {\n'+ +' $ERROR("#13: Object === null");\n'+ +'}\n'+ + +'//CHECK#14\n'+ +'if ( Function === null ) {\n'+ +' $ERROR("#14: Function === null");\n'+ +'}\n'+ + +'//CHECK#15\n'+ +'if ( String === null ) {\n'+ +' $ERROR("#15: String === null");\n'+ +'}\n'+ + +'//CHECK#16\n'+ +'if ( Number === null ) {\n'+ +' $ERROR("#16: Function === null");\n'+ +'}\n'+ + +'//CHECK#17\n'+ +'if ( Array === null ) {\n'+ +' $ERROR("#17: Array === null");\n'+ +'}\n'+ + +'//CHECK#18\n'+ +'if ( Boolean === null ) {\n'+ +' $ERROR("#20: Boolean === null");\n'+ +'}\n'+ + +'//CHECK#18\n'+ +'if ( Date === null ) {\n'+ +' $ERROR("#18: Date === null");\n'+ +'}\n'+ + +'//CHECK#19\n'+ +'if ( RegExp === null ) {\n'+ +' $ERROR("#19: RegExp === null");\n'+ +'}\n'+ + +'//CHECK#20\n'+ +'if ( Error === null ) {\n'+ +' $ERROR("#20: Error === null");\n'+ +'}\n'+ + +'//CHECK#21\n'+ +'if ( EvalError === null ) {\n'+ +' $ERROR("#21: EvalError === null");\n'+ +'}\n'+ + +'//CHECK#22\n'+ +'if ( RangeError === null ) {\n'+ +' $ERROR("#22: RangeError === null");\n'+ +'}\n'+ + +'//CHECK#23\n'+ +'if ( ReferenceError === null ) {\n'+ +' $ERROR("#23: ReferenceError === null");\n'+ +'}\n'+ + +'//CHECK#24\n'+ +'if ( SyntaxError === null ) {\n'+ +' $ERROR("#24: SyntaxError === null");\n'+ +'}\n'+ + +'//CHECK#25\n'+ +'if ( TypeError === null ) {\n'+ +' $ERROR("#25: TypeError === null");\n'+ +'}\n'+ + +'//CHECK#26\n'+ +'if ( URIError === null ) {\n'+ +' $ERROR("#26: URIError === null");\n'+ +'}\n'+ +';\n'; + +eval(evalStr); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.3_T4.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.3_T4.js new file mode 100644 index 000000000..054969ce2 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A1.3_T4.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object has properties such as built-in objects such as + * Math, String, Date, parseInt, etc + * + * @path ch10/10.2/10.2.3/S10.2.3_A1.3_T4.js + * @description Eval execution context - Other Properties + */ + +var evalStr = +'//CHECK#27\n'+ +'if ( Math === null ) {\n'+ +' $ERROR("#27: Math === null");\n'+ +'}\n'+ +';\n'; + +eval(evalStr); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.1_T1.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.1_T1.js new file mode 100644 index 000000000..db57ad5ba --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.1_T1.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object properties have attributes { DontEnum } + * + * @path ch10/10.2/10.2.3/S10.2.3_A2.1_T1.js + * @description Global execution context - Value Properties + */ + +//CHECK#1 +for (var x in this) { + if ( x === 'NaN' ) { + $ERROR("#1: 'NaN' have attribute DontEnum"); + } else if ( x === 'Infinity' ) { + $ERROR("#1: 'Infinity' have attribute DontEnum"); + } else if ( x === 'undefined' ) { + $ERROR("#1: 'undefined' have attribute DontEnum"); + } +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.1_T2.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.1_T2.js new file mode 100644 index 000000000..6a39d43a1 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.1_T2.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object properties have attributes { DontEnum } + * + * @path ch10/10.2/10.2.3/S10.2.3_A2.1_T2.js + * @description Global execution context - Function Properties + */ + +//CHECK#1 +for (var x in this) { + if ( x === 'eval' ) { + $ERROR("#1: 'eval' have attribute DontEnum"); + } else if ( x === 'parseInt' ) { + $ERROR("#1: 'parseInt' have attribute DontEnum"); + } else if ( x === 'parseFloat' ) { + $ERROR("#1: 'parseFloat' have attribute DontEnum"); + } else if ( x === 'isNaN' ) { + $ERROR("#1: 'isNaN' have attribute DontEnum"); + } else if ( x === 'isFinite' ) { + $ERROR("#1: 'isFinite' have attribute DontEnum"); + } else if ( x === 'decodeURI' ) { + $ERROR("#1: 'decodeURI' have attribute DontEnum"); + } else if ( x === 'decodeURIComponent' ) { + $ERROR("#1: 'decodeURIComponent' have attribute DontEnum"); + } else if ( x === 'encodeURI' ) { + $ERROR("#1: 'encodeURI' have attribute DontEnum"); + } else if ( x === 'encodeURIComponent' ) { + $ERROR("#1: 'encodeURIComponent' have attribute DontEnum"); + } +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.1_T3.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.1_T3.js new file mode 100644 index 000000000..c684a649a --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.1_T3.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object properties have attributes { DontEnum } + * + * @path ch10/10.2/10.2.3/S10.2.3_A2.1_T3.js + * @description Global execution context - Constructor Properties + */ + +//CHECK#1 +for (var x in this) { + if ( x === 'Object' ) { + $ERROR("#1: 'property 'Object' have attribute DontEnum"); + } else if ( x === 'Function') { + $ERROR("#1: 'Function' have attribute DontEnum"); + } else if ( x === 'String' ) { + $ERROR("#1: 'String' have attribute DontEnum"); + } else if ( x === 'Number' ) { + $ERROR("#1: 'Number' have attribute DontEnum"); + } else if ( x === 'Array' ) { + $ERROR("#1: 'Array' have attribute DontEnum"); + } else if ( x === 'Boolean' ) { + $ERROR("#1: 'Boolean' have attribute DontEnum"); + } else if ( x === 'Date' ) { + $ERROR("#1: 'Date' have attribute DontEnum"); + } else if ( x === 'RegExp' ) { + $ERROR("#1: 'RegExp' have attribute DontEnum"); + } else if ( x === 'Error' ) { + $ERROR("#1: 'Error' have attribute DontEnum"); + } else if ( x === 'EvalError' ) { + $ERROR("#1: 'EvalError' have attribute DontEnum"); + } else if ( x === 'RangeError' ) { + $ERROR("#1: 'RangeError' have attribute DontEnum"); + } else if ( x === 'ReferenceError' ) { + $ERROR("#1: 'ReferenceError' have attribute DontEnum"); + } else if ( x === 'SyntaxError' ) { + $ERROR("#1: 'SyntaxError' have attribute DontEnum"); + } else if ( x === 'TypeError' ) { + $ERROR("#1: 'TypeError' have attribute DontEnum"); + } else if ( x === 'URIError' ) { + $ERROR("#1: 'URIError' have attribute DontEnum"); + } +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.1_T4.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.1_T4.js new file mode 100644 index 000000000..cb575c533 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.1_T4.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object properties have attributes { DontEnum } + * + * @path ch10/10.2/10.2.3/S10.2.3_A2.1_T4.js + * @description Global execution context - Other Properties + */ + +//CHECK#1 +for (var x in this) { + if ( x === 'Math' ) { + $ERROR("#1: 'Math' have attribute DontEnum"); + } +} + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.2_T1.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.2_T1.js new file mode 100644 index 000000000..808cc1b60 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.2_T1.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object properties have attributes { DontEnum } + * + * @path ch10/10.2/10.2.3/S10.2.3_A2.2_T1.js + * @description Function execution context - Value Properties + */ + +function test() { + //CHECK#1 + for (var x in this) { + if ( x === 'NaN' ) { + $ERROR("#1: 'NaN' have attribute DontEnum"); + } else if ( x === 'Infinity' ) { + $ERROR("#1: 'Infinity' have attribute DontEnum"); + } else if ( x === 'undefined' ) { + $ERROR("#1: 'undefined' have attribute DontEnum"); + } + } +} + +test(); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.2_T2.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.2_T2.js new file mode 100644 index 000000000..ac87a58ef --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.2_T2.js @@ -0,0 +1,37 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object properties have attributes { DontEnum } + * + * @path ch10/10.2/10.2.3/S10.2.3_A2.2_T2.js + * @description Function execution context - Function Properties + */ + +function test() { + //CHECK#1 + for (var x in this) { + if ( x === 'eval' ) { + $ERROR("#1: 'eval' have attribute DontEnum"); + } else if ( x === 'parseInt' ) { + $ERROR("#1: 'parseInt' have attribute DontEnum"); + } else if ( x === 'parseFloat' ) { + $ERROR("#1: 'parseFloat' have attribute DontEnum"); + } else if ( x === 'isNaN' ) { + $ERROR("#1: 'isNaN' have attribute DontEnum"); + } else if ( x === 'isFinite' ) { + $ERROR("#1: 'isFinite' have attribute DontEnum"); + } else if ( x === 'decodeURI' ) { + $ERROR("#1: 'decodeURI' have attribute DontEnum"); + } else if ( x === 'decodeURIComponent' ) { + $ERROR("#1: 'decodeURIComponent' have attribute DontEnum"); + } else if ( x === 'encodeURI' ) { + $ERROR("#1: 'encodeURI' have attribute DontEnum"); + } else if ( x === 'encodeURIComponent' ) { + $ERROR("#1: 'encodeURIComponent' have attribute DontEnum"); + } + } +} + +test(); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.2_T3.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.2_T3.js new file mode 100644 index 000000000..e6f5f4ac7 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.2_T3.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object properties have attributes { DontEnum } + * + * @path ch10/10.2/10.2.3/S10.2.3_A2.2_T3.js + * @description Function execution context - Constructor Properties + */ + +function test() { + //CHECK#1 + for (var x in this) { + if ( x === 'Object' ) { + $ERROR("#1: 'property 'Object' have attribute DontEnum"); + } else if ( x === 'Function') { + $ERROR("#1: 'Function' have attribute DontEnum"); + } else if ( x === 'String' ) { + $ERROR("#1: 'String' have attribute DontEnum"); + } else if ( x === 'Number' ) { + $ERROR("#1: 'Number' have attribute DontEnum"); + } else if ( x === 'Array' ) { + $ERROR("#1: 'Array' have attribute DontEnum"); + } else if ( x === 'Boolean' ) { + $ERROR("#1: 'Boolean' have attribute DontEnum"); + } else if ( x === 'Date' ) { + $ERROR("#1: 'Date' have attribute DontEnum"); + } else if ( x === 'RegExp' ) { + $ERROR("#1: 'RegExp' have attribute DontEnum"); + } else if ( x === 'Error' ) { + $ERROR("#1: 'Error' have attribute DontEnum"); + } else if ( x === 'EvalError' ) { + $ERROR("#1: 'EvalError' have attribute DontEnum"); + } else if ( x === 'RangeError' ) { + $ERROR("#1: 'RangeError' have attribute DontEnum"); + } else if ( x === 'ReferenceError' ) { + $ERROR("#1: 'ReferenceError' have attribute DontEnum"); + } else if ( x === 'SyntaxError' ) { + $ERROR("#1: 'SyntaxError' have attribute DontEnum"); + } else if ( x === 'TypeError' ) { + $ERROR("#1: 'TypeError' have attribute DontEnum"); + } else if ( x === 'URIError' ) { + $ERROR("#1: 'URIError' have attribute DontEnum"); + } + } +} + +test(); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.2_T4.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.2_T4.js new file mode 100644 index 000000000..3a6afa5cc --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.2_T4.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object properties have attributes { DontEnum } + * + * @path ch10/10.2/10.2.3/S10.2.3_A2.2_T4.js + * @description Function execution context - Other Properties + */ + +function test() { + //CHECK#1 + for (var x in this) { + if ( x === 'Math' ) { + $ERROR("#1: 'Math' have attribute DontEnum"); + } + } +} + +test(); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.3_T1.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.3_T1.js new file mode 100644 index 000000000..f7f32c563 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.3_T1.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object properties have attributes { DontEnum } + * + * @path ch10/10.2/10.2.3/S10.2.3_A2.3_T1.js + * @description Global execution context - Value Properties + */ + +var evalStr = +'//CHECK#1\n'+ +'for (var x in this) {\n'+ +' if ( x === \'NaN\' ) {\n'+ +' $ERROR("#1: \'NaN\' have attribute DontEnum");\n'+ +' } else if ( x === \'Infinity\' ) {\n'+ +' $ERROR("#1: \'Infinity\' have attribute DontEnum");\n'+ +' } else if ( x === \'undefined\' ) {\n'+ +' $ERROR("#1: \'undefined\' have attribute DontEnum");\n'+ +' }\n'+ +'}\n'; + +eval(evalStr); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.3_T2.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.3_T2.js new file mode 100644 index 000000000..8d3cfe7ee --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.3_T2.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object properties have attributes { DontEnum } + * + * @path ch10/10.2/10.2.3/S10.2.3_A2.3_T2.js + * @description Global execution context - Function Properties + */ + +var evalStr = +'//CHECK#1\n'+ +'for (var x in this) {\n'+ +' if ( x === \'eval\' ) {\n'+ +' $ERROR("#1: \'eval\' have attribute DontEnum");\n'+ +' } else if ( x === \'parseInt\' ) {\n'+ +' $ERROR("#1: \'parseInt\' have attribute DontEnum");\n'+ +' } else if ( x === \'parseFloat\' ) {\n'+ +' $ERROR("#1: \'parseFloat\' have attribute DontEnum");\n'+ +' } else if ( x === \'isNaN\' ) {\n'+ +' $ERROR("#1: \'isNaN\' have attribute DontEnum");\n'+ +' } else if ( x === \'isFinite\' ) {\n'+ +' $ERROR("#1: \'isFinite\' have attribute DontEnum");\n'+ +' } else if ( x === \'decodeURI\' ) {\n'+ +' $ERROR("#1: \'decodeURI\' have attribute DontEnum");\n'+ +' } else if ( x === \'decodeURIComponent\' ) {\n'+ +' $ERROR("#1: \'decodeURIComponent\' have attribute DontEnum");\n'+ +' } else if ( x === \'encodeURI\' ) {\n'+ +' $ERROR("#1: \'encodeURI\' have attribute DontEnum");\n'+ +' } else if ( x === \'encodeURIComponent\' ) {\n'+ +' $ERROR("#1: \'encodeURIComponent\' have attribute DontEnum");\n'+ +' }\n'+ +'}\n'; + +eval(evalStr); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.3_T3.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.3_T3.js new file mode 100644 index 000000000..9ae75beb9 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.3_T3.js @@ -0,0 +1,48 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object properties have attributes { DontEnum } + * + * @path ch10/10.2/10.2.3/S10.2.3_A2.3_T3.js + * @description Global execution context - Constructor Properties + */ + +var evalStr = +'//CHECK#1\n'+ +'for (var x in this) {\n'+ +' if ( x === \'Object\' ) {\n'+ +' $ERROR("#1: \'Object\' have attribute DontEnum");\n'+ +' } else if ( x === \'Function\') {\n'+ +' $ERROR("#1: \'Function\' have attribute DontEnum");\n'+ +' } else if ( x === \'String\' ) {\n'+ +' $ERROR("#1: \'String\' have attribute DontEnum");\n'+ +' } else if ( x === \'Number\' ) {\n'+ +' $ERROR("#1: \'Number\' have attribute DontEnum");\n'+ +' } else if ( x === \'Array\' ) {\n'+ +' $ERROR("#1: \'Array\' have attribute DontEnum");\n'+ +' } else if ( x === \'Boolean\' ) {\n'+ +' $ERROR("#1: \'Boolean\' have attribute DontEnum");\n'+ +' } else if ( x === \'Date\' ) {\n'+ +' $ERROR("#1: \'Date\' have attribute DontEnum");\n'+ +' } else if ( x === \'RegExp\' ) {\n'+ +' $ERROR("#1: \'RegExp\' have attribute DontEnum");\n'+ +' } else if ( x === \'Error\' ) {\n'+ +' $ERROR("#1: \'Error\' have attribute DontEnum");\n'+ +' } else if ( x === \'EvalError\' ) {\n'+ +' $ERROR("#1: \'EvalError\' have attribute DontEnum");\n'+ +' } else if ( x === \'RangeError\' ) {\n'+ +' $ERROR("#1: \'RangeError\' have attribute DontEnum");\n'+ +' } else if ( x === \'ReferenceError\' ) {\n'+ +' $ERROR("#1: \'ReferenceError\' have attribute DontEnum");\n'+ +' } else if ( x === \'SyntaxError\' ) {\n'+ +' $ERROR("#1: \'SyntaxError\' have attribute DontEnum");\n'+ +' } else if ( x === \'TypeError\' ) {\n'+ +' $ERROR("#1: \'TypeError\' have attribute DontEnum");\n'+ +' } else if ( x === \'URIError\' ) {\n'+ +' $ERROR("#1: \'URIError\' have attribute DontEnum");\n'+ +' }\n'+ +'}\n'; + +eval(evalStr); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.3_T4.js b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.3_T4.js new file mode 100644 index 000000000..ed60835c9 --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/S10.2.3_A2.3_T4.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Global object properties have attributes { DontEnum } + * + * @path ch10/10.2/10.2.3/S10.2.3_A2.3_T4.js + * @description Global execution context - Other Properties + */ + +var evalStr = +'//CHECK#1\n'+ +'for (var x in this) {\n'+ +' if ( x === \'Math\' ) {\n'+ +' $ERROR("#1: \'Math\' have attribute DontEnum");\n'+ +' }\n'+ +'}\n'; + +eval(evalStr); + diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/browser.js b/js/src/tests/test262/ch10/10.2/10.2.3/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/browser.js diff --git a/js/src/tests/test262/ch10/10.2/10.2.3/shell.js b/js/src/tests/test262/ch10/10.2/10.2.3/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/10.2.3/shell.js diff --git a/js/src/tests/test262/ch10/10.2/browser.js b/js/src/tests/test262/ch10/10.2/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/browser.js diff --git a/js/src/tests/test262/ch10/10.2/shell.js b/js/src/tests/test262/ch10/10.2/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch10/10.2/shell.js |