summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-02-05 12:44:26 +0000
committerMoonchild <moonchild@palemoon.org>2021-02-05 12:44:26 +0000
commit66d028942c3246f17f3f86ce40c230041556d27d (patch)
treefd948b4a70ddb224b0e95d6a11f0398e8601715e /js/src/jit-test
parentbd9fdeccc7f731450188dce4d7ec21643306988c (diff)
downloadUXP-66d028942c3246f17f3f86ce40c230041556d27d.tar
UXP-66d028942c3246f17f3f86ce40c230041556d27d.tar.gz
UXP-66d028942c3246f17f3f86ce40c230041556d27d.tar.lz
UXP-66d028942c3246f17f3f86ce40c230041556d27d.tar.xz
UXP-66d028942c3246f17f3f86ce40c230041556d27d.zip
Issue #1732 - Implement JSON superset proposal.
This change makes unicode line and paragraph separators allowed in JS strings, removing the only quirk of the JS string definition that made JSON not a valid subset of JS. Resolves #1732
Diffstat (limited to 'js/src/jit-test')
-rw-r--r--js/src/jit-test/tests/latin1/json.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/js/src/jit-test/tests/latin1/json.js b/js/src/jit-test/tests/latin1/json.js
index 16559890d..ab7610cd5 100644
--- a/js/src/jit-test/tests/latin1/json.js
+++ b/js/src/jit-test/tests/latin1/json.js
@@ -55,13 +55,10 @@ function testEvalHackNotJSON() {
arr = eval("[]; var z; [1, 2, 3, \"abc\u1200\"]");
assertEq(JSON.stringify(arr), '[1,2,3,"abc\u1200"]');
- try {
- eval("[1, 2, 3, \"abc\u2028\"]");
- throw new Error("U+2028 shouldn't eval");
- } catch (e) {
- assertEq(e instanceof SyntaxError, true,
- "should have thrown a SyntaxError, instead got " + e);
- }
+ // JSON superset
+ var arr = eval("[1, 2, 3, \"abc\u2028\"]");
+ assertEq(arr.length, 4);
+ assertEq(arr[3], "abc\u2028");
}
testEvalHackNotJSON();