summaryrefslogtreecommitdiff
path: root/deps/v8/test/message
diff options
context:
space:
mode:
authorMatheus Marchini <mmarchini@netflix.com>2020-03-10 10:45:10 -0700
committerAnna Henningsen <anna@addaleax.net>2020-03-13 17:32:58 +0100
commit75da64c0587f2925319cd9c1717a19b647b93511 (patch)
tree6262bfbc308c248969c17fb208acfaec9d21cdae /deps/v8/test/message
parent16cce385c0e6d1fc633e0499d70e99be561ad76f (diff)
downloadnode-new-75da64c0587f2925319cd9c1717a19b647b93511.tar.gz
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: https://github.com/v8/v8/commit/f9257802c1c0a0663a1d05bacf662283f6bd9050 Fixes: https://github.com/nodejs/node/issues/31284 Signed-off-by: Matheus Marchini <mmarchini@netflix.com> PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'deps/v8/test/message')
-rw-r--r--deps/v8/test/message/fail/hashbang-incomplete-string.js12
-rw-r--r--deps/v8/test/message/fail/hashbang-incomplete-string.out5
2 files changed, 17 insertions, 0 deletions
diff --git a/deps/v8/test/message/fail/hashbang-incomplete-string.js b/deps/v8/test/message/fail/hashbang-incomplete-string.js
new file mode 100644
index 0000000000..b3aab937db
--- /dev/null
+++ b/deps/v8/test/message/fail/hashbang-incomplete-string.js
@@ -0,0 +1,12 @@
+#!/usr/bin/env d8
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+//
+
+const x = 'valid code';
+
+'incomplete string
+
+const y = 'even more valid code!';
diff --git a/deps/v8/test/message/fail/hashbang-incomplete-string.out b/deps/v8/test/message/fail/hashbang-incomplete-string.out
new file mode 100644
index 0000000000..db85fe06a6
--- /dev/null
+++ b/deps/v8/test/message/fail/hashbang-incomplete-string.out
@@ -0,0 +1,5 @@
+*%(basename)s:10: SyntaxError: Invalid or unexpected token
+'incomplete string
+^^^^^^^^^^^^^^^^^^
+
+SyntaxError: Invalid or unexpected token