| 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 return ParseSubStatement(allow_function, ok); | 278 return ParseSubStatement(allow_function, ok); |
| 279 } | 279 } |
| 280 | 280 |
| 281 PreParser::Statement PreParser::ParseScopedStatement(bool legacy, bool* ok) { | 281 PreParser::Statement PreParser::ParseScopedStatement(bool legacy, bool* ok) { |
| 282 if (is_strict(language_mode()) || peek() != Token::FUNCTION || | 282 if (is_strict(language_mode()) || peek() != Token::FUNCTION || |
| 283 (legacy && allow_harmony_restrictive_declarations())) { | 283 (legacy && allow_harmony_restrictive_declarations())) { |
| 284 return ParseSubStatement(kDisallowLabelledFunctionStatement, ok); | 284 return ParseSubStatement(kDisallowLabelledFunctionStatement, ok); |
| 285 } else { | 285 } else { |
| 286 Scope* body_scope = NewScope(scope_, BLOCK_SCOPE); | 286 Scope* body_scope = NewScope(scope_, BLOCK_SCOPE); |
| 287 BlockState block_state(&scope_, body_scope); | 287 BlockState block_state(&scope_, body_scope); |
| 288 return ParseFunctionDeclaration(CHECK_OK); | 288 return ParseFunctionDeclaration(ok); |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 | 291 |
| 292 PreParser::Statement PreParser::ParseSubStatement( | 292 PreParser::Statement PreParser::ParseSubStatement( |
| 293 AllowLabelledFunctionStatement allow_function, bool* ok) { | 293 AllowLabelledFunctionStatement allow_function, bool* ok) { |
| 294 // Statement :: | 294 // Statement :: |
| 295 // Block | 295 // Block |
| 296 // VariableStatement | 296 // VariableStatement |
| 297 // EmptyStatement | 297 // EmptyStatement |
| 298 // ExpressionStatement | 298 // ExpressionStatement |
| (...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1223 } | 1223 } |
| 1224 Expect(Token::RBRACE, CHECK_OK); | 1224 Expect(Token::RBRACE, CHECK_OK); |
| 1225 return PreParserExpression::Default(); | 1225 return PreParserExpression::Default(); |
| 1226 } | 1226 } |
| 1227 | 1227 |
| 1228 #undef CHECK_OK | 1228 #undef CHECK_OK |
| 1229 | 1229 |
| 1230 | 1230 |
| 1231 } // namespace internal | 1231 } // namespace internal |
| 1232 } // namespace v8 | 1232 } // namespace v8 |
| OLD | NEW |