Skip to content
Snippets Groups Projects
Commit 353cf531 authored by Leo Balter's avatar Leo Balter Committed by Rick Waldron
Browse files

Apply review feedback for hashbang

parent da8ef2e7
No related branches found
No related tags found
No related merge requests found
Showing
with 134 additions and 4 deletions
......@@ -7,6 +7,10 @@
#
# https://github.com/tc39/process-document
# Hashbang Grammar
# https://github.com/tc39/proposal-hashbang
hashbang
# Object.fromEntries
# https://github.com/tc39/proposal-object-from-entries
Object.fromEntries
......
#\041
/*---
esid: pending
description: >
Hashbang comments should not be allowed to have encoded characters \041
info: |
HashbangComment::
#! SingleLineCommentChars[opt]
flags: [raw]
negative:
phase: parse
type: SyntaxError
features: [hashbang]
---*/
......@@ -2,9 +2,13 @@
/*---
esid: pending
description: >
Hashbang comments should not be allowed to have encoded characters
Hashbang comments should not be allowed to have encoded characters \u0021
info: |
HashbangComment::
#! SingleLineCommentChars[opt]
flags: [raw]
negative:
phase: parse
type: SyntaxError
features: [hashbang]
---*/
#\u{21}
/*---
esid: pending
description: >
Hashbang comments should not be allowed to have encoded characters \u{21}
info: |
HashbangComment::
#! SingleLineCommentChars[opt]
flags: [raw]
negative:
phase: parse
type: SyntaxError
features: [hashbang]
---*/
#\x21
/*---
esid: pending
description: >
Hashbang comments should not be allowed to have encoded characters \x21
info: |
HashbangComment::
#! SingleLineCommentChars[opt]
flags: [raw]
negative:
phase: parse
type: SyntaxError
features: [hashbang]
---*/
\043!
/*---
esid: pending
description: >
Hashbang comments should not be allowed to have encoded characters \043
info: |
HashbangComment::
#! SingleLineCommentChars[opt]
flags: [raw]
negative:
phase: parse
type: SyntaxError
features: [hashbang]
---*/
......@@ -2,9 +2,13 @@
/*---
esid: pending
description: >
Hashbang comments should not be allowed to have encoded characters
Hashbang comments should not be allowed to have encoded characters \u0023
info: |
HashbangComment::
#! SingleLineCommentChars[opt]
flags: [raw]
negative:
phase: parse
type: SyntaxError
features: [hashbang]
---*/
\u{23}!
/*---
esid: pending
description: >
Hashbang comments should not be allowed to have encoded characters \u{23}
info: |
HashbangComment::
#! SingleLineCommentChars[opt]
flags: [raw]
negative:
phase: parse
type: SyntaxError
features: [hashbang]
---*/
\x23!
/*---
esid: pending
description: >
Hashbang comments should not be allowed to have encoded characters \x23
info: |
HashbangComment::
#! SingleLineCommentChars[opt]
flags: [raw]
negative:
phase: parse
type: SyntaxError
features: [hashbang]
---*/
......@@ -7,4 +7,8 @@ info: |
HashbangComment::
#! SingleLineCommentChars[opt]
flags: [raw]
negative:
phase: parse
type: SyntaxError
features: [hashbang]
---*/
......@@ -5,6 +5,9 @@ description: >
info: |
HashbangComment::
#! SingleLineCommentChars[opt]
features: [hashbang]
---*/
assert.sameValue(eval('#!\n'), undefined);
assert.sameValue(eval('#!\n1'), 1)
assert.sameValue(eval('#!2\n'), undefined);
......@@ -9,6 +9,10 @@ flags: [raw]
negative:
phase: parse
type: SyntaxError
features: [hashbang]
---*/
DONOTEVALUATE();
function fn() {#!
}
......@@ -5,11 +5,12 @@ description: >
info: |
HashbangComment::
#! SingleLineCommentChars[opt]
features: [hashbang]
---*/
const AsyncFunction = (async function (){}).constructor;
const GeneratorFunction = (function *(){}).constructor;
const AsyncGeneratorFunction = (async function *(){}).constructor;
for (ctor of [
for (const ctor of [
Function,
AsyncFunction,
GeneratorFunction,
......
......@@ -7,4 +7,5 @@ info: |
HashbangComment::
#! SingleLineCommentChars[opt]
flags: [module]
features: [hashbang]
---*/
#!/*
DONOTEVALUATE();
these characters should not be considered within a comment
*/
/*---
......@@ -12,4 +13,5 @@ flags: [raw]
negative:
phase: parse
type: SyntaxError
features: [hashbang]
---*/
\ No newline at end of file
......@@ -6,6 +6,7 @@ info: |
HashbangComment::
#! SingleLineCommentChars[opt]
flags: [raw]
features: [hashbang]
---*/
eval('#!');
assert.sameValue(eval('#!'), undefined);
......@@ -7,5 +7,6 @@ info: |
HashbangComment::
#! SingleLineCommentChars[opt]
flags: [raw]
features: [hashbang]
---*/
"use strict";
#!
/*---
esid: pending
description: >
Hashbang comments should only be allowed at start of source texts and should not be preceded by DirectivePrologues.
info: |
HashbangComment::
#! SingleLineCommentChars[opt]
flags: [raw]
negative:
phase: parse
type: SyntaxError
features: [hashbang]
---*/
\ No newline at end of file
......@@ -11,4 +11,5 @@ flags: [raw]
negative:
phase: parse
type: SyntaxError
features: [hashbang]
---*/
\ No newline at end of file
......@@ -10,4 +10,5 @@ flags: [raw]
negative:
phase: parse
type: SyntaxError
features: [hashbang]
---*/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment