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/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 for (int i = 0; i < local_count; ++i) { | 753 for (int i = 0; i < local_count; ++i) { |
754 if (scope_info->LocalIsSynthetic(first_context_var + i)) continue; | 754 if (scope_info->LocalIsSynthetic(first_context_var + i)) continue; |
755 int context_index = Context::MIN_CONTEXT_SLOTS + i; | 755 int context_index = Context::MIN_CONTEXT_SLOTS + i; |
756 Handle<Object> value = Handle<Object>(context->get(context_index), isolate); | 756 Handle<Object> value = Handle<Object>(context->get(context_index), isolate); |
757 // Reflect variables under TDZ as undefined in scope object. | 757 // Reflect variables under TDZ as undefined in scope object. |
758 if (value->IsTheHole()) continue; | 758 if (value->IsTheHole()) continue; |
759 // This should always succeed. | 759 // This should always succeed. |
760 // TODO(verwaest): Use AddDataProperty instead. | 760 // TODO(verwaest): Use AddDataProperty instead. |
761 JSObject::SetOwnPropertyIgnoreAttributes( | 761 JSObject::SetOwnPropertyIgnoreAttributes( |
762 scope_object, handle(String::cast(scope_info->get(i + start))), value, | 762 scope_object, handle(String::cast(scope_info->get(i + start))), value, |
763 ::NONE) | 763 NONE) |
764 .Check(); | 764 .Check(); |
765 } | 765 } |
766 } | 766 } |
767 | 767 |
768 | 768 |
769 bool ScopeIterator::CopyContextExtensionToScopeObject( | 769 bool ScopeIterator::CopyContextExtensionToScopeObject( |
770 Handle<JSObject> extension, Handle<JSObject> scope_object, | 770 Handle<JSObject> extension, Handle<JSObject> scope_object, |
771 JSReceiver::KeyCollectionType type) { | 771 JSReceiver::KeyCollectionType type) { |
772 Handle<FixedArray> keys; | 772 Handle<FixedArray> keys; |
773 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 773 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
774 isolate_, keys, JSReceiver::GetKeys(extension, type), false); | 774 isolate_, keys, JSReceiver::GetKeys(extension, type, ENUMERABLE_STRINGS), |
| 775 false); |
775 | 776 |
776 for (int i = 0; i < keys->length(); i++) { | 777 for (int i = 0; i < keys->length(); i++) { |
777 // Names of variables introduced by eval are strings. | 778 // Names of variables introduced by eval are strings. |
778 DCHECK(keys->get(i)->IsString()); | 779 DCHECK(keys->get(i)->IsString()); |
779 Handle<String> key(String::cast(keys->get(i))); | 780 Handle<String> key(String::cast(keys->get(i))); |
780 Handle<Object> value; | 781 Handle<Object> value; |
781 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 782 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
782 isolate_, value, Object::GetPropertyOrElement(extension, key), false); | 783 isolate_, value, Object::GetPropertyOrElement(extension, key), false); |
783 RETURN_ON_EXCEPTION_VALUE( | 784 RETURN_ON_EXCEPTION_VALUE( |
784 isolate_, JSObject::SetOwnPropertyIgnoreAttributes( | 785 isolate_, JSObject::SetOwnPropertyIgnoreAttributes( |
785 scope_object, key, value, NONE), false); | 786 scope_object, key, value, NONE), false); |
786 } | 787 } |
787 return true; | 788 return true; |
788 } | 789 } |
789 | 790 |
790 } // namespace internal | 791 } // namespace internal |
791 } // namespace v8 | 792 } // namespace v8 |
OLD | NEW |