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 "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/ast-expression-rewriter.h" | 9 #include "src/ast/ast-expression-rewriter.h" |
10 #include "src/ast/ast-expression-visitor.h" | 10 #include "src/ast/ast-expression-visitor.h" |
(...skipping 2693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2704 if (is_strict(language_mode())) { | 2704 if (is_strict(language_mode())) { |
2705 ReportMessage(MessageTemplate::kStrictWith); | 2705 ReportMessage(MessageTemplate::kStrictWith); |
2706 *ok = false; | 2706 *ok = false; |
2707 return NULL; | 2707 return NULL; |
2708 } | 2708 } |
2709 | 2709 |
2710 Expect(Token::LPAREN, CHECK_OK); | 2710 Expect(Token::LPAREN, CHECK_OK); |
2711 Expression* expr = ParseExpression(true, CHECK_OK); | 2711 Expression* expr = ParseExpression(true, CHECK_OK); |
2712 Expect(Token::RPAREN, CHECK_OK); | 2712 Expect(Token::RPAREN, CHECK_OK); |
2713 | 2713 |
2714 scope_->DeclarationScope()->RecordWithStatement(); | |
2715 Scope* with_scope = NewScope(scope_, WITH_SCOPE); | 2714 Scope* with_scope = NewScope(scope_, WITH_SCOPE); |
2716 Statement* body; | 2715 Statement* body; |
2717 { BlockState block_state(&scope_, with_scope); | 2716 { BlockState block_state(&scope_, with_scope); |
2718 with_scope->set_start_position(scanner()->peek_location().beg_pos); | 2717 with_scope->set_start_position(scanner()->peek_location().beg_pos); |
2719 body = ParseScopedStatement(labels, true, CHECK_OK); | 2718 body = ParseScopedStatement(labels, true, CHECK_OK); |
2720 with_scope->set_end_position(scanner()->location().end_pos); | 2719 with_scope->set_end_position(scanner()->location().end_pos); |
2721 } | 2720 } |
2722 return factory()->NewWithStatement(with_scope, expr, body, pos); | 2721 return factory()->NewWithStatement(with_scope, expr, body, pos); |
2723 } | 2722 } |
2724 | 2723 |
(...skipping 4058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6783 try_block, target); | 6782 try_block, target); |
6784 final_loop = target; | 6783 final_loop = target; |
6785 } | 6784 } |
6786 | 6785 |
6787 return final_loop; | 6786 return final_loop; |
6788 } | 6787 } |
6789 | 6788 |
6790 | 6789 |
6791 } // namespace internal | 6790 } // namespace internal |
6792 } // namespace v8 | 6791 } // namespace v8 |
OLD | NEW |