| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <cmath> | 5 #include <cmath> |
| 6 | 6 |
| 7 #include "src/allocation.h" | 7 #include "src/allocation.h" |
| 8 #include "src/base/logging.h" | 8 #include "src/base/logging.h" |
| 9 #include "src/conversions-inl.h" | 9 #include "src/conversions-inl.h" |
| 10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 int pos = position(); | 444 int pos = position(); |
| 445 bool is_generator = Check(Token::MUL); | 445 bool is_generator = Check(Token::MUL); |
| 446 bool is_strict_reserved = false; | 446 bool is_strict_reserved = false; |
| 447 Identifier name = ParseIdentifierOrStrictReservedWord( | 447 Identifier name = ParseIdentifierOrStrictReservedWord( |
| 448 &is_strict_reserved, CHECK_OK); | 448 &is_strict_reserved, CHECK_OK); |
| 449 ParseFunctionLiteral(name, scanner()->location(), | 449 ParseFunctionLiteral(name, scanner()->location(), |
| 450 is_strict_reserved ? kFunctionNameIsStrictReserved | 450 is_strict_reserved ? kFunctionNameIsStrictReserved |
| 451 : kFunctionNameValidityUnknown, | 451 : kFunctionNameValidityUnknown, |
| 452 is_generator ? FunctionKind::kGeneratorFunction | 452 is_generator ? FunctionKind::kGeneratorFunction |
| 453 : FunctionKind::kNormalFunction, | 453 : FunctionKind::kNormalFunction, |
| 454 pos, FunctionLiteral::DECLARATION, | 454 pos, FunctionLiteral::kDeclaration, |
| 455 FunctionLiteral::NORMAL_ARITY, language_mode(), | 455 FunctionLiteral::kNormalArity, language_mode(), |
| 456 CHECK_OK); | 456 CHECK_OK); |
| 457 return Statement::FunctionDeclaration(); | 457 return Statement::FunctionDeclaration(); |
| 458 } | 458 } |
| 459 | 459 |
| 460 | 460 |
| 461 PreParser::Statement PreParser::ParseClassDeclaration(bool* ok) { | 461 PreParser::Statement PreParser::ParseClassDeclaration(bool* ok) { |
| 462 Expect(Token::CLASS, CHECK_OK); | 462 Expect(Token::CLASS, CHECK_OK); |
| 463 if (!allow_harmony_sloppy() && is_sloppy(language_mode())) { | 463 if (!allow_harmony_sloppy() && is_sloppy(language_mode())) { |
| 464 ReportMessage(MessageTemplate::kSloppyLexical); | 464 ReportMessage(MessageTemplate::kSloppyLexical); |
| 465 *ok = false; | 465 *ok = false; |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 Expect(Token::RBRACE, CHECK_OK); | 1282 Expect(Token::RBRACE, CHECK_OK); |
| 1283 return PreParserExpression::Default(); | 1283 return PreParserExpression::Default(); |
| 1284 } | 1284 } |
| 1285 } | 1285 } |
| 1286 | 1286 |
| 1287 #undef CHECK_OK | 1287 #undef CHECK_OK |
| 1288 | 1288 |
| 1289 | 1289 |
| 1290 } // namespace internal | 1290 } // namespace internal |
| 1291 } // namespace v8 | 1291 } // namespace v8 |
| OLD | NEW |