Skip to content

Commit 0bb292d

Browse files
authored
Merge pull request #60 from nodejs/master
Sync Fork from Upstream Repo
2 parents 41efe8d + 605615e commit 0bb292d

34 files changed

+1131
-1275
lines changed

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
# Reset this number to 0 on major V8 upgrades.
3737
# Increment by one for each non-official patch applied to deps/v8.
38-
'v8_embedder_string': '-node.30',
38+
'v8_embedder_string': '-node.31',
3939

4040
##### V8 defaults for Node.js #####
4141

deps/v8/src/parsing/parser.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,6 @@ FunctionLiteral* Parser::ParseProgram(Isolate* isolate, ParseInfo* info) {
503503
Scope::DeserializationMode::kIncludingVariables);
504504

505505
scanner_.Initialize();
506-
scanner_.SkipHashBang();
507506
FunctionLiteral* result = DoParseProgram(isolate, info);
508507
MaybeResetCharacterStream(info, result);
509508
MaybeProcessSourceRanges(info, result, stack_limit_);

deps/v8/src/parsing/preparser.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ PreParser::PreParseResult PreParser::PreParseProgram() {
7474
scope->set_is_being_lazily_parsed(true);
7575
#endif
7676

77-
// Note: We should only skip the hashbang in non-Eval scripts
78-
// (currently, Eval is not handled by the PreParser).
79-
scanner()->SkipHashBang();
80-
8177
// ModuleDeclarationInstantiation for Source Text Module Records creates a
8278
// new Module Environment Record whose outer lexical environment record is
8379
// the global scope.

deps/v8/src/parsing/scanner-inl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,10 @@ V8_INLINE Token::Value Scanner::ScanSingleToken() {
505505
return ScanTemplateSpan();
506506

507507
case Token::PRIVATE_NAME:
508+
if (source_pos() == 0 && Peek() == '!') {
509+
token = SkipSingleLineComment();
510+
continue;
511+
}
508512
return ScanPrivateName();
509513

510514
case Token::WHITESPACE:

deps/v8/src/parsing/scanner.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,6 @@ Token::Value Scanner::SkipMultiLineComment() {
314314
return Token::ILLEGAL;
315315
}
316316

317-
void Scanner::SkipHashBang() {
318-
if (c0_ == '#' && Peek() == '!' && source_pos() == 0) {
319-
SkipSingleLineComment();
320-
Scan();
321-
}
322-
}
323-
324317
Token::Value Scanner::ScanHtmlComment() {
325318
// Check for <!-- comments.
326319
DCHECK_EQ(c0_, '!');

deps/v8/src/parsing/scanner.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,6 @@ class V8_EXPORT_PRIVATE Scanner {
421421

422422
const Utf16CharacterStream* stream() const { return source_; }
423423

424-
// If the next characters in the stream are "#!", the line is skipped.
425-
void SkipHashBang();
426-
427424
private:
428425
// Scoped helper for saving & restoring scanner error state.
429426
// This is used for tagged template literals, in which normally forbidden
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env d8
2+
// Copyright 2015 the V8 project authors. All rights reserved.
3+
// Use of this source code is governed by a BSD-style license that can be
4+
// found in the LICENSE file.
5+
//
6+
//
7+
8+
const x = 'valid code';
9+
10+
'incomplete string
11+
12+
const y = 'even more valid code!';
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*%(basename)s:10: SyntaxError: Invalid or unexpected token
2+
'incomplete string
3+
^^^^^^^^^^^^^^^^^^
4+
5+
SyntaxError: Invalid or unexpected token

doc/api/errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2557,7 +2557,7 @@ such as `process.stdout.on('data')`.
25572557
[crypto digest algorithm]: crypto.html#crypto_crypto_gethashes
25582558
[domains]: domain.html
25592559
[event emitter-based]: events.html#events_class_eventemitter
2560-
[exports]: esm.html#esm_package_exports
2560+
[exports]: esm.html#esm_package_entry_points
25612561
[file descriptors]: https://en.wikipedia.org/wiki/File_descriptor
25622562
[policy]: policy.html
25632563
[stream-based]: stream.html

0 commit comments

Comments
 (0)