summaryrefslogtreecommitdiff
path: root/deps/v8/src/preparser.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2011-11-02 16:58:08 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2011-11-02 16:58:35 +0100
commitedea4122b1c725a9f7873c02fe04100995472ddc (patch)
tree3334347495150cfd3a68909489689c112457ae07 /deps/v8/src/preparser.cc
parentcc9223406837e7610b5f36b16b6a0e51861370cb (diff)
downloadnode-new-edea4122b1c725a9f7873c02fe04100995472ddc.tar.gz
Revert "Upgrade V8 to 3.7.1"
This reverts commit 92f5a5d3caf01f382f90c235e9057590a5e76870. V8 3.7.1 in debug mode on ia32 has a curious race-like bug where an fs.Stats object is not fully formed until some time after it's created. This is easy to demonstrate by running `make test-debug`. V8 3.7.0 does not exhibit this behaviour so back we go. Fixes #1981.
Diffstat (limited to 'deps/v8/src/preparser.cc')
-rw-r--r--deps/v8/src/preparser.cc48
1 files changed, 7 insertions, 41 deletions
diff --git a/deps/v8/src/preparser.cc b/deps/v8/src/preparser.cc
index 3313658ef7..9f8e1eecc2 100644
--- a/deps/v8/src/preparser.cc
+++ b/deps/v8/src/preparser.cc
@@ -125,13 +125,11 @@ PreParser::Statement PreParser::ParseSourceElement(bool* ok) {
// In harmony mode we allow additionally the following productions
// SourceElement:
// LetDeclaration
- // ConstDeclaration
switch (peek()) {
case i::Token::FUNCTION:
return ParseFunctionDeclaration(ok);
case i::Token::LET:
- case i::Token::CONST:
return ParseVariableStatement(kSourceElement, ok);
default:
return ParseStatement(ok);
@@ -242,7 +240,7 @@ PreParser::Statement PreParser::ParseStatement(bool* ok) {
i::Scanner::Location start_location = scanner_->peek_location();
Statement statement = ParseFunctionDeclaration(CHECK_OK);
i::Scanner::Location end_location = scanner_->location();
- if (strict_mode() || harmony_scoping_) {
+ if (strict_mode()) {
ReportMessageAt(start_location.beg_pos, end_location.end_pos,
"strict_function", NULL);
*ok = false;
@@ -314,7 +312,6 @@ PreParser::Statement PreParser::ParseVariableStatement(
Statement result = ParseVariableDeclarations(var_context,
NULL,
- NULL,
CHECK_OK);
ExpectSemicolon(CHECK_OK);
return result;
@@ -328,37 +325,15 @@ PreParser::Statement PreParser::ParseVariableStatement(
// of 'for-in' loops.
PreParser::Statement PreParser::ParseVariableDeclarations(
VariableDeclarationContext var_context,
- VariableDeclarationProperties* decl_props,
int* num_decl,
bool* ok) {
// VariableDeclarations ::
// ('var' | 'const') (Identifier ('=' AssignmentExpression)?)+[',']
- //
- // The ES6 Draft Rev3 specifies the following grammar for const declarations
- //
- // ConstDeclaration ::
- // const ConstBinding (',' ConstBinding)* ';'
- // ConstBinding ::
- // Identifier '=' AssignmentExpression
- //
- // TODO(ES6):
- // ConstBinding ::
- // BindingPattern '=' AssignmentExpression
- bool require_initializer = false;
+
if (peek() == i::Token::VAR) {
Consume(i::Token::VAR);
} else if (peek() == i::Token::CONST) {
- if (harmony_scoping_) {
- if (var_context != kSourceElement &&
- var_context != kForStatement) {
- i::Scanner::Location location = scanner_->peek_location();
- ReportMessageAt(location.beg_pos, location.end_pos,
- "unprotected_const", NULL);
- *ok = false;
- return Statement::Default();
- }
- require_initializer = true;
- } else if (strict_mode()) {
+ if (strict_mode()) {
i::Scanner::Location location = scanner_->peek_location();
ReportMessageAt(location, "strict_const", NULL);
*ok = false;
@@ -397,10 +372,9 @@ PreParser::Statement PreParser::ParseVariableDeclarations(
return Statement::Default();
}
nvars++;
- if (peek() == i::Token::ASSIGN || require_initializer) {
+ if (peek() == i::Token::ASSIGN) {
Expect(i::Token::ASSIGN, CHECK_OK);
ParseAssignmentExpression(var_context != kForStatement, CHECK_OK);
- if (decl_props != NULL) *decl_props = kHasInitializers;
}
} while (peek() == i::Token::COMMA);
@@ -595,14 +569,9 @@ PreParser::Statement PreParser::ParseForStatement(bool* ok) {
if (peek() != i::Token::SEMICOLON) {
if (peek() == i::Token::VAR || peek() == i::Token::CONST ||
peek() == i::Token::LET) {
- bool is_let = peek() == i::Token::LET;
int decl_count;
- VariableDeclarationProperties decl_props = kHasNoInitializers;
- ParseVariableDeclarations(
- kForStatement, &decl_props, &decl_count, CHECK_OK);
- bool accept_IN = decl_count == 1 &&
- !(is_let && decl_props == kHasInitializers);
- if (peek() == i::Token::IN && accept_IN) {
+ ParseVariableDeclarations(kForStatement, &decl_count, CHECK_OK);
+ if (peek() == i::Token::IN && decl_count == 1) {
Expect(i::Token::IN, CHECK_OK);
ParseExpression(true, CHECK_OK);
Expect(i::Token::RPAREN, CHECK_OK);
@@ -1384,11 +1353,8 @@ PreParser::Expression PreParser::ParseFunctionLiteral(bool* ok) {
PreParser::Expression PreParser::ParseV8Intrinsic(bool* ok) {
// CallRuntime ::
// '%' Identifier Arguments
+
Expect(i::Token::MOD, CHECK_OK);
- if (!allow_natives_syntax_) {
- *ok = false;
- return Expression::Default();
- }
ParseIdentifier(CHECK_OK);
ParseArguments(ok);