summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/arguments-object/unmapped
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/tests/test262/language/arguments-object/unmapped
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/language/arguments-object/unmapped')
-rw-r--r--js/src/tests/test262/language/arguments-object/unmapped/Symbol.iterator.js24
-rw-r--r--js/src/tests/test262/language/arguments-object/unmapped/browser.js0
-rw-r--r--js/src/tests/test262/language/arguments-object/unmapped/shell.js0
-rw-r--r--js/src/tests/test262/language/arguments-object/unmapped/via-params-dflt.js30
-rw-r--r--js/src/tests/test262/language/arguments-object/unmapped/via-params-dstr.js30
-rw-r--r--js/src/tests/test262/language/arguments-object/unmapped/via-params-rest.js30
-rw-r--r--js/src/tests/test262/language/arguments-object/unmapped/via-strict-strict.js19
7 files changed, 133 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/arguments-object/unmapped/Symbol.iterator.js b/js/src/tests/test262/language/arguments-object/unmapped/Symbol.iterator.js
new file mode 100644
index 0000000000..3811df4d52
--- /dev/null
+++ b/js/src/tests/test262/language/arguments-object/unmapped/Symbol.iterator.js
@@ -0,0 +1,24 @@
+// Copyright (C) 2014 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 9.4.4.6 S7
+description: >
+ Unmapped arguments exotic objects should implement the Array iterator
+ protocol.
+includes: [propertyHelper.js]
+flags: [noStrict]
+features: [Symbol.iterator]
+---*/
+
+(function() {
+ 'use strict';
+ var descriptor = Object.getOwnPropertyDescriptor(arguments, Symbol.iterator);
+
+ assert.sameValue(arguments[Symbol.iterator], [][Symbol.iterator]);
+
+ verifyNotEnumerable(Array.prototype, Symbol.iterator);
+ verifyWritable(Array.prototype, Symbol.iterator);
+ verifyConfigurable(Array.prototype, Symbol.iterator);
+}());
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/arguments-object/unmapped/browser.js b/js/src/tests/test262/language/arguments-object/unmapped/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/arguments-object/unmapped/browser.js
diff --git a/js/src/tests/test262/language/arguments-object/unmapped/shell.js b/js/src/tests/test262/language/arguments-object/unmapped/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/arguments-object/unmapped/shell.js
diff --git a/js/src/tests/test262/language/arguments-object/unmapped/via-params-dflt.js b/js/src/tests/test262/language/arguments-object/unmapped/via-params-dflt.js
new file mode 100644
index 0000000000..db16833e2d
--- /dev/null
+++ b/js/src/tests/test262/language/arguments-object/unmapped/via-params-dflt.js
@@ -0,0 +1,30 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+es6id: 9.2.12
+description: >
+ Arguments are "unmapped" when paramater list is non-simple due to "default"
+ parameter
+info: |
+ [...]
+ 9. Let simpleParameterList be IsSimpleParameterList of formals.
+ [...]
+ 22. If argumentsObjectNeeded is true, then
+ a. If strict is true or if simpleParameterList is false, then
+ i. Let ao be CreateUnmappedArgumentsObject(argumentsList).
+ [...]
+---*/
+
+var value;
+
+function dflt(a, b = 0) {
+ arguments[0] = 2;
+ value = a;
+}
+
+dflt(1);
+
+assert.sameValue(value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/arguments-object/unmapped/via-params-dstr.js b/js/src/tests/test262/language/arguments-object/unmapped/via-params-dstr.js
new file mode 100644
index 0000000000..8d0a4e8d95
--- /dev/null
+++ b/js/src/tests/test262/language/arguments-object/unmapped/via-params-dstr.js
@@ -0,0 +1,30 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+es6id: 9.2.12
+description: >
+ Arguments are "unmapped" when paramater list is non-simple due to
+ destructuring pattern
+info: |
+ [...]
+ 9. Let simpleParameterList be IsSimpleParameterList of formals.
+ [...]
+ 22. If argumentsObjectNeeded is true, then
+ a. If strict is true or if simpleParameterList is false, then
+ i. Let ao be CreateUnmappedArgumentsObject(argumentsList).
+ [...]
+---*/
+
+var value;
+
+function dstr(a, [b]) {
+ arguments[0] = 2;
+ value = a;
+}
+
+dstr(1, []);
+
+assert.sameValue(value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/arguments-object/unmapped/via-params-rest.js b/js/src/tests/test262/language/arguments-object/unmapped/via-params-rest.js
new file mode 100644
index 0000000000..8c4dab8dcd
--- /dev/null
+++ b/js/src/tests/test262/language/arguments-object/unmapped/via-params-rest.js
@@ -0,0 +1,30 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-functiondeclarationinstantiation
+es6id: 9.2.12
+description: >
+ Arguments are "unmapped" when paramater list is non-simple due to "rest"
+ parameter
+info: |
+ [...]
+ 9. Let simpleParameterList be IsSimpleParameterList of formals.
+ [...]
+ 22. If argumentsObjectNeeded is true, then
+ a. If strict is true or if simpleParameterList is false, then
+ i. Let ao be CreateUnmappedArgumentsObject(argumentsList).
+ [...]
+---*/
+
+var value;
+
+function rest(a, ...b) {
+ arguments[0] = 2;
+ value = a;
+}
+
+rest(1);
+
+assert.sameValue(value, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/arguments-object/unmapped/via-strict-strict.js b/js/src/tests/test262/language/arguments-object/unmapped/via-strict-strict.js
new file mode 100644
index 0000000000..620a0e9758
--- /dev/null
+++ b/js/src/tests/test262/language/arguments-object/unmapped/via-strict-strict.js
@@ -0,0 +1,19 @@
+'use strict';
+// Copyright (c) 2012 Ecma International. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+es5id: 10.6-10-c-ii-2-s
+description: arguments[i] doesn't map to actual parameters in strict mode
+flags: [onlyStrict]
+---*/
+
+ function foo(a,b,c)
+ {
+ arguments[0] = 1; arguments[1] = 'str'; arguments[2] = 2.1;
+ return 10 === a && 'sss' === b && 1 === c;
+ }
+
+assert(foo(10,'sss',1), 'foo(10,"sss",1) !== true');
+
+reportCompare(0, 0);