diff options
Diffstat (limited to 'js/src/tests/test262/ch11/11.13/11.13.1')
29 files changed, 695 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-1.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-1.js new file mode 100644 index 000000000..551c80478 --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-1.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.
+/**
+ * PutValue operates only on references (see step 1)
+ *
+ * @path ch11/11.13/11.13.1/11.13.1-1-1.js
+ * @description simple assignment throws ReferenceError if LeftHandSide is not a reference (number)
+ */
+
+
+function testcase() {
+ try {
+ eval("42 = 42");
+ }
+ catch (e) {
+ if (e instanceof ReferenceError) {
+ return true;
+ }
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-2.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-2.js new file mode 100644 index 000000000..5abde0d6d --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-2.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.
+/**
+ * PutValue operates only on references (see step 1).
+ *
+ * @path ch11/11.13/11.13.1/11.13.1-1-2.js
+ * @description simple assignment throws ReferenceError if LeftHandSide is not a reference (string)
+ */
+
+
+function testcase() {
+ try {
+ eval("'x' = 42");
+ }
+ catch (e) {
+ if (e instanceof ReferenceError) {
+ return true;
+ }
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-3.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-3.js new file mode 100644 index 000000000..1dbeb18c3 --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-3.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.
+/**
+ * PutValue operates only on references (see step 1).
+ *
+ * @path ch11/11.13/11.13.1/11.13.1-1-3.js
+ * @description simple assignment throws ReferenceError if LeftHandSide is not a reference (boolean)
+ */
+
+
+function testcase() {
+ try {
+ eval("true = 42");
+ }
+ catch (e) {
+ if (e instanceof ReferenceError) {
+ return true;
+ }
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-4.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-4.js new file mode 100644 index 000000000..dbbfb619b --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-4.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.
+/**
+ * PutValue operates only on references (see step 1).
+ *
+ * @path ch11/11.13/11.13.1/11.13.1-1-4.js
+ * @description simple assignment throws ReferenceError if LeftHandSide is not a reference (null)
+ */
+
+
+function testcase() {
+ try {
+ eval("null = 42");
+ }
+ catch (e) {
+ if (e instanceof ReferenceError) {
+ return true;
+ }
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-6-s.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-6-s.js new file mode 100644 index 000000000..915caf590 --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-6-s.js @@ -0,0 +1,26 @@ +/// 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.
+/**
+ * PutValue operates only on references (see step 3.a).
+ *
+ * @path ch11/11.13/11.13.1/11.13.1-1-6-s.js
+ * @description simple assignment throws ReferenceError if LeftHandSide is an unresolvable reference in strict mode (base obj undefined)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ 'use strict';
+
+ try {
+ __ES3_1_test_suite_test_11_13_1_unique_id_0__.x = 42;
+ return false;
+ }
+ catch (e) {
+ return (e instanceof ReferenceError);
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-s.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-s.js new file mode 100644 index 000000000..5330f5411 --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-1-s.js @@ -0,0 +1,30 @@ +/// 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 ch11/11.13/11.13.1/11.13.1-1-s.js
+ * @description Strict Mode - TypeError is thrown if The LeftHandSide is a reference to a data property with the attribute value {[[Writable]]:false} under strict mode
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var obj = {};
+ Object.defineProperty(obj, "prop", {
+ value: 10,
+ writable: false,
+ enumerable: true,
+ configurable: true
+ });
+
+ try {
+ obj.prop = 20;
+ return false;
+ } catch (e) {
+ return e instanceof TypeError && obj.prop === 10;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-2-s.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-2-s.js new file mode 100644 index 000000000..f16e19d18 --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-2-s.js @@ -0,0 +1,32 @@ +/// 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 ch11/11.13/11.13.1/11.13.1-2-s.js
+ * @description Strict Mode - TypeError is thrown if The LeftHandSide is a reference to an accessor property with the attribute value {[[Set]]:undefined} under strict mode
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var obj = {};
+ Object.defineProperty(obj, "prop", {
+ get: function () {
+ return 11;
+ },
+ set: undefined,
+ enumerable: true,
+ configurable: true
+ });
+
+ try {
+ obj.prop = 20;
+ return false;
+ } catch (e) {
+ return e instanceof TypeError && obj.prop === 11;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-3-s.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-3-s.js new file mode 100644 index 000000000..79d23670e --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-3-s.js @@ -0,0 +1,25 @@ +/// 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 ch11/11.13/11.13.1/11.13.1-3-s.js
+ * @description Strict Mode - TypeError is thrown if The LeftHandSide is a reference to a non-existent property of an object whose [[Extensible]] internal property has the value false under strict mode
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var obj = {};
+ Object.preventExtensions(obj);
+
+ try {
+ obj.len = 10;
+ return false;
+ } catch (e) {
+ return e instanceof TypeError;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-1.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-1.js new file mode 100644 index 000000000..04e93c38d --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-1.js @@ -0,0 +1,29 @@ +/// 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.
+/**
+ * PutValue operates only on references (see step 3.b).
+ *
+ * @path ch11/11.13/11.13.1/11.13.1-4-1.js
+ * @description simple assignment creates property on the global object if LeftHandSide is an unresolvable reference
+ */
+
+
+function testcase() {
+ function foo() {
+ __ES3_1_test_suite_test_11_13_1_unique_id_3__ = 42;
+ }
+ foo();
+
+ var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), '__ES3_1_test_suite_test_11_13_1_unique_id_3__');
+ if (desc.value === 42 &&
+ desc.writable === true &&
+ desc.enumerable === true &&
+ desc.configurable === true) {
+ delete __ES3_1_test_suite_test_11_13_1_unique_id_3__;
+ return true;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-14-s.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-14-s.js new file mode 100644 index 000000000..e82720d70 --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-14-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 ch11/11.13/11.13.1/11.13.1-4-14-s.js
+ * @description simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Number.MAX_VALUE)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ 'use strict';
+
+ try {
+ Number.MAX_VALUE = 42;
+ return false;
+ }
+ catch (e) {
+ return (e instanceof TypeError);
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-27-s.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-27-s.js new file mode 100644 index 000000000..00da46eda --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-27-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 ch11/11.13/11.13.1/11.13.1-4-27-s.js
+ * @description simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Global.undefined)
+ */
+
+
+function testcase() {
+ 'use strict';
+
+ try {
+ fnGlobalObject().undefined = 42;
+ return false;
+ }
+ catch (e) {
+ return (e instanceof TypeError);
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-28-s.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-28-s.js new file mode 100644 index 000000000..039991a37 --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-28-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 ch11/11.13/11.13.1/11.13.1-4-28-s.js
+ * @description Strict Mode - SyntaxError is thrown if the identifier 'eval' appears as the LeftHandSideExpression of simple assignment(=) under strict mode
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var blah = eval;
+ try {
+ eval("var eval = 20;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError && blah === eval;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-28gs.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-28gs.js new file mode 100644 index 000000000..86867f1ba --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-28gs.js @@ -0,0 +1,14 @@ +/// 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 ch11/11.13/11.13.1/11.13.1-4-28gs.js
+ * @description Strict Mode - SyntaxError is thrown if the identifier 'Math.PI' appears as the LeftHandSideExpression of simple assignment(=)
+ * @onlyStrict
+ * @negative NotEarlyError
+ */
+"use strict";
+throw NotEarlyError;
+Math.PI = 20;
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-29-s.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-29-s.js new file mode 100644 index 000000000..c9a5a404c --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-29-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 ch11/11.13/11.13.1/11.13.1-4-29-s.js
+ * @description Strict Mode - SyntaxError is thrown if the identifier 'arguments' appears as the LeftHandSideExpression of simple assignment(=) under strict mode
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ "use strict";
+ var blah = arguments;
+ try {
+ eval("var arguments = 20;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError && blah === arguments;
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-29gs.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-29gs.js new file mode 100644 index 000000000..86e4f59ce --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-29gs.js @@ -0,0 +1,13 @@ +/// 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 ch11/11.13/11.13.1/11.13.1-4-29gs.js
+ * @description Strict Mode - SyntaxError is thrown if the identifier 'Math.PI' appears as the LeftHandSideExpression of simple assignment(=)
+ * @onlyStrict
+ * @negative .
+ */
+"use strict";
+Math.PI = 20;
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-3-s.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-3-s.js new file mode 100644 index 000000000..ff4d1710d --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-3-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 ch11/11.13/11.13.1/11.13.1-4-3-s.js
+ * @description simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Global.Infinity)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ 'use strict';
+
+ try {
+ fnGlobalObject().Infinity = 42;
+ return false;
+ }
+ catch (e) {
+ return (e instanceof TypeError);
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-30-s.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-30-s.js new file mode 100644 index 000000000..e494fab1b --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-30-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 ch11/11.13/11.13.1/11.13.1-4-30-s.js
+ * @description Strict Mode - SyntaxError is thrown if the identifier 'eval' appears as the LeftHandSideExpression (PrimaryExpression) of simple assignment(=) under strict mode
+ * @onlyStrict
+ */
+
+
+
+function testcase() {
+ "use strict";
+ var blah = eval;
+ try {
+ eval("(eval) = 20;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError && blah === eval;
+ }
+}
+runTestCase(testcase);
\ No newline at end of file diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-31-s.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-31-s.js new file mode 100644 index 000000000..1d70a7723 --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-31-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 ch11/11.13/11.13.1/11.13.1-4-31-s.js
+ * @description Strict Mode - SyntaxError is thrown if the identifier 'arguments' appears as the LeftHandSideExpression (PrimaryExpression) of simple assignment(=) under strict mode
+ * @onlyStrict
+ */
+
+
+
+function testcase() {
+ "use strict";
+ var blah = arguments;
+ try {
+ eval("(arguments) = 20;");
+ return false;
+ } catch (e) {
+ return e instanceof SyntaxError && blah === arguments;
+ }
+}
+runTestCase(testcase);
\ No newline at end of file diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-6-s.js b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-6-s.js new file mode 100644 index 000000000..158152924 --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/11.13.1-4-6-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 ch11/11.13/11.13.1/11.13.1-4-6-s.js
+ * @description simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Function.length)
+ * @onlyStrict
+ */
+
+
+function testcase() {
+ 'use strict';
+
+ try {
+ Function.length = 42;
+ return false;
+ }
+ catch (e) {
+ return (e instanceof TypeError);
+ }
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A1.js b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A1.js new file mode 100644 index 000000000..533091b57 --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A1.js @@ -0,0 +1,62 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * White Space and Line Terminator between LeftHandSideExpression and "=" or between "=" and AssignmentExpression are allowed + * + * @path ch11/11.13/11.13.1/S11.13.1_A1.js + * @description Checking by using eval + * @noStrict + */ + +//CHECK#1 +if ((eval("x\u0009=\u0009true")) !== true) { + $ERROR('#1: (x\\u0009=\\u0009true) === true'); +} + +//CHECK#2 +if ((eval("x\u000B=\u000Btrue")) !== true) { + $ERROR('#2: (x\\u000B=\\u000Btrue) === true'); +} + +//CHECK#3 +if ((eval("x\u000C=\u000Ctrue")) !== true) { + $ERROR('#3: (x\\u000C=\\u000Ctrue) === true'); +} + +//CHECK#4 +if ((eval("x\u0020=\u0020true")) !== true) { + $ERROR('#4: (x\\u0020=\\u0020true) === true'); +} + +//CHECK#5 +if ((eval("x\u00A0=\u00A0true")) !== true) { + $ERROR('#5: (x\\u00A0=\\u00A0true) === true'); +} + +//CHECK#6 +if ((eval("x\u000A=\u000Atrue")) !== true) { + $ERROR('#6: (x\\u000A=\\u000Atrue) === true'); +} + +//CHECK#7 +if ((eval("x\u000D=\u000Dtrue")) !== true) { + $ERROR('#7: (x\\u000D=\\u000Dtrue) === true'); +} + +//CHECK#8 +if ((eval("x\u2028=\u2028true")) !== true) { + $ERROR('#8: (x\\u2028=\\u2028true) === true'); +} + +//CHECK#9 +if ((eval("x\u2029=\u2029true")) !== true) { + $ERROR('#9: (x\\u2029=\\u2029true) === true'); +} + + +//CHECK#10 +if ((eval("x\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029=\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029true")) !== true) { + $ERROR('#10: (x\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029=\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029true) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A2.1_T1.js b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A2.1_T1.js new file mode 100644 index 000000000..3c3a793ed --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A2.1_T1.js @@ -0,0 +1,50 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator x = y uses GetValue and PutValue + * + * @path ch11/11.13/11.13.1/S11.13.1_A2.1_T1.js + * @description Either AssigmentExpression is not Reference or GetBase is not null + */ + +//CHECK#1 +x = 1; +if (x !== 1) { + $ERROR('#1: x = 1; x === 1. Actual: ' + (x)); +} + +//CHECK#2 +var x = 1; +if (x !== 1) { + $ERROR('#2: var x = 1; x === 1. Actual: ' + (x)); +} + +//CHECK#3 +y = 1; +x = y; +if (x !== 1) { + $ERROR('#3: y = 1; x = y; x === 1. Actual: ' + (x)); +} + +//CHECK#4 +var y = 1; +var x = y; +if (x !== 1) { + $ERROR('#4: var y = 1; var x = y; x === 1. Actual: ' + (x)); +} + +//CHECK#5 +var objectx = new Object(); +var objecty = new Object(); +objecty.prop = 1.1; +objectx.prop = objecty.prop; +if (objectx.prop !== objecty.prop) { + $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objecty.prop = 1; objectx.prop = objecty.prop; objectx.prop === objecty.prop. Actual: ' + (objectx.prop)); +} else { + if (objectx === objecty) { + $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objecty.prop = 1; objectx.prop = objecty.prop; objectx !== objecty'); + } +} + + diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A2.1_T2.js b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A2.1_T2.js new file mode 100644 index 000000000..7f48afc64 --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A2.1_T2.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. + +/** + * Operator x = y uses GetValue and PutValue + * + * @path ch11/11.13/11.13.1/S11.13.1_A2.1_T2.js + * @description If GetBase(AssigmentExpression) is null, throw ReferenceError + */ + +//CHECK#1 +try { + x = y; + $ERROR('#1.1: x = y throw ReferenceError. Actual: ' + (x = y)); +} +catch (e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: x = y throw ReferenceError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A2.1_T3.js b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A2.1_T3.js new file mode 100644 index 000000000..3e153946f --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A2.1_T3.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. + +/** + * Operator x = y uses GetValue and PutValue + * + * @path ch11/11.13/11.13.1/S11.13.1_A2.1_T3.js + * @description If Type(LeftHandSideExpression) is not Reference, throw ReferenceError (or SyntaxError) + * @negative + */ + +//CHECK#1 +try { + 1 = 1; + $ERROR('#1.1: 1 = 1 throw ReferenceError (or SyntaxError). Actual: ' + (1 = 1)); +} +catch (e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: 1 = 1 throw ReferenceError (or SyntaxError). Actual: ' + (e)); + } else { + 1 = 1; + } +} + diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A3.1.js b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A3.1.js new file mode 100644 index 000000000..d02876814 --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A3.1.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator x = y PutValue(x, y) + * + * @path ch11/11.13/11.13.1/S11.13.1_A3.1.js + * @description Checking Expression and Variable statements + */ + +//CHECK#1 +var x = 1; +if (x !== 1) { + $ERROR('#1: var x = 1; x === 1. Actual: ' + (x)); +} + +//CHECK#2 +y = 1; +if (y !== 1) { + $ERROR('#2: y = 1; y === 1. Actual: ' + (y)); +} + diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A3.2.js b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A3.2.js new file mode 100644 index 000000000..f369e21c3 --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A3.2.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator x = y returns GetValue(y) + * + * @path ch11/11.13/11.13.1/S11.13.1_A3.2.js + * @description Checking Expression and Variable statements + */ + +//CHECK#1 +var x = 0; +if ((x = 1) !== 1) { + $ERROR('#1: var x = 0; (x = 1) === 1. Actual: ' + ((x = 1))); +} + +//CHECK#2 +x = 0; +if ((x = 1) !== 1) { + $ERROR('#2: x = 0; (x = 1) === 1. Actual: ' + ((x = 1))); +} + diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A4_T1.js b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A4_T1.js new file mode 100644 index 000000000..5781fbdfc --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A4_T1.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * AssignmentExpression : LeftHandSideExpression = AssignmentExpression + * + * @path ch11/11.13/11.13.1/S11.13.1_A4_T1.js + * @description Syntax check + */ + +//CHECK#1 +x = x = 1; +if (x !== 1) { + $ERROR('#1: The expression x = x = 1 is the same x = (x = 1), not (x = x) = 1. Actual: ' + (x)); +} + + + diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A4_T2.js b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A4_T2.js new file mode 100644 index 000000000..d1d4ea456 --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/S11.13.1_A4_T2.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * AssignmentExpression : LeftHandSideExpression = AssignmentExpression + * + * @path ch11/11.13/11.13.1/S11.13.1_A4_T2.js + * @description Syntax check if "x = x" throws ReferenceError + */ + +//CHECK#1 +try { + x = x; + $ERROR('#1.1: x = x throw ReferenceError. Actual: ' + (x = x)); +} catch(e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: x = x throw ReferenceError. Actual: ' + (e)); + } +} + + + diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/browser.js b/js/src/tests/test262/ch11/11.13/11.13.1/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/browser.js diff --git a/js/src/tests/test262/ch11/11.13/11.13.1/shell.js b/js/src/tests/test262/ch11/11.13/11.13.1/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.13/11.13.1/shell.js |