Lines Matching defs:context
345 Local<Context> context,
350 return object->Get(context, v8_str.ToLocalChecked());
353 static Local<Value> GetValue(v8::Isolate* isolate, Local<Context> context,
355 return TryGetValue(isolate, context, object, property).ToLocalChecked();
396 Local<Context> context = Context::New(isolate);
397 Context::Scope context_scope(context);
402 Local<Value> result = JSON::Parse(context, source).ToLocalChecked();
405 UpdateIncludedCategoriesList(isolate, context, trace_config_object,
411 v8::Isolate* isolate, Local<Context> context, Local<v8::Object> object,
414 GetValue(isolate, context, object, kIncludedCategoriesParam);
418 Local<Value> v = v8_array->Get(context, i)
420 ->ToString(context)
422 String::Utf8Value str(isolate, v->ToString(context).ToLocalChecked());
579 MaybeLocal<T> CompileStreamed(Local<Context> context,
585 MaybeLocal<Script> CompileStreamed(Local<Context> context,
589 return ScriptCompiler::Compile(context, v8_source, full_source_string,
594 MaybeLocal<Module> CompileStreamed(Local<Context> context,
598 return ScriptCompiler::CompileModule(context, v8_source, full_source_string,
603 MaybeLocal<T> Compile(Local<Context> context, ScriptCompiler::Source* source,
606 MaybeLocal<Script> Compile(Local<Context> context,
609 return ScriptCompiler::Compile(context, source, options);
613 MaybeLocal<Module> Compile(Local<Context> context,
616 return ScriptCompiler::CompileModule(context->GetIsolate(), source, options);
622 MaybeLocal<T> Shell::CompileString(Isolate* isolate, Local<Context> context,
635 return CompileStreamed<T>(context, &streamed_source, source, origin);
644 Compile<T>(context, &script_source,
667 bool IsValidHostDefinedOptions(Local<Context> context, Local<Data> options,
673 if (!array->Get(context, 0).As<Value>()->Uint32Value(context).To(&magic)) {
677 return array->Get(context, 1).As<String>()->StrictEquals(resource_name);
681 // Executes a string within the current v8 context.
740 Local<Context> context(isolate->GetCurrentContext());
746 if (CompileString<Script>(isolate, context, source, origin).IsEmpty()) {
751 if (!CompileString<Script>(isolate, context, source, origin)
769 // TODO(cbruni, chromium:1244145): remove once context-allocated.
806 if (serializer.TakeSnapshot(context, exports, snapshot_data)) {
922 // Per-context Module data, allowing sharing of module maps
943 Local<Context> context, Local<FixedArray> import_assertions,
945 Isolate* isolate = context->GetIsolate();
950 import_assertions->Get(context, i).As<v8::String>();
955 import_assertions->Get(context, i + 1).As<String>();
983 void InitializeModuleEmbedderData(Local<Context> context) {
984 context->SetAlignedPointerInEmbedderData(
985 kModuleEmbedderDataIndex, new ModuleEmbedderData(context->GetIsolate()));
988 ModuleEmbedderData* GetModuleDataFromContext(Local<Context> context) {
990 context->GetAlignedPointerFromEmbedderData(kModuleEmbedderDataIndex));
993 void DisposeModuleEmbedderData(Local<Context> context) {
994 delete GetModuleDataFromContext(context);
995 context->SetAlignedPointerInEmbedderData(kModuleEmbedderDataIndex, nullptr);
998 MaybeLocal<Module> ResolveModuleCallback(Local<Context> context,
1002 Isolate* isolate = context->GetIsolate();
1003 ModuleEmbedderData* d = GetModuleDataFromContext(context);
1010 context, import_assertions, true);
1020 Local<Context> context,
1024 Isolate* isolate = context->GetIsolate();
1035 ModuleEmbedderData* d = GetModuleDataFromContext(context);
1057 if (!CompileString<Module>(isolate, context, source_text.ToLocalChecked(),
1064 if (!v8::JSON::Parse(context, source_text.ToLocalChecked())
1098 module_requests->Get(context, i).As<ModuleRequest>();
1105 context, import_assertions, true);
1117 if (FetchModuleTree(module, context, absolute_path, request_module_type)
1126 MaybeLocal<Value> Shell::JSONModuleEvaluationSteps(Local<Context> context,
1128 Isolate* isolate = context->GetIsolate();
1130 ModuleEmbedderData* d = GetModuleDataFromContext(context);
1148 Promise::Resolver::New(context).ToLocalChecked();
1149 resolver->Resolve(context, Undefined(isolate)).ToChecked();
1228 Local<Context> context, Local<Data> host_defined_options,
1231 Isolate* isolate = context->GetIsolate();
1234 Promise::Resolver::New(context);
1238 if (!IsValidHostDefinedOptions(context, host_defined_options,
1241 ->Reject(context, v8::Exception::TypeError(String::NewFromUtf8Literal(
1254 void Shell::HostInitializeImportMetaObject(Local<Context> context,
1257 Isolate* isolate = context->GetIsolate();
1260 ModuleEmbedderData* d = GetModuleDataFromContext(context);
1269 meta->CreateDataProperty(context, url_key, url).ToChecked();
1521 Local<Context> context) {
1523 set_timeout_contexts_.emplace(isolate_, context);
1645 Local<Context> PerIsolateData::ExplicitRealmScope::context() const {
1649 int PerIsolateData::RealmFind(Local<Context> context) {
1651 if (realms_[i] == context) return i;
1690 Local<Context> context = isolate->GetCurrentContext();
1693 Local<Value> value = TryGetValue(isolate, context, object, "detailed")
1704 v8::Promise::Resolver::New(context).ToLocalChecked();
1706 v8::MeasureMemoryDelegate::Default(isolate, context, promise_resolver,
1738 args.GetIsolate()->ThrowError("object doesn't have creation context");
1792 Local<Context> context =
1794 if (context.IsEmpty()) return MaybeLocal<Context>();
1796 InitializeModuleEmbedderData(context);
1797 data->realms_[index].Reset(isolate, context);
1800 return context;
1807 Local<Context> context = data->realms_[index].Get(isolate);
1808 DisposeModuleEmbedderData(context);
1810 // ContextDisposedNotification expects the disposed context to be entered.
1811 v8::Context::Scope scope(context);
1826 Local<Context> context;
1827 if (CreateRealm(args, -1, v8::MaybeLocal<Value>()).ToLocal(&context)) {
1828 context->SetSecurityToken(
1846 Local<Context> context = Local<Context>::New(isolate, data->realms_[index]);
1847 v8::MaybeLocal<Value> global_object = context->Global();
1933 ->Run(realm_scope.context())
1991 if (!serializer.TakeSnapshot(realm_scope.context(), exports,
2202 // context.
2244 Local<Context> context = isolate->GetCurrentContext();
2247 context->SetPromiseHooks(
2399 Local<Context> context = isolate->GetCurrentContext();
2400 PerIsolateData::Get(isolate)->SetTimeout(callback, context);
2409 Local<Context> context = isolate->GetCurrentContext();
2411 if (!TryGetValue(isolate, context, object, "type").ToLocal(&value)) {
2420 value->ToString(context).ToLocalChecked();
2433 TryGetValue(isolate, context, object, "arguments").ToLocal(arguments);
2445 Local<Context> context = isolate->GetCurrentContext();
2447 function->FunctionProtoToString(context);
2468 MaybeLocal<Value> maybe_argument = array->Get(context, i);
2475 if (!JSON::Stringify(context, argument).ToLocal(&argument_string)) {
2748 Local<Context> context = isolate->GetCurrentContext();
2749 bool enter_context = context.IsEmpty();
2751 context = Local<Context>::New(isolate, evaluation_context_);
2752 context->Enter();
2768 int offset = message->GetStartColumn(context).FromJust();
2776 int linenum = message->GetLineNumber(context).FromMaybe(-1);
2779 if (message->GetSourceLine(context).ToLocal(&sourceline)) {
2785 int start = message->GetStartColumn(context).FromJust();
2789 int end = message->GetEndColumn(context).FromJust();
2797 if (v8::TryCatch::StackTrace(context, exception_obj)
2804 if (enter_context) context->Exit();
2897 v8::Local<v8::Context> context =
2905 Script::Compile(context, source, &origin).ToLocalChecked();
2907 isolate, script->Run(context).ToLocalChecked().As<Function>());
2912 MaybeLocal<Value> result = fun->Call(context, Undefined(isolate), 1, argv);
3318 Local<Context> context = Context::New(isolate, nullptr, global_template);
3319 DCHECK_IMPLIES(context.IsEmpty(), isolate->IsExecutionTerminating());
3320 if (context.IsEmpty()) return {};
3324 InitializeModuleEmbedderData(context);
3325 Context::Scope scope(context);
3334 array->Set(context, index, arg).FromJust();
3338 context->Global()->Set(context, name, array).FromJust();
3345 context->GetExtrasBindingObject()->Get(context, name).ToLocalChecked();
3346 context->Global()->Set(context, name, console).FromJust();
3349 return handle_scope.Escape(context);
3354 Local<Context> context = Context::New(isolate);
3355 Context::Scope context_scope(context);
3364 isolate, JSON::Stringify(context, Utils::ToLocal(dispatch_counters))
3725 v8::Local<v8::Context> context =
3727 v8::Context::Scope context_scope(context);
3741 // the interative shell context.
3742 DisposeModuleEmbedderData(context);
3747 explicit InspectorFrontend(Local<Context> context) {
3748 isolate_ = context->GetIsolate();
3749 context_.Reset(isolate_, context);
3783 Local<Context> context = context_.Get(isolate_);
3785 context->Global()->Get(context, callback_name).ToLocalChecked();
3789 USE(callback.As<Function>()->Call(context, Undefined(isolate_), 1, args));
3797 Local<Value> value = exception->Get(context, key).ToLocalChecked();
3810 InspectorClient(Local<Context> context, bool connect) {
3812 isolate_ = context->GetIsolate();
3813 channel_.reset(new InspectorFrontend(context));
3817 context->SetAlignedPointerInEmbedderData(kInspectorClientIndex, this);
3819 context, kContextGroupId, v8_inspector::StringView()));
3823 ->GetFunction(context)
3827 CHECK(context->Global()->Set(context, function_name, function).FromJust());
3829 context_.Reset(isolate_, context);
3837 Local<Context> context = context_.Get(isolate_);
3839 context->Global()->Get(context, callback_name).ToLocalChecked();
3847 USE(callback.As<Function>()->Call(context, Undefined(isolate_), 0, {}));
3857 static v8_inspector::V8InspectorSession* GetSession(Local<Context> context) {
3859 context->GetAlignedPointerFromEmbedderData(kInspectorClientIndex));
3873 Local<Context> context = isolate->GetCurrentContext();
3875 Local<String> message = args[0]->ToString(context).ToLocalChecked();
3877 InspectorClient::GetSession(context);
4047 Local<Context> context = Shell::CreateEvaluationContext(isolate);
4049 Context::Scope cscope(context);
4050 InspectorClient inspector_client(context,
4056 DisposeModuleEmbedderData(context);
4228 Local<Context> context = context_.Get(isolate_);
4229 Context::Scope cscope(context);
4230 Local<Object> global = context->Global();
4234 context, String::NewFromUtf8Literal(isolate_, "onmessage",
4245 MaybeLocal<Value> result = onmessage_fun->Call(context, global, 1, argv);
4288 Local<Context> context = Shell::CreateEvaluationContext(isolate_);
4289 if (context.IsEmpty()) break;
4290 context_.Reset(isolate_, context);
4292 Context::Scope cscope(context);
4295 Local<Object> global = context->Global();
4301 if (postmessage_fun_template->GetFunction(context).ToLocal(
4304 ->Set(context,
4321 context,
4331 DisposeModuleEmbedderData(context);
4718 Local<Context> context = CreateEvaluationContext(isolate);
4722 // Keep using the same context in the interactive shell.
4723 evaluation_context_.Reset(isolate, context);
4726 Context::Scope cscope(context);
4727 InspectorClient inspector_client(context, options.enable_inspector);
4733 DisposeModuleEmbedderData(context);
4739 i::Handle<i::Context> i_context = Utils::OpenHandle(*context);
4816 Local<Context> context;
4817 if (!data->GetTimeoutContext().ToLocal(&context)) return true;
4820 Context::Scope context_scope(context);
4821 if (callback->Call(context, Undefined(isolate), 0, nullptr).IsEmpty()) {
4923 Maybe<bool> WriteValue(Local<Context> context, Local<Value> value,
4928 if (!PrepareTransfer(context, transfer).To(&ok)) {
4933 if (!serializer_.WriteValue(context, value).To(&ok)) {
5032 Maybe<bool> PrepareTransfer(Local<Context> context, Local<Value> transfer) {
5038 if (transfer_array->Get(context, i).ToLocal(&element)) {
5122 MaybeLocal<Value> ReadValue(Local<Context> context) {
5124 if (!deserializer_.ReadHeader(context).To(&read_header)) {
5135 return deserializer_.ReadValue(context);
5221 Local<Context> context = isolate->GetCurrentContext();
5224 if (serializer.WriteValue(context, value, transfer).To(&ok)) {
5233 Local<Context> context = isolate->GetCurrentContext();
5235 return deserializer.ReadValue(context);