From 6e4b434586d219c30da1b1e74900f1c10d027f10 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Fri, 8 Feb 2019 11:06:37 -0500 Subject: [PATCH] Apply review feedback - indirect eval - files renaming - space after comma --- .../{encoded-bang-041.js => escaped-bang-041.js} | 0 ...{encoded-bang-u0021.js => escaped-bang-u0021.js} | 0 .../{encoded-bang-u21.js => escaped-bang-u21.js} | 0 .../{encoded-bang-x21.js => escaped-bang-x21.js} | 0 .../{encoded-hash-043.js => escaped-hash-043.js} | 0 ...{encoded-hash-u0023.js => escaped-hash-u0023.js} | 0 .../{encoded-hash-u23.js => escaped-hash-u23.js} | 0 .../{encoded-hash-x23.js => escaped-hash-x23.js} | 0 .../{encoded-hashbang.js => escaped-hashbang.js} | 0 test/language/comments/hashbang/eval-indirect.js | 13 +++++++++++++ test/language/comments/hashbang/eval.js | 2 +- .../comments/hashbang/function-constructor.js | 4 ++-- 12 files changed, 16 insertions(+), 3 deletions(-) rename test/language/comments/hashbang/{encoded-bang-041.js => escaped-bang-041.js} (100%) rename test/language/comments/hashbang/{encoded-bang-u0021.js => escaped-bang-u0021.js} (100%) rename test/language/comments/hashbang/{encoded-bang-u21.js => escaped-bang-u21.js} (100%) rename test/language/comments/hashbang/{encoded-bang-x21.js => escaped-bang-x21.js} (100%) rename test/language/comments/hashbang/{encoded-hash-043.js => escaped-hash-043.js} (100%) rename test/language/comments/hashbang/{encoded-hash-u0023.js => escaped-hash-u0023.js} (100%) rename test/language/comments/hashbang/{encoded-hash-u23.js => escaped-hash-u23.js} (100%) rename test/language/comments/hashbang/{encoded-hash-x23.js => escaped-hash-x23.js} (100%) rename test/language/comments/hashbang/{encoded-hashbang.js => escaped-hashbang.js} (100%) create mode 100644 test/language/comments/hashbang/eval-indirect.js diff --git a/test/language/comments/hashbang/encoded-bang-041.js b/test/language/comments/hashbang/escaped-bang-041.js similarity index 100% rename from test/language/comments/hashbang/encoded-bang-041.js rename to test/language/comments/hashbang/escaped-bang-041.js diff --git a/test/language/comments/hashbang/encoded-bang-u0021.js b/test/language/comments/hashbang/escaped-bang-u0021.js similarity index 100% rename from test/language/comments/hashbang/encoded-bang-u0021.js rename to test/language/comments/hashbang/escaped-bang-u0021.js diff --git a/test/language/comments/hashbang/encoded-bang-u21.js b/test/language/comments/hashbang/escaped-bang-u21.js similarity index 100% rename from test/language/comments/hashbang/encoded-bang-u21.js rename to test/language/comments/hashbang/escaped-bang-u21.js diff --git a/test/language/comments/hashbang/encoded-bang-x21.js b/test/language/comments/hashbang/escaped-bang-x21.js similarity index 100% rename from test/language/comments/hashbang/encoded-bang-x21.js rename to test/language/comments/hashbang/escaped-bang-x21.js diff --git a/test/language/comments/hashbang/encoded-hash-043.js b/test/language/comments/hashbang/escaped-hash-043.js similarity index 100% rename from test/language/comments/hashbang/encoded-hash-043.js rename to test/language/comments/hashbang/escaped-hash-043.js diff --git a/test/language/comments/hashbang/encoded-hash-u0023.js b/test/language/comments/hashbang/escaped-hash-u0023.js similarity index 100% rename from test/language/comments/hashbang/encoded-hash-u0023.js rename to test/language/comments/hashbang/escaped-hash-u0023.js diff --git a/test/language/comments/hashbang/encoded-hash-u23.js b/test/language/comments/hashbang/escaped-hash-u23.js similarity index 100% rename from test/language/comments/hashbang/encoded-hash-u23.js rename to test/language/comments/hashbang/escaped-hash-u23.js diff --git a/test/language/comments/hashbang/encoded-hash-x23.js b/test/language/comments/hashbang/escaped-hash-x23.js similarity index 100% rename from test/language/comments/hashbang/encoded-hash-x23.js rename to test/language/comments/hashbang/escaped-hash-x23.js diff --git a/test/language/comments/hashbang/encoded-hashbang.js b/test/language/comments/hashbang/escaped-hashbang.js similarity index 100% rename from test/language/comments/hashbang/encoded-hashbang.js rename to test/language/comments/hashbang/escaped-hashbang.js diff --git a/test/language/comments/hashbang/eval-indirect.js b/test/language/comments/hashbang/eval-indirect.js new file mode 100644 index 0000000000..1dcc8e2b57 --- /dev/null +++ b/test/language/comments/hashbang/eval-indirect.js @@ -0,0 +1,13 @@ +/*--- +esid: pending +description: > + Hashbang comments should be available in Script evaluator contexts. (indirect eval) +info: | + HashbangComment:: + #! SingleLineCommentChars[opt] +features: [hashbang] +---*/ + +assert.sameValue((0, eval)('#!\n'), undefined); +assert.sameValue((0, eval)('#!\n1'), 1) +assert.sameValue((0, eval)('#!2\n'), undefined); diff --git a/test/language/comments/hashbang/eval.js b/test/language/comments/hashbang/eval.js index 658afc2116..62cdadf5d4 100644 --- a/test/language/comments/hashbang/eval.js +++ b/test/language/comments/hashbang/eval.js @@ -1,7 +1,7 @@ /*--- esid: pending description: > - Hashbang comments should be available in Script evaluator contexts. + Hashbang comments should be available in Script evaluator contexts. (direct eval) info: | HashbangComment:: #! SingleLineCommentChars[opt] diff --git a/test/language/comments/hashbang/function-constructor.js b/test/language/comments/hashbang/function-constructor.js index fd87b6a6d6..9d98a1736b 100644 --- a/test/language/comments/hashbang/function-constructor.js +++ b/test/language/comments/hashbang/function-constructor.js @@ -17,8 +17,8 @@ for (const ctor of [ GeneratorFunction, AsyncGeneratorFunction, ]) { - assert.throws(SyntaxError, () => ctor('#!\n_',''), `${ctor.name} Call argument`); + assert.throws(SyntaxError, () => ctor('#!\n_', ''), `${ctor.name} Call argument`); assert.throws(SyntaxError, () => ctor('#!\n_'), `${ctor.name} Call body`); - assert.throws(SyntaxError, () => new ctor('#!\n_',''), `${ctor.name} Construct argument`); + assert.throws(SyntaxError, () => new ctor('#!\n_', ''), `${ctor.name} Construct argument`); assert.throws(SyntaxError, () => new ctor('#!\n_'), `${ctor.name} Construct body`); }