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 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 void PreParser::ParseLazyFunctionLiteralBody(bool* ok, | 1171 void PreParser::ParseLazyFunctionLiteralBody(bool* ok, |
1172 Scanner::BookmarkScope* bookmark) { | 1172 Scanner::BookmarkScope* bookmark) { |
1173 int body_start = position(); | 1173 int body_start = position(); |
1174 ParseStatementList(Token::RBRACE, ok, bookmark); | 1174 ParseStatementList(Token::RBRACE, ok, bookmark); |
1175 if (!*ok) return; | 1175 if (!*ok) return; |
1176 if (bookmark && bookmark->HasBeenReset()) return; | 1176 if (bookmark && bookmark->HasBeenReset()) return; |
1177 | 1177 |
1178 // Position right after terminal '}'. | 1178 // Position right after terminal '}'. |
1179 DCHECK_EQ(Token::RBRACE, scanner()->peek()); | 1179 DCHECK_EQ(Token::RBRACE, scanner()->peek()); |
1180 int body_end = scanner()->peek_location().end_pos; | 1180 int body_end = scanner()->peek_location().end_pos; |
| 1181 DeclarationScope* scope = this->scope()->AsDeclarationScope(); |
| 1182 DCHECK(scope->is_function_scope()); |
1181 log_->LogFunction(body_start, body_end, | 1183 log_->LogFunction(body_start, body_end, |
1182 function_state_->materialized_literal_count(), | 1184 function_state_->materialized_literal_count(), |
1183 function_state_->expected_property_count(), language_mode(), | 1185 function_state_->expected_property_count(), language_mode(), |
1184 scope()->uses_super_property(), scope()->calls_eval()); | 1186 scope->uses_super_property(), scope->calls_eval()); |
1185 } | 1187 } |
1186 | 1188 |
1187 PreParserExpression PreParser::ParseClassLiteral( | 1189 PreParserExpression PreParser::ParseClassLiteral( |
1188 ExpressionClassifier* classifier, PreParserIdentifier name, | 1190 ExpressionClassifier* classifier, PreParserIdentifier name, |
1189 Scanner::Location class_name_location, bool name_is_strict_reserved, | 1191 Scanner::Location class_name_location, bool name_is_strict_reserved, |
1190 int pos, bool* ok) { | 1192 int pos, bool* ok) { |
1191 // All parts of a ClassDeclaration and ClassExpression are strict code. | 1193 // All parts of a ClassDeclaration and ClassExpression are strict code. |
1192 if (name_is_strict_reserved) { | 1194 if (name_is_strict_reserved) { |
1193 ReportMessageAt(class_name_location, | 1195 ReportMessageAt(class_name_location, |
1194 MessageTemplate::kUnexpectedStrictReserved); | 1196 MessageTemplate::kUnexpectedStrictReserved); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 | 1293 |
1292 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); | 1294 body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); |
1293 } | 1295 } |
1294 | 1296 |
1295 #undef CHECK_OK | 1297 #undef CHECK_OK |
1296 #undef CHECK_OK_CUSTOM | 1298 #undef CHECK_OK_CUSTOM |
1297 | 1299 |
1298 | 1300 |
1299 } // namespace internal | 1301 } // namespace internal |
1300 } // namespace v8 | 1302 } // namespace v8 |
OLD | NEW |