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 #ifndef V8_PARSING_PARSER_BASE_H | 5 #ifndef V8_PARSING_PARSER_BASE_H |
6 #define V8_PARSING_PARSER_BASE_H | 6 #define V8_PARSING_PARSER_BASE_H |
7 | 7 |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 3863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3874 // Async functions don't undergo sloppy mode block scoped hoisting, and don't | 3874 // Async functions don't undergo sloppy mode block scoped hoisting, and don't |
3875 // allow duplicates in a block. Both are represented by the | 3875 // allow duplicates in a block. Both are represented by the |
3876 // sloppy_block_function_map. Don't add them to the map for async functions. | 3876 // sloppy_block_function_map. Don't add them to the map for async functions. |
3877 // Generators are also supposed to be prohibited; currently doing this behind | 3877 // Generators are also supposed to be prohibited; currently doing this behind |
3878 // a flag and UseCounting violations to assess web compatibility. | 3878 // a flag and UseCounting violations to assess web compatibility. |
3879 bool is_sloppy_block_function = | 3879 bool is_sloppy_block_function = |
3880 is_sloppy(language_mode()) && !scope()->is_declaration_scope() && | 3880 is_sloppy(language_mode()) && !scope()->is_declaration_scope() && |
3881 !is_async && !(allow_harmony_restrictive_generators() && is_generator); | 3881 !is_async && !(allow_harmony_restrictive_generators() && is_generator); |
3882 | 3882 |
3883 return impl()->DeclareFunction(variable_name, function, mode, pos, | 3883 return impl()->DeclareFunction(variable_name, function, mode, pos, |
3884 is_generator, is_async, | |
3885 is_sloppy_block_function, names, ok); | 3884 is_sloppy_block_function, names, ok); |
3886 } | 3885 } |
3887 | 3886 |
3888 template <typename Impl> | 3887 template <typename Impl> |
3889 typename ParserBase<Impl>::StatementT ParserBase<Impl>::ParseClassDeclaration( | 3888 typename ParserBase<Impl>::StatementT ParserBase<Impl>::ParseClassDeclaration( |
3890 ZoneList<const AstRawString*>* names, bool default_export, bool* ok) { | 3889 ZoneList<const AstRawString*>* names, bool default_export, bool* ok) { |
3891 // ClassDeclaration :: | 3890 // ClassDeclaration :: |
3892 // 'class' Identifier ('extends' LeftHandExpression)? '{' ClassBody '}' | 3891 // 'class' Identifier ('extends' LeftHandExpression)? '{' ClassBody '}' |
3893 // 'class' ('extends' LeftHandExpression)? '{' ClassBody '}' | 3892 // 'class' ('extends' LeftHandExpression)? '{' ClassBody '}' |
3894 // | 3893 // |
(...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5751 return; | 5750 return; |
5752 } | 5751 } |
5753 } | 5752 } |
5754 | 5753 |
5755 #undef CHECK_OK_VOID | 5754 #undef CHECK_OK_VOID |
5756 | 5755 |
5757 } // namespace internal | 5756 } // namespace internal |
5758 } // namespace v8 | 5757 } // namespace v8 |
5759 | 5758 |
5760 #endif // V8_PARSING_PARSER_BASE_H | 5759 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |