| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/debug/debug-scopes.h" | 5 #include "src/debug/debug-scopes.h" |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
| 10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 Isolate* isolate = scope_info->GetIsolate(); | 749 Isolate* isolate = scope_info->GetIsolate(); |
| 750 int local_count = scope_info->ContextLocalCount(); | 750 int local_count = scope_info->ContextLocalCount(); |
| 751 if (local_count == 0) return; | 751 if (local_count == 0) return; |
| 752 // Fill all context locals to the context extension. | 752 // Fill all context locals to the context extension. |
| 753 for (int i = 0; i < local_count; ++i) { | 753 for (int i = 0; i < local_count; ++i) { |
| 754 Handle<String> name(scope_info->ContextLocalName(i)); | 754 Handle<String> name(scope_info->ContextLocalName(i)); |
| 755 if (ScopeInfo::VariableIsSynthetic(*name)) continue; | 755 if (ScopeInfo::VariableIsSynthetic(*name)) continue; |
| 756 int context_index = Context::MIN_CONTEXT_SLOTS + i; | 756 int context_index = Context::MIN_CONTEXT_SLOTS + i; |
| 757 Handle<Object> value = Handle<Object>(context->get(context_index), isolate); | 757 Handle<Object> value = Handle<Object>(context->get(context_index), isolate); |
| 758 // Reflect variables under TDZ as undefined in scope object. | 758 // Reflect variables under TDZ as undefined in scope object. |
| 759 if (value->IsTheHole()) continue; | 759 if (value->IsTheHole(isolate)) continue; |
| 760 // This should always succeed. | 760 // This should always succeed. |
| 761 // TODO(verwaest): Use AddDataProperty instead. | 761 // TODO(verwaest): Use AddDataProperty instead. |
| 762 JSObject::SetOwnPropertyIgnoreAttributes(scope_object, name, value, NONE) | 762 JSObject::SetOwnPropertyIgnoreAttributes(scope_object, name, value, NONE) |
| 763 .Check(); | 763 .Check(); |
| 764 } | 764 } |
| 765 } | 765 } |
| 766 | 766 |
| 767 void ScopeIterator::CopyContextExtensionToScopeObject( | 767 void ScopeIterator::CopyContextExtensionToScopeObject( |
| 768 Handle<Context> context, Handle<JSObject> scope_object, | 768 Handle<Context> context, Handle<JSObject> scope_object, |
| 769 KeyCollectionMode mode) { | 769 KeyCollectionMode mode) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 DCHECK((beg_pos >= 0 && end_pos >= 0) || inner_scope->is_hidden()); | 802 DCHECK((beg_pos >= 0 && end_pos >= 0) || inner_scope->is_hidden()); |
| 803 if (beg_pos <= position && position < end_pos) { | 803 if (beg_pos <= position && position < end_pos) { |
| 804 GetNestedScopeChain(isolate, inner_scope, position); | 804 GetNestedScopeChain(isolate, inner_scope, position); |
| 805 return; | 805 return; |
| 806 } | 806 } |
| 807 } | 807 } |
| 808 } | 808 } |
| 809 | 809 |
| 810 } // namespace internal | 810 } // namespace internal |
| 811 } // namespace v8 | 811 } // namespace v8 |
| OLD | NEW |