Refactor LT tests for parsers: string

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.
This commit is contained in:
Mike Pennisi 2018-11-12 00:01:49 -05:00
parent 10fb23049e
commit f9ffa71c56
2 changed files with 15 additions and 6 deletions

View File

@ -4,9 +4,13 @@
/*---
info: CARRIAGE RETURN (U+000D) within strings is not allowed
es5id: 7.3_A2.2_T1
esid: sec-line-terminators
description: Insert CARRIAGE RETURN (\u000D) into string
negative:
phase: parse
type: SyntaxError
---*/
assert.throws(SyntaxError, function() {
eval("'\u000Dstr\u000Ding\u000D'");
});
$DONOTEVALUATE();
' '

View File

@ -4,9 +4,14 @@
/*---
info: LINE FEED (U+000A) within strings is not allowed
es5id: 7.3_A2.1_T1
esid: sec-line-terminators
description: Insert LINE FEED (\u000A) into string
negative:
phase: parse
type: SyntaxError
---*/
assert.throws(SyntaxError, function() {
eval("'\u000Astr\u000Aing\u000A'");
});
$DONOTEVALUATE();
'
'