OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/debug.h" | 8 #include "src/debug.h" |
9 #include "src/scopeinfo.h" | 9 #include "src/scopeinfo.h" |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 * Lookups a property in an object environment, taking the unscopables into | 118 * Lookups a property in an object environment, taking the unscopables into |
119 * account. This is used For HasBinding spec algorithms for ObjectEnvironment. | 119 * account. This is used For HasBinding spec algorithms for ObjectEnvironment. |
120 */ | 120 */ |
121 static Maybe<PropertyAttributes> UnscopableLookup(LookupIterator* it) { | 121 static Maybe<PropertyAttributes> UnscopableLookup(LookupIterator* it) { |
122 Isolate* isolate = it->isolate(); | 122 Isolate* isolate = it->isolate(); |
123 | 123 |
124 Maybe<PropertyAttributes> attrs = JSReceiver::GetPropertyAttributes(it); | 124 Maybe<PropertyAttributes> attrs = JSReceiver::GetPropertyAttributes(it); |
125 DCHECK(attrs.has_value || isolate->has_pending_exception()); | 125 DCHECK(attrs.has_value || isolate->has_pending_exception()); |
126 if (!attrs.has_value || attrs.value == ABSENT) return attrs; | 126 if (!attrs.has_value || attrs.value == ABSENT) return attrs; |
127 | 127 |
128 Handle<Symbol> unscopables_symbol( | 128 Handle<Symbol> unscopables_symbol = isolate->factory()->unscopables_symbol(); |
129 isolate->native_context()->unscopables_symbol(), isolate); | |
130 Handle<Object> receiver = it->GetReceiver(); | 129 Handle<Object> receiver = it->GetReceiver(); |
131 Handle<Object> unscopables; | 130 Handle<Object> unscopables; |
132 MaybeHandle<Object> maybe_unscopables = | 131 MaybeHandle<Object> maybe_unscopables = |
133 Object::GetProperty(receiver, unscopables_symbol); | 132 Object::GetProperty(receiver, unscopables_symbol); |
134 if (!maybe_unscopables.ToHandle(&unscopables)) { | 133 if (!maybe_unscopables.ToHandle(&unscopables)) { |
135 return Maybe<PropertyAttributes>(); | 134 return Maybe<PropertyAttributes>(); |
136 } | 135 } |
137 if (!unscopables->IsSpecObject()) return attrs; | 136 if (!unscopables->IsSpecObject()) return attrs; |
138 Maybe<bool> blacklist = JSReceiver::HasProperty( | 137 Maybe<bool> blacklist = JSReceiver::HasProperty( |
139 Handle<JSReceiver>::cast(unscopables), it->name()); | 138 Handle<JSReceiver>::cast(unscopables), it->name()); |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { | 488 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { |
490 // During bootstrapping we allow all objects to pass as global | 489 // During bootstrapping we allow all objects to pass as global |
491 // objects. This is necessary to fix circular dependencies. | 490 // objects. This is necessary to fix circular dependencies. |
492 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || | 491 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || |
493 isolate->bootstrapper()->IsActive() || | 492 isolate->bootstrapper()->IsActive() || |
494 object->IsGlobalObject(); | 493 object->IsGlobalObject(); |
495 } | 494 } |
496 #endif | 495 #endif |
497 | 496 |
498 } } // namespace v8::internal | 497 } } // namespace v8::internal |
OLD | NEW |