Lines Matching +full:- +full:- +full:fix +full:- +full:imports +full:- +full:only
2 // Use of this source code is governed by a BSD-style license that can be
10 #include "src/isolate-inl.h"
11 #include "src/objects/module-inl.h"
20 int used = table->used(); in Extend()
21 int length = table->length(); in Extend()
25 Isolate* isolate = script_context->GetIsolate(); in Extend()
27 isolate->factory()->CopyFixedArrayAndGrow(table, length); in Extend()
28 copy->set_map(ReadOnlyRoots(isolate).script_context_table_map()); in Extend()
33 result->set_used(used + 1); in Extend()
35 DCHECK(script_context->IsScriptContext()); in Extend()
36 result->set(used + kFirstContextSlotIndex, *script_context); in Extend()
43 for (int i = 0; i < table->used(); i++) { in Lookup()
45 DCHECK(context->IsScriptContext()); in Lookup()
46 Handle<ScopeInfo> scope_info(context->scope_info(), context->GetIsolate()); in Lookup()
48 scope_info, name, &result->mode, &result->init_flag, in Lookup()
49 &result->maybe_assigned_flag); in Lookup()
52 result->context_index = i; in Lookup()
53 result->slot_index = slot_index; in Lookup()
67 return scope_info()->language_mode() == LanguageMode::kStrict; in is_declaration_context()
70 return scope_info()->is_declaration_scope(); in is_declaration_context()
76 while (!current->is_declaration_context()) { in declaration_context()
77 current = current->previous(); in declaration_context()
84 while (!current->IsFunctionContext() && !current->IsScriptContext() && in closure_context()
85 !current->IsModuleContext() && !current->IsNativeContext() && in closure_context()
86 !current->IsEvalContext()) { in closure_context()
87 current = current->previous(); in closure_context()
96 if (object->IsTheHole()) return nullptr; in extension_object()
97 DCHECK(object->IsJSContextExtensionObject() || in extension_object()
98 (IsNativeContext() && object->IsJSGlobalObject())); in extension_object()
114 while (!current->IsModuleContext()) { in module()
115 current = current->previous(); in module()
117 return Module::cast(current->extension()); in module()
121 return JSGlobalObject::cast(native_context()->extension()); in global_object()
127 while (!current->IsScriptContext()) { in script_context()
128 current = current->previous(); in script_context()
134 return native_context()->global_proxy_object(); in global_proxy()
138 native_context()->set_global_proxy_object(object); in set_global_proxy()
147 Isolate* isolate = it->isolate(); in UnscopableLookup()
156 Handle<JSReceiver>::cast(it->GetReceiver()), in UnscopableLookup()
157 isolate->factory()->unscopables_symbol()), in UnscopableLookup()
159 if (!unscopables->IsJSReceiver()) return Just(true); in UnscopableLookup()
164 it->name()), in UnscopableLookup()
166 return Just(!blacklist->BooleanValue(isolate)); in UnscopableLookup()
194 name->ShortPrint(); in Lookup()
200 PrintF(" - looking in context %p", reinterpret_cast<void*>(*context)); in Lookup()
201 if (context->IsScriptContext()) PrintF(" (script context)"); in Lookup()
202 if (context->IsNativeContext()) PrintF(" (native context)"); in Lookup()
207 DCHECK_IMPLIES(context->IsEvalContext(), in Lookup()
208 context->extension()->IsTheHole(isolate)); in Lookup()
209 if ((context->IsNativeContext() || in Lookup()
210 (context->IsWithContext() && ((flags & SKIP_WITH_CONTEXT) == 0)) || in Lookup()
211 context->IsFunctionContext() || context->IsBlockContext()) && in Lookup()
212 context->extension_receiver() != nullptr) { in Lookup()
213 Handle<JSReceiver> object(context->extension_receiver(), isolate); in Lookup()
215 if (context->IsNativeContext()) { in Lookup()
217 PrintF(" - trying other script contexts\n"); in Lookup()
221 context->global_object()->native_context()->script_context_table(), in Lookup()
242 // to only do a local lookup for context extension objects. in Lookup()
245 object->IsJSContextExtensionObject()) { in Lookup()
247 } else if (context->IsWithContext()) { in Lookup()
248 // A with context will never bind "this", but debug-eval may look into in Lookup()
252 // thorough fix can be applied. in Lookup()
263 // Luckily, consumers of |maybe| only care whether the property in Lookup()
274 DCHECK(!isolate->has_pending_exception()); in Lookup()
287 if (context->IsFunctionContext() || context->IsBlockContext() || in Lookup()
288 context->IsScriptContext() || context->IsEvalContext() || in Lookup()
289 context->IsModuleContext() || context->IsCatchContext()) { in Lookup()
292 Handle<ScopeInfo> scope_info(context->scope_info(), isolate); in Lookup()
312 // only the function name variable. It's conceptually (and spec-wise) in Lookup()
315 context->IsFunctionContext()) { in Lookup()
316 int function_index = scope_info->FunctionContextSlotIndex(*name); in Lookup()
327 is_sloppy(scope_info->language_mode())) { in Lookup()
334 // Lookup variable in module imports and exports. in Lookup()
335 if (context->IsModuleContext()) { in Lookup()
340 scope_info->ModuleIndex(name, &mode, &flag, &maybe_assigned_flag); in Lookup()
343 PrintF("=> found in module imports or exports\n"); in Lookup()
352 return handle(context->module(), isolate); in Lookup()
355 } else if (context->IsDebugEvaluateContext()) { in Lookup()
357 Object* ext = context->get(EXTENSION_INDEX); in Lookup()
358 if (ext->IsJSReceiver()) { in Lookup()
368 Object* obj = context->get(WRAPPED_CONTEXT_INDEX); in Lookup()
369 if (obj->IsContext()) { in Lookup()
371 Context::cast(obj)->Lookup(name, DONT_FOLLOW_CHAINS, index, in Lookup()
375 // Check whitelist. Names that do not pass whitelist shall only resolve in Lookup()
377 obj = context->get(WHITE_LIST_INDEX); in Lookup()
378 if (obj->IsStringSet()) { in Lookup()
380 failed_whitelist || !StringSet::cast(obj)->Has(isolate, name); in Lookup()
385 if (context->IsNativeContext() || in Lookup()
387 context->is_declaration_context())) { in Lookup()
391 context = Handle<Context>(context->previous(), isolate); in Lookup()
393 // whitelisted, then only consider with, script, module or native in Lookup()
395 } while (failed_whitelist && !context->IsScriptContext() && in Lookup()
396 !context->IsNativeContext() && !context->IsWithContext() && in Lookup()
397 !context->IsModuleContext()); in Lookup()
410 DCHECK(code->kind() == Code::OPTIMIZED_FUNCTION); in AddOptimizedCode()
411 DCHECK(code->next_code_link()->IsUndefined()); in AddOptimizedCode()
412 code->set_next_code_link(get(OPTIMIZED_CODE_LIST)); in AddOptimizedCode()
444 if (!result->IsUndefined(isolate)) return result; in ErrorMessageForCodeGenerationFromStrings()
445 return isolate->factory()->NewStringFromStaticChars( in ErrorMessageForCodeGenerationFromStrings()
451 if (string->IsOneByteEqualTo(STATIC_CHAR_VECTOR(#name))) return index;
482 // objects. This is necessary to fix circular dependencies. in IsBootstrappingOrNativeContext()
483 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || in IsBootstrappingOrNativeContext()
484 isolate->bootstrapper()->IsActive() || object->IsNativeContext(); in IsBootstrappingOrNativeContext()
491 // contexts. This is necessary to fix circular dependencies. in IsBootstrappingOrValidParentContext()
492 if (child->GetIsolate()->bootstrapper()->IsActive()) return true; in IsBootstrappingOrValidParentContext()
493 if (!object->IsContext()) return false; in IsBootstrappingOrValidParentContext()
495 return context->IsNativeContext() || context->IsScriptContext() || in IsBootstrappingOrValidParentContext()
496 context->IsModuleContext() || !child->IsModuleContext(); in IsBootstrappingOrValidParentContext()
509 int previous_value = errors_thrown()->value(); in IncrementErrorsThrown()
514 int Context::GetErrorsThrown() { return errors_thrown()->value(); } in GetErrorsThrown()