| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2040 // The '[' Expression ']' and '.' Identifier parts are parsed by | 2040 // The '[' Expression ']' and '.' Identifier parts are parsed by |
| 2041 // ParseMemberExpressionContinuation, and the Arguments part is parsed by the | 2041 // ParseMemberExpressionContinuation, and the Arguments part is parsed by the |
| 2042 // caller. | 2042 // caller. |
| 2043 | 2043 |
| 2044 // Parse the initial primary or function expression. | 2044 // Parse the initial primary or function expression. |
| 2045 ExpressionT result = this->EmptyExpression(); | 2045 ExpressionT result = this->EmptyExpression(); |
| 2046 if (peek() == Token::FUNCTION) { | 2046 if (peek() == Token::FUNCTION) { |
| 2047 Consume(Token::FUNCTION); | 2047 Consume(Token::FUNCTION); |
| 2048 int function_token_position = position(); | 2048 int function_token_position = position(); |
| 2049 bool is_generator = allow_generators() && Check(Token::MUL); | 2049 bool is_generator = allow_generators() && Check(Token::MUL); |
| 2050 IdentifierT name; | 2050 IdentifierT name = this->EmptyIdentifier(); |
| 2051 bool is_strict_reserved_name = false; | 2051 bool is_strict_reserved_name = false; |
| 2052 Scanner::Location function_name_location = Scanner::Location::invalid(); | 2052 Scanner::Location function_name_location = Scanner::Location::invalid(); |
| 2053 FunctionLiteral::FunctionType function_type = | 2053 FunctionLiteral::FunctionType function_type = |
| 2054 FunctionLiteral::ANONYMOUS_EXPRESSION; | 2054 FunctionLiteral::ANONYMOUS_EXPRESSION; |
| 2055 if (peek_any_identifier()) { | 2055 if (peek_any_identifier()) { |
| 2056 name = ParseIdentifierOrStrictReservedWord(&is_strict_reserved_name, | 2056 name = ParseIdentifierOrStrictReservedWord(&is_strict_reserved_name, |
| 2057 CHECK_OK); | 2057 CHECK_OK); |
| 2058 function_name_location = scanner()->location(); | 2058 function_name_location = scanner()->location(); |
| 2059 function_type = FunctionLiteral::NAMED_EXPRESSION; | 2059 function_type = FunctionLiteral::NAMED_EXPRESSION; |
| 2060 } | 2060 } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2172 "accessor_get_set"); | 2172 "accessor_get_set"); |
| 2173 } | 2173 } |
| 2174 *ok = false; | 2174 *ok = false; |
| 2175 } | 2175 } |
| 2176 } | 2176 } |
| 2177 | 2177 |
| 2178 | 2178 |
| 2179 } } // v8::internal | 2179 } } // v8::internal |
| 2180 | 2180 |
| 2181 #endif // V8_PREPARSER_H | 2181 #endif // V8_PREPARSER_H |
| OLD | NEW |