OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast.h" | 8 #include "src/ast.h" |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1394 Statement* Parser::ParseExportDeclaration(bool* ok) { | 1394 Statement* Parser::ParseExportDeclaration(bool* ok) { |
1395 // ExportDeclaration: | 1395 // ExportDeclaration: |
1396 // 'export' Identifier (',' Identifier)* ';' | 1396 // 'export' Identifier (',' Identifier)* ';' |
1397 // 'export' VariableDeclaration | 1397 // 'export' VariableDeclaration |
1398 // 'export' FunctionDeclaration | 1398 // 'export' FunctionDeclaration |
1399 // 'export' GeneratorDeclaration | 1399 // 'export' GeneratorDeclaration |
1400 // 'export' ModuleDeclaration | 1400 // 'export' ModuleDeclaration |
1401 // | 1401 // |
1402 // TODO(ES6): implement structuring ExportSpecifiers | 1402 // TODO(ES6): implement structuring ExportSpecifiers |
1403 | 1403 |
1404 ASSERT(strict_mode() == STRICT); | |
1405 | |
1406 Expect(Token::EXPORT, CHECK_OK); | 1404 Expect(Token::EXPORT, CHECK_OK); |
1407 | 1405 |
1408 Statement* result = NULL; | 1406 Statement* result = NULL; |
1409 ZoneList<const AstRawString*> names(1, zone()); | 1407 ZoneList<const AstRawString*> names(1, zone()); |
1410 switch (peek()) { | 1408 switch (peek()) { |
1411 case Token::IDENTIFIER: { | 1409 case Token::IDENTIFIER: { |
1412 int pos = position(); | 1410 int pos = position(); |
1413 const AstRawString* name = | 1411 const AstRawString* name = |
1414 ParseIdentifier(kDontAllowEvalOrArguments, CHECK_OK); | 1412 ParseIdentifier(kDontAllowEvalOrArguments, CHECK_OK); |
1415 // Handle 'module' as a context-sensitive keyword. | 1413 // Handle 'module' as a context-sensitive keyword. |
(...skipping 3381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4797 info()->SetAstValueFactory(ast_value_factory_); | 4795 info()->SetAstValueFactory(ast_value_factory_); |
4798 } | 4796 } |
4799 ast_value_factory_ = NULL; | 4797 ast_value_factory_ = NULL; |
4800 | 4798 |
4801 InternalizeUseCounts(); | 4799 InternalizeUseCounts(); |
4802 | 4800 |
4803 return (result != NULL); | 4801 return (result != NULL); |
4804 } | 4802 } |
4805 | 4803 |
4806 } } // namespace v8::internal | 4804 } } // namespace v8::internal |
OLD | NEW |