From 10fb23049e244c1a0b661ffb24d2efde5d3909f9 Mon Sep 17 00:00:00 2001 From: Mike Pennisi <mike@mikepennisi.com> Date: Sun, 11 Nov 2018 23:05:11 -0500 Subject: [PATCH] Refactor LT tests for parsers: RegExp The tests for the parsing of line terminators were expressed using eval. This made the tests more complex than necessary and also prevented the tests from providing value to ECMAScript parsers. Remove the use of eval and instead express the expectations with literal source text. --- .../{7.3-7.js => invalid-regexp-ls.js} | 11 +++++++---- .../{7.3-8.js => invalid-regexp-ps.js} | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) rename test/language/line-terminators/{7.3-7.js => invalid-regexp-ls.js} (74%) rename test/language/line-terminators/{7.3-8.js => invalid-regexp-ps.js} (74%) diff --git a/test/language/line-terminators/7.3-7.js b/test/language/line-terminators/invalid-regexp-ls.js similarity index 74% rename from test/language/line-terminators/7.3-7.js rename to test/language/line-terminators/invalid-regexp-ls.js index ceff108155..9c0bab7c5e 100644 --- a/test/language/line-terminators/7.3-7.js +++ b/test/language/line-terminators/invalid-regexp-ls.js @@ -2,13 +2,16 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: sec-line-terminators es5id: 7.3-7 description: > 7.3 - ES5 recognizes the character <LS> (\u2028) as terminating regular expression literals +negative: + phase: parse + type: SyntaxError ---*/ - -assert.throws(SyntaxError, function() { - eval("var regExp = /[\u2028]/"); -}); +$DONOTEVALUATE(); + +/
/ diff --git a/test/language/line-terminators/7.3-8.js b/test/language/line-terminators/invalid-regexp-ps.js similarity index 74% rename from test/language/line-terminators/7.3-8.js rename to test/language/line-terminators/invalid-regexp-ps.js index 2d1160e70f..edf3496af2 100644 --- a/test/language/line-terminators/7.3-8.js +++ b/test/language/line-terminators/invalid-regexp-ps.js @@ -2,13 +2,16 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- +esid: sec-line-terminators es5id: 7.3-8 description: > 7.3 - ES5 recognizes the character <PS> (\u2029) as terminating regular expression literals +negative: + phase: parse + type: SyntaxError ---*/ - -assert.throws(SyntaxError, function() { - eval("var regExp = /[\u2029]/"); -}); +$DONOTEVALUATE(); + +/
/ -- GitLab