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/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 3363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3374 | 3374 |
3375 bool CheckAndDeclareArrowParameter(ParserTraits* traits, Expression* expression, | 3375 bool CheckAndDeclareArrowParameter(ParserTraits* traits, Expression* expression, |
3376 Scope* scope, int* num_params, | 3376 Scope* scope, int* num_params, |
3377 Scanner::Location* dupe_loc) { | 3377 Scanner::Location* dupe_loc) { |
3378 // Case for empty parameter lists: | 3378 // Case for empty parameter lists: |
3379 // () => ... | 3379 // () => ... |
3380 if (expression == NULL) return true; | 3380 if (expression == NULL) return true; |
3381 | 3381 |
3382 // Too many parentheses around expression: | 3382 // Too many parentheses around expression: |
3383 // (( ... )) => ... | 3383 // (( ... )) => ... |
3384 if (expression->parenthesization_level() > 1) return false; | 3384 if (expression->is_multi_parenthesized()) return false; |
3385 | 3385 |
3386 // Case for a single parameter: | 3386 // Case for a single parameter: |
3387 // (foo) => ... | 3387 // (foo) => ... |
3388 // foo => ... | 3388 // foo => ... |
3389 if (expression->IsVariableProxy()) { | 3389 if (expression->IsVariableProxy()) { |
3390 if (expression->AsVariableProxy()->is_this()) return false; | 3390 if (expression->AsVariableProxy()->is_this()) return false; |
3391 | 3391 |
3392 const AstRawString* raw_name = expression->AsVariableProxy()->raw_name(); | 3392 const AstRawString* raw_name = expression->AsVariableProxy()->raw_name(); |
3393 if (traits->IsEvalOrArguments(raw_name) || | 3393 if (traits->IsEvalOrArguments(raw_name) || |
3394 traits->IsFutureStrictReserved(raw_name)) | 3394 traits->IsFutureStrictReserved(raw_name)) |
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4968 | 4968 |
4969 // We cannot internalize on a background thread; a foreground task will take | 4969 // We cannot internalize on a background thread; a foreground task will take |
4970 // care of calling Parser::Internalize just before compilation. | 4970 // care of calling Parser::Internalize just before compilation. |
4971 | 4971 |
4972 if (compile_options() == ScriptCompiler::kProduceParserCache) { | 4972 if (compile_options() == ScriptCompiler::kProduceParserCache) { |
4973 if (result != NULL) *info_->cached_data() = recorder.GetScriptData(); | 4973 if (result != NULL) *info_->cached_data() = recorder.GetScriptData(); |
4974 log_ = NULL; | 4974 log_ = NULL; |
4975 } | 4975 } |
4976 } | 4976 } |
4977 } } // namespace v8::internal | 4977 } } // namespace v8::internal |
OLD | NEW |