summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/ch10/10.2/10.2.1
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /js/src/tests/test262/ch10/10.2/10.2.1
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/tests/test262/ch10/10.2/10.2.1')
-rw-r--r--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.js23
-rw-r--r--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.js22
-rw-r--r--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.js24
-rw-r--r--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.js24
-rw-r--r--js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/browser.js0
-rw-r--r--js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/shell.js0
-rw-r--r--js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/browser.js0
-rw-r--r--js/src/tests/test262/ch10/10.2/10.2.1/10.2.1.1/shell.js0
-rw-r--r--js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A1.js29
-rw-r--r--js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A2.js37
-rw-r--r--js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A3.js21
-rw-r--r--js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A4_T1.js49
-rw-r--r--js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A4_T2.js41
-rw-r--r--js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A5.1_T1.js35
-rw-r--r--js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A5.1_T2.js35
-rw-r--r--js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A5.2_T1.js34
-rw-r--r--js/src/tests/test262/ch10/10.2/10.2.1/browser.js0
-rw-r--r--js/src/tests/test262/ch10/10.2/10.2.1/shell.js0
18 files changed, 374 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