Commit ae90bcc
deps: V8: cherry-pick f9257802c1c0
Original commit message:
Fix scanner-level error reporting for hashbang
When the file begins with a hashbang, the scanner is in a failed state
when SkipHashbang() is called. This is usually not an issue but when
the parser encounters an ILLEGAL token, it will reset the SyntaxError
location because of it.
Bug: v8:10110
Change-Id: I1c7344bf5ad20079cff80130c991f3bff4d7e9a8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1995312
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66038}
Refs: v8/v8@f925780
Fixes: #31284
Signed-off-by: Matheus Marchini <mmarchini@netflix.com>
PR-URL: #32180
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>1 parent fd80c21 commit ae90bccCopy full SHA for ae90bcc
File tree
Expand file treeCollapse file tree
8 files changed
+22
-16
lines changedOpen diff view settings
Filter options
- deps/v8
- src/parsing
- test/message/fail
Expand file treeCollapse file tree
8 files changed
+22
-16
lines changedOpen diff view settings
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
35 | 35 | |
36 | 36 | |
37 | 37 | |
38 | | - |
| 38 | + |
39 | 39 | |
40 | 40 | |
41 | 41 | |
|
Collapse file
deps/v8/src/parsing/parser.cc
Copy file name to clipboardExpand all lines: deps/v8/src/parsing/parser.cc-1Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
503 | 503 | |
504 | 504 | |
505 | 505 | |
506 | | - |
507 | 506 | |
508 | 507 | |
509 | 508 | |
|
Collapse file
deps/v8/src/parsing/preparser.cc
Copy file name to clipboardExpand all lines: deps/v8/src/parsing/preparser.cc-4Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
74 | 74 | |
75 | 75 | |
76 | 76 | |
77 | | - |
78 | | - |
79 | | - |
80 | | - |
81 | 77 | |
82 | 78 | |
83 | 79 | |
|
Collapse file
deps/v8/src/parsing/scanner-inl.h
Copy file name to clipboardExpand all lines: deps/v8/src/parsing/scanner-inl.h+4Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
505 | 505 | |
506 | 506 | |
507 | 507 | |
| 508 | + |
| 509 | + |
| 510 | + |
| 511 | + |
508 | 512 | |
509 | 513 | |
510 | 514 | |
|
Collapse file
deps/v8/src/parsing/scanner.cc
Copy file name to clipboardExpand all lines: deps/v8/src/parsing/scanner.cc-7Lines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
314 | 314 | |
315 | 315 | |
316 | 316 | |
317 | | - |
318 | | - |
319 | | - |
320 | | - |
321 | | - |
322 | | - |
323 | | - |
324 | 317 | |
325 | 318 | |
326 | 319 | |
|
Collapse file
deps/v8/src/parsing/scanner.h
Copy file name to clipboardExpand all lines: deps/v8/src/parsing/scanner.h-3Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
421 | 421 | |
422 | 422 | |
423 | 423 | |
424 | | - |
425 | | - |
426 | | - |
427 | 424 | |
428 | 425 | |
429 | 426 | |
|
Collapse file
deps/v8/test/message/fail/hashbang-incomplete-string.js
Copy file name to clipboard+12Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
Collapse file
deps/v8/test/message/fail/hashbang-incomplete-string.out
Copy file name to clipboard+5Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
0 commit comments