OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2453 // for (x' in e) { | 2453 // for (x' in e) { |
2454 // let x; | 2454 // let x; |
2455 // x = x'; | 2455 // x = x'; |
2456 // b; | 2456 // b; |
2457 // } | 2457 // } |
2458 | 2458 |
2459 // TODO(keuchel): Move the temporary variable to the block scope, after | 2459 // TODO(keuchel): Move the temporary variable to the block scope, after |
2460 // implementing stack allocated block scoped variables. | 2460 // implementing stack allocated block scoped variables. |
2461 Variable* temp = top_scope_->DeclarationScope()->NewTemporary(name); | 2461 Variable* temp = top_scope_->DeclarationScope()->NewTemporary(name); |
2462 VariableProxy* temp_proxy = new(zone()) VariableProxy(isolate(), temp); | 2462 VariableProxy* temp_proxy = new(zone()) VariableProxy(isolate(), temp); |
2463 VariableProxy* each = top_scope_->NewUnresolved(name, inside_with()); | 2463 VariableProxy* each = top_scope_->NewUnresolved(name); |
2464 ForInStatement* loop = new(zone()) ForInStatement(isolate(), labels); | 2464 ForInStatement* loop = new(zone()) ForInStatement(isolate(), labels); |
2465 Target target(&this->target_stack_, loop); | 2465 Target target(&this->target_stack_, loop); |
2466 | 2466 |
2467 Expect(Token::IN, CHECK_OK); | 2467 Expect(Token::IN, CHECK_OK); |
2468 Expression* enumerable = ParseExpression(true, CHECK_OK); | 2468 Expression* enumerable = ParseExpression(true, CHECK_OK); |
2469 Expect(Token::RPAREN, CHECK_OK); | 2469 Expect(Token::RPAREN, CHECK_OK); |
2470 | 2470 |
2471 Statement* body = ParseStatement(NULL, CHECK_OK); | 2471 Statement* body = ParseStatement(NULL, CHECK_OK); |
2472 Block* body_block = new(zone()) Block(isolate(), NULL, 3, false); | 2472 Block* body_block = new(zone()) Block(isolate(), NULL, 3, false); |
2473 Assignment* assignment = new(zone()) Assignment(isolate(), | 2473 Assignment* assignment = new(zone()) Assignment(isolate(), |
(...skipping 2936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5410 result = parser.ParseProgram(source, | 5410 result = parser.ParseProgram(source, |
5411 info->is_global(), | 5411 info->is_global(), |
5412 info->strict_mode_flag()); | 5412 info->strict_mode_flag()); |
5413 } | 5413 } |
5414 } | 5414 } |
5415 info->SetFunction(result); | 5415 info->SetFunction(result); |
5416 return (result != NULL); | 5416 return (result != NULL); |
5417 } | 5417 } |
5418 | 5418 |
5419 } } // namespace v8::internal | 5419 } } // namespace v8::internal |
OLD | NEW |