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/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/ast/ast-expression-rewriter.h" | 10 #include "src/ast/ast-expression-rewriter.h" |
(...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 Variable* variable = scope->DeclareVariable( | 1681 Variable* variable = scope->DeclareVariable( |
1682 declaration, mode, init, allow_harmony_restrictive_generators(), | 1682 declaration, mode, init, allow_harmony_restrictive_generators(), |
1683 &sloppy_mode_block_scope_function_redefinition, ok); | 1683 &sloppy_mode_block_scope_function_redefinition, ok); |
1684 if (!*ok) { | 1684 if (!*ok) { |
1685 if (declaration_kind == DeclarationDescriptor::NORMAL) { | 1685 if (declaration_kind == DeclarationDescriptor::NORMAL) { |
1686 ReportMessage(MessageTemplate::kVarRedeclaration, | 1686 ReportMessage(MessageTemplate::kVarRedeclaration, |
1687 declaration->proxy()->raw_name()); | 1687 declaration->proxy()->raw_name()); |
1688 } else { | 1688 } else { |
1689 ReportMessage(MessageTemplate::kParamDupe); | 1689 ReportMessage(MessageTemplate::kParamDupe); |
1690 } | 1690 } |
| 1691 return nullptr; |
1691 } | 1692 } |
1692 if (sloppy_mode_block_scope_function_redefinition) { | 1693 if (sloppy_mode_block_scope_function_redefinition) { |
1693 ++use_counts_[v8::Isolate::kSloppyModeBlockScopedFunctionRedefinition]; | 1694 ++use_counts_[v8::Isolate::kSloppyModeBlockScopedFunctionRedefinition]; |
1694 } | 1695 } |
1695 return variable; | 1696 return variable; |
1696 } | 1697 } |
1697 | 1698 |
1698 // Language extension which is only enabled for source files loaded | 1699 // Language extension which is only enabled for source files loaded |
1699 // through the API's extension mechanism. A native function | 1700 // through the API's extension mechanism. A native function |
1700 // declaration is resolved by looking up the function through a | 1701 // declaration is resolved by looking up the function through a |
(...skipping 4957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6658 node->Print(Isolate::Current()); | 6659 node->Print(Isolate::Current()); |
6659 } | 6660 } |
6660 #endif // DEBUG | 6661 #endif // DEBUG |
6661 | 6662 |
6662 #undef CHECK_OK | 6663 #undef CHECK_OK |
6663 #undef CHECK_OK_VOID | 6664 #undef CHECK_OK_VOID |
6664 #undef CHECK_FAILED | 6665 #undef CHECK_FAILED |
6665 | 6666 |
6666 } // namespace internal | 6667 } // namespace internal |
6667 } // namespace v8 | 6668 } // namespace v8 |
OLD | NEW |