Refactor string literal test for parsers

Thsi test for the parsing of string literals was expressed using `eval`.
This made the test more complex than necessary and also prevented the
test from providing value to ECMAScript parsers.

Remove the use of `eval` and instead express the expectation with
literal source text.
This commit is contained in:
Mike Pennisi 2018-07-08 11:38:19 -04:00 committed by Rick Waldron
parent 4f1e628107
commit ccaa9571ea
1 changed files with 8 additions and 3 deletions

View File

@ -6,9 +6,14 @@ es5id: 7.8.4-1-s
description: >
A directive preceeding an 'use strict' directive may not contain
an OctalEscapeSequence
negative:
phase: parse
type: SyntaxError
---*/
assert.throws(SyntaxError, function() {
eval(' "asterisk: \\052" /* octal escape sequences forbidden in strict mode*/ ; "use strict";');
throw "Test262: This statement should not be evaluated.";
(function() {
"asterisk: \052";
"use strict";
});