summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_5/strict/11.1.5.js
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/ecma_5/strict/11.1.5.js
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/ecma_5/strict/11.1.5.js')
-rw-r--r--js/src/tests/ecma_5/strict/11.1.5.js171
1 files changed, 171 insertions, 0 deletions
diff --git a/js/src/tests/ecma_5/strict/11.1.5.js b/js/src/tests/ecma_5/strict/11.1.5.js
new file mode 100644
index 000000000..7ba12fa98
--- /dev/null
+++ b/js/src/tests/ecma_5/strict/11.1.5.js
@@ -0,0 +1,171 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+
+/*
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/licenses/publicdomain/
+ */
+
+/* Simple identifier labels. */
+assertEq(testLenientAndStrict('({x:1, x:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({x:1, y:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({x:1, y:1, x:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+/* Property names can be written as strings, too. */
+assertEq(testLenientAndStrict('({x:1, "x":1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({"x":1, x:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({"x":1, "x":1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+/* Numeric property names. */
+assertEq(testLenientAndStrict('({1.5:1, 1.5:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({1.5:1, 15e-1:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({6.02214179e23:1, 6.02214179e23:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({6.02214179e23:1, 3.1415926535:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({ 1: 1, "1": 2 })',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({ "1": 1, 1: 2 })',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({ 2.5: 1, "2.5": 2 })',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({ "2.5": 1, 2.5: 2 })',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+/* Many properties, to exercise JSAtomList's hash-table variant. */
+assertEq(testLenientAndStrict('({a:1, b:1, c:1, d:1, e:1, f:1, g:1, h:1, i:1, j:1, k:1, l:1, m:1, n:1, o:1, p:1, q:1, r:1, s:1, t:1, u:1, v:1, w:1, x:1, y:1, z:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({a:1, b:1, c:1, d:1, e:1, f:1, g:1, h:1, i:1, j:1, k:1, l:1, m:1, n:1, o:1, p:1, q:1, r:1, s:1, t:1, u:1, v:1, w:1, x:1, y:1, a:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+/*
+ * Getters, setters, and value properties should conflict only when
+ * appropriate.
+ */
+assertEq(testLenientAndStrict('({get x() {}, x:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({x:1, get x() {}})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({set x(q) {}, x:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({x:1, set x(q) {}})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({1:1, set 1(q) {}})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({set 1(q) {}, 1:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({"1":1, set 1(q) {}})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({set 1(q) {}, "1":1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({get x() {}, set x(q) {}})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({set x(q) {}, get x() {}})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({get x() {}, set x(q) {}, x:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({set x(q) {}, get x() {}, x:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({get x() {}, get x() {}})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({set x(q) {}, set x(q) {}})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+assertEq(testLenientAndStrict('({get x() {}, set x(q) {}, y:1})',
+ parsesSuccessfully,
+ parsesSuccessfully),
+ true);
+
+reportCompare(true, true);