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 3650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3661 if (traits->IsEvalOrArguments(raw_name) || | 3661 if (traits->IsEvalOrArguments(raw_name) || |
3662 traits->IsFutureStrictReserved(raw_name)) | 3662 traits->IsFutureStrictReserved(raw_name)) |
3663 return false; | 3663 return false; |
3664 | 3664 |
3665 if (scope->IsDeclared(raw_name)) { | 3665 if (scope->IsDeclared(raw_name)) { |
3666 *dupe_loc = Scanner::Location( | 3666 *dupe_loc = Scanner::Location( |
3667 expression->position(), expression->position() + raw_name->length()); | 3667 expression->position(), expression->position() + raw_name->length()); |
3668 return false; | 3668 return false; |
3669 } | 3669 } |
3670 | 3670 |
| 3671 // When the variable was seen, it was recorded as unresolved in the outer |
| 3672 // scope. But it's really not unresolved. |
| 3673 scope->outer_scope()->RemoveUnresolved(expression->AsVariableProxy()); |
| 3674 |
3671 scope->DeclareParameter(raw_name, VAR); | 3675 scope->DeclareParameter(raw_name, VAR); |
3672 ++(*num_params); | 3676 ++(*num_params); |
3673 return true; | 3677 return true; |
3674 } | 3678 } |
3675 | 3679 |
3676 // Case for more than one parameter: | 3680 // Case for more than one parameter: |
3677 // (foo, bar [, ...]) => ... | 3681 // (foo, bar [, ...]) => ... |
3678 if (expression->IsBinaryOperation()) { | 3682 if (expression->IsBinaryOperation()) { |
3679 BinaryOperation* binop = expression->AsBinaryOperation(); | 3683 BinaryOperation* binop = expression->AsBinaryOperation(); |
3680 if (binop->op() != Token::COMMA || binop->left()->is_parenthesized() || | 3684 if (binop->op() != Token::COMMA || binop->left()->is_parenthesized() || |
(...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5558 } else { | 5562 } else { |
5559 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); | 5563 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); |
5560 running_hash = StringHasher::ComputeRunningHash(running_hash, data, | 5564 running_hash = StringHasher::ComputeRunningHash(running_hash, data, |
5561 raw_string->length()); | 5565 raw_string->length()); |
5562 } | 5566 } |
5563 } | 5567 } |
5564 | 5568 |
5565 return running_hash; | 5569 return running_hash; |
5566 } | 5570 } |
5567 } } // namespace v8::internal | 5571 } } // namespace v8::internal |
OLD | NEW |