mirror of https://github.com/tc39/test262.git
Apply review feedback for hashbang
This commit is contained in:
parent
da8ef2e779
commit
353cf531d6
|
@ -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
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
#\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]
|
||||
---*/
|
|
@ -0,0 +1,14 @@
|
|||
#\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]
|
||||
---*/
|
|
@ -0,0 +1,14 @@
|
|||
#\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]
|
||||
---*/
|
|
@ -0,0 +1,14 @@
|
|||
\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]
|
||||
---*/
|
|
@ -0,0 +1,14 @@
|
|||
\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]
|
||||
---*/
|
|
@ -0,0 +1,14 @@
|
|||
\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]
|
||||
---*/
|
|
@ -1,4 +1,5 @@
|
|||
#!/*
|
||||
DONOTEVALUATE();
|
||||
these characters should not be considered within a comment
|
||||
*/
|
||||
/*---
|
||||
|
@ -12,4 +13,5 @@ flags: [raw]
|
|||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [hashbang]
|
||||
---*/
|
|
@ -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]
|
||||
---*/
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
"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]
|
||||
---*/
|
|
@ -11,4 +11,5 @@ flags: [raw]
|
|||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [hashbang]
|
||||
---*/
|
|
@ -10,4 +10,5 @@ flags: [raw]
|
|||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [hashbang]
|
||||
---*/
|
|
@ -11,4 +11,5 @@ flags: [raw]
|
|||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [hashbang]
|
||||
---*/
|
|
@ -11,4 +11,5 @@ flags: [raw]
|
|||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [hashbang]
|
||||
---*/
|
|
@ -11,4 +11,5 @@ flags: [raw]
|
|||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [hashbang]
|
||||
---*/
|
|
@ -1,4 +1,4 @@
|
|||
#!
|
||||
#!
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
|
@ -10,4 +10,5 @@ flags: [raw]
|
|||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [hashbang]
|
||||
---*/
|
|
@ -9,6 +9,7 @@ flags: [raw]
|
|||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [hashbang]
|
||||
---*/
|
||||
{
|
||||
#!
|
|
@ -2,11 +2,12 @@
|
|||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
Hashbang comments should not be interpretted and should not generate DirectivePrologues.
|
||||
Hashbang comments should not be interpreted and should not generate DirectivePrologues.
|
||||
info: |
|
||||
HashbangComment::
|
||||
#! SingleLineCommentChars[opt]
|
||||
flags: [raw]
|
||||
features: [hashbang]
|
||||
---*/
|
||||
|
||||
with ({}) {}
|
Loading…
Reference in New Issue