Lines Matching refs:env
3 #include "env.h"
52 ModuleWrap::ModuleWrap(Environment* env,
58 : BaseObject(env, object),
59 module_(env->isolate(), module),
75 HandleScope scope(env()->isolate());
76 auto range = env()->hash_to_module_map.equal_range(module_hash_);
79 env()->hash_to_module_map.erase(it);
93 ModuleWrap* ModuleWrap::GetFromModule(Environment* env,
95 auto range = env->hash_to_module_map.equal_range(module->GetIdentityHash());
110 Environment* env = Environment::GetCurrent(args);
111 Isolate* isolate = env->isolate();
125 env, args[1].As<Object>());
151 ShouldNotAbortOnUncaughtScope no_abort_scope(env);
152 TryCatchScope try_catch(env);
209 AppendExceptionLine(env, try_catch.Exception(), try_catch.Message(),
218 env, "cachedData buffer was rejected");
225 if (!that->Set(context, env->url_string(), url).FromMaybe(false)) {
229 if (that->SetPrivate(context, env->host_defined_option_symbol(), id_symbol)
239 synthetic ? args[3] : Undefined(env->isolate()).As<v8::Value>();
242 env, that, module, url, context_object, synthetic_evaluation_step);
246 env->hash_to_module_map.emplace(module->GetIdentityHash(), obj);
253 Environment* env,
259 Object::New(isolate, v8::Null(env->isolate()), nullptr, nullptr, 0);
262 ->Set(env->context(),
263 raw_attributes->Get(env->context(), i).As<String>(),
264 raw_attributes->Get(env->context(), i + 1).As<Value>())
272 Environment* env = Environment::GetCurrent(args);
299 module_requests->Get(env->context(), i).As<ModuleRequest>();
301 Utf8Value specifier_utf8(env->isolate(), specifier);
306 createImportAttributesContainer(env, isolate, raw_attributes, 3);
322 env, "request for '%s' did not return promise", specifier_std);
326 obj->resolve_cache_[specifier_std].Reset(env->isolate(), resolve_promise);
336 Environment* env = Environment::GetCurrent(args);
342 TryCatchScope try_catch(env);
351 AppendExceptionLine(env, try_catch.Exception(), try_catch.Message(),
359 Environment* env = Environment::GetCurrent(args);
360 Isolate* isolate = env->isolate();
375 int64_t timeout = args[0]->IntegerValue(env->context()).FromJust();
380 ShouldNotAbortOnUncaughtScope no_abort_scope(env);
381 TryCatchScope try_catch(env);
382 Isolate::SafeForTerminationScope safe_for_termination(env->isolate());
413 if (!env->is_main_thread() && env->is_stopping())
415 env->isolate()->CancelTerminateExecution();
420 THROW_ERR_SCRIPT_EXECUTION_TIMEOUT(env, timeout);
422 THROW_ERR_SCRIPT_EXECUTION_INTERRUPTED(env);
436 Environment* env = Environment::GetCurrent(args);
446 return env->ThrowError(
473 Environment* env = Environment::GetCurrent(args);
477 Local<Module> module = obj->module_.Get(env->isolate());
486 module_requests->Get(env->context(), i).As<ModuleRequest>();
491 Array::New(env->isolate(), specifiers.out(), count));
508 Environment* env = Environment::GetCurrent(context);
509 if (env == nullptr) {
515 Isolate* isolate = env->isolate();
520 ModuleWrap* dependent = GetFromModule(env, referrer);
523 env, "request for '%s' is from invalid module", specifier_std);
529 env, "request for '%s' is not in cache", specifier_std);
538 env, "request for '%s' is not yet fulfilled", specifier_std);
545 env, "request for '%s' did not return an object", specifier_std);
561 Environment* env = Environment::GetCurrent(context);
562 if (env == nullptr) {
570 env->host_import_module_dynamically_callback();
590 createImportAttributesContainer(env, isolate, import_attributes, 2);
614 Environment* env = Environment::GetCurrent(args);
620 env->set_host_import_module_dynamically_callback(import_callback);
627 Environment* env = Environment::GetCurrent(context);
628 if (env == nullptr)
630 ModuleWrap* module_wrap = GetFromModule(env, module);
638 env->host_initialize_import_meta_object_callback();
640 if (!wrap->GetPrivate(context, env->host_defined_option_symbol())
646 TryCatchScope try_catch(env);
648 context, Undefined(env->isolate()), arraysize(args), args));
656 Environment* env = Environment::GetCurrent(args);
657 Isolate* isolate = env->isolate();
662 env->set_host_initialize_import_meta_object_callback(import_meta_callback);
670 Environment* env = Environment::GetCurrent(context);
671 Isolate* isolate = env->isolate();
673 ModuleWrap* obj = GetFromModule(env, module);
675 TryCatchScope try_catch(env);
741 Environment* env = Environment::GetCurrent(args);
743 args.GetReturnValue().Set(Buffer::New(env, 0).ToLocalChecked());
746 Buffer::Copy(env,
757 Environment* env = Environment::GetCurrent(context);
758 Isolate* isolate = env->isolate();
763 tpl->Inherit(BaseObject::GetConstructorTemplate(env));
792 FIXED_ONE_BYTE_STRING(env->isolate(), #name), \
793 Integer::New(env->isolate(), Module::Status::name)) \