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/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/char-predicates-inl.h" | 10 #include "src/char-predicates-inl.h" |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 void ParserTraits::CheckPossibleEvalCall(Expression* expression, | 445 void ParserTraits::CheckPossibleEvalCall(Expression* expression, |
446 Scope* scope) { | 446 Scope* scope) { |
447 VariableProxy* callee = expression->AsVariableProxy(); | 447 VariableProxy* callee = expression->AsVariableProxy(); |
448 if (callee != NULL && | 448 if (callee != NULL && |
449 callee->IsVariable(parser_->isolate()->factory()->eval_string())) { | 449 callee->IsVariable(parser_->isolate()->factory()->eval_string())) { |
450 scope->DeclarationScope()->RecordEvalCall(); | 450 scope->DeclarationScope()->RecordEvalCall(); |
451 } | 451 } |
452 } | 452 } |
453 | 453 |
454 | 454 |
455 Expression* ParserTraits::MarkExpressionAsLValue(Expression* expression) { | 455 Expression* ParserTraits::MarkExpressionAsAssigned(Expression* expression) { |
456 VariableProxy* proxy = expression != NULL | 456 VariableProxy* proxy = |
457 ? expression->AsVariableProxy() | 457 expression != NULL ? expression->AsVariableProxy() : NULL; |
458 : NULL; | 458 if (proxy != NULL) proxy->set_is_assigned(); |
459 if (proxy != NULL) proxy->MarkAsLValue(); | |
460 return expression; | 459 return expression; |
461 } | 460 } |
462 | 461 |
463 | 462 |
464 bool ParserTraits::ShortcutNumericLiteralBinaryExpression( | 463 bool ParserTraits::ShortcutNumericLiteralBinaryExpression( |
465 Expression** x, Expression* y, Token::Value op, int pos, | 464 Expression** x, Expression* y, Token::Value op, int pos, |
466 AstNodeFactory<AstConstructionVisitor>* factory) { | 465 AstNodeFactory<AstConstructionVisitor>* factory) { |
467 if ((*x)->AsLiteral() && (*x)->AsLiteral()->value()->IsNumber() && | 466 if ((*x)->AsLiteral() && (*x)->AsLiteral()->value()->IsNumber() && |
468 y->AsLiteral() && y->AsLiteral()->value()->IsNumber()) { | 467 y->AsLiteral() && y->AsLiteral()->value()->IsNumber()) { |
469 double x_val = (*x)->AsLiteral()->value()->Number(); | 468 double x_val = (*x)->AsLiteral()->value()->Number(); |
(...skipping 4356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4826 ASSERT(info()->isolate()->has_pending_exception()); | 4825 ASSERT(info()->isolate()->has_pending_exception()); |
4827 } else { | 4826 } else { |
4828 result = ParseProgram(); | 4827 result = ParseProgram(); |
4829 } | 4828 } |
4830 } | 4829 } |
4831 info()->SetFunction(result); | 4830 info()->SetFunction(result); |
4832 return (result != NULL); | 4831 return (result != NULL); |
4833 } | 4832 } |
4834 | 4833 |
4835 } } // namespace v8::internal | 4834 } } // namespace v8::internal |
OLD | NEW |