Skip to content
Permalink
Browse files

[esnext] allow hashbang in eval() and unskip hashbang test262 tests

Fix original imlpementation to support occurrence in eval(), and unskip
tests.

BUG=v8:8523
r=gsathya@chromium.org, mathias@chromium.org, littledan@chromium.org

Change-Id: I80a3e8623357947c564a6cdf865eeff435b8e640
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1510792
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#60246}
  • Loading branch information...
caitp authored and Commit Bot committed Mar 14, 2019
1 parent b240733 commit 6487ad7a338a3705a82c95fe89ed542d24f5a301
Showing with 6 additions and 31 deletions.
  1. +1 −1 src/parsing/parser.cc
  2. +5 −5 test/mjsunit/harmony/hashbang-eval.js
  3. +0 −25 test/test262/test262.status
@@ -500,7 +500,7 @@ FunctionLiteral* Parser::ParseProgram(Isolate* isolate, ParseInfo* info) {
Scope::DeserializationMode::kIncludingVariables);

scanner_.Initialize();
if (FLAG_harmony_hashbang && !info->is_eval()) {
if (FLAG_harmony_hashbang) {
scanner_.SkipHashBang();
}
FunctionLiteral* result = DoParseProgram(isolate, info);
@@ -4,8 +4,8 @@

// Flags: --harmony-hashbang

// Hashbang syntax is not allowed in eval.
assertThrows("#!", SyntaxError);
assertThrows("#!\n", SyntaxError);
assertThrows("#!---IGNORED---", SyntaxError);
assertThrows("#!---IGNORED---\n", SyntaxError);
// Hashbang syntax is allowed in eval.
assertEquals(eval("#!"), undefined);
assertEquals(eval("#!\n"), undefined);
assertEquals(eval("#!---IGNORED---"), undefined);
assertEquals(eval("#!---IGNORED---\n"), undefined);
@@ -551,31 +551,6 @@
'language/expressions/prefix-increment/eval': [SKIP],
'language/expressions/prefix-increment/eval-nostrict': [SKIP],

# https://bugs.chromium.org/p/v8/issues/detail?id=8850
'language/comments/hashbang/escaped-bang-041': [SKIP],
'language/comments/hashbang/escaped-bang-u0021': [SKIP],
'language/comments/hashbang/escaped-bang-u21': [SKIP],
'language/comments/hashbang/escaped-bang-x21': [SKIP],
'language/comments/hashbang/escaped-hash-043': [SKIP],
'language/comments/hashbang/escaped-hash-u0023': [SKIP],
'language/comments/hashbang/escaped-hash-u23': [SKIP],
'language/comments/hashbang/escaped-hash-x23': [SKIP],
'language/comments/hashbang/escaped-hashbang': [SKIP],
'language/comments/hashbang/eval': [SKIP],
'language/comments/hashbang/eval-indirect': [SKIP],
'language/comments/hashbang/module': [SKIP],
'language/comments/hashbang/multi-line-comment': [SKIP],
'language/comments/hashbang/no-line-separator': [SKIP],
'language/comments/hashbang/not-empty': [SKIP],
'language/comments/hashbang/preceding-directive-prologue': [SKIP],
'language/comments/hashbang/preceding-directive-prologue-sc': [SKIP],
'language/comments/hashbang/preceding-empty-statement': [SKIP],
'language/comments/hashbang/preceding-hashbang': [SKIP],
'language/comments/hashbang/preceding-line-comment': [SKIP],
'language/comments/hashbang/preceding-multi-line-comment': [SKIP],
'language/comments/hashbang/preceding-whitespace': [SKIP],
'language/comments/hashbang/use-strict': [SKIP],

######################## NEEDS INVESTIGATION ###########################

# https://bugs.chromium.org/p/v8/issues/detail?id=7833

0 comments on commit 6487ad7

Please sign in to comment.
You can’t perform that action at this time.