Skip to content

Commit 7de9ae9

Browse files
test(test262): insert the strict directive as INTERPRETING.md defines it
The transformation is specified as the directive, a semicolon and a newline as the file's initial character sequence. Keeping it on line 1 preserved the source's line numbers but is not what the document says, and it only stayed safe because every hashbang case carries the raw flag.
1 parent d2ba9a5 commit 7de9ae9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"use strict";
22

33
/**
4-
* Puts test262's "strict" scenario directive where webpack's parser reads it.
5-
* It stays on line 1 so every diagnostic still points at the source's own line.
4+
* Applies test262's strict-mode transformation, which INTERPRETING.md defines as
5+
* inserting the directive plus a newline as the file's initial character sequence.
66
* @param {string} source the test file's source
77
* @returns {string} the same source, parsed as strict mode code
88
*/
9-
module.exports = (source) => `"use strict";${source}`;
9+
module.exports = (source) => `"use strict";\n${source}`;

0 commit comments

Comments
 (0)