Lines Matching defs:context
93 // For every `get` of a global property in the sandboxed context, the
104 Local<Name> Uint32ToName(Local<Context> context, uint32_t index) {
105 return Uint32::New(context->GetIsolate(), index)->ToString(context)
151 // This should only be done after the initial initializations of the context
158 // reference to this context via the constructor of the wrapper.
160 // is the context.
250 // This only initializes part of the context. The primordials are
258 Local<Context> main_context = env->context();
263 // newly created context. We do this by making them hold references to each
264 // other. The context can directly hold a reference to the sandbox as an
267 // the context from its constructor.
327 Local<Context> context = env->context();
328 SetMethod(context, target, "makeContext", MakeContext);
329 SetMethod(context, target, "isContext", IsContext);
330 SetMethod(context, target, "compileFunction", CompileFunction);
362 env->context(),
407 sandbox->HasPrivate(env->context(),
415 ContextifyContext* context = data.GetParameter();
416 delete context;
425 ->GetPrivate(env->context(), env->contextify_context_private_symbol())
439 Local<Context> context;
440 if (!object->GetCreationContext().ToLocal(&context)) {
443 if (!ContextEmbedderTag::IsNodeContext(context)) {
447 context->GetAlignedPointerFromEmbedderData(
464 Local<Context> context = ctx->context();
467 sandbox->GetRealNamedProperty(context, property);
470 ctx->global_proxy()->GetRealNamedProperty(context, property);
492 Local<Context> context = ctx->context();
495 ->GetRealNamedPropertyAttributes(context, property)
502 ->GetRealNamedPropertyAttributes(context, property)
532 if (ctx->sandbox()->Set(context, property, value).IsNothing()) return;
537 ->GetOwnPropertyDescriptor(context, property)
540 Environment* env = Environment::GetCurrent(context);
545 if (desc_obj->HasOwnProperty(context, env->get_string()).FromMaybe(false) ||
546 desc_obj->HasOwnProperty(context, env->set_string()).FromMaybe(false))
560 Local<Context> context = ctx->context();
564 if (sandbox->HasOwnProperty(context, property).FromMaybe(false)) {
566 if (sandbox->GetOwnPropertyDescriptor(context, property).ToLocal(&desc)) {
582 Local<Context> context = ctx->context();
583 Isolate* isolate = context->GetIsolate();
587 ctx->global_proxy()->GetRealNamedPropertyAttributes(context,
610 USE(sandbox->DefineProperty(context, property, *desc_for_sandbox));
642 Maybe<bool> success = ctx->sandbox()->Delete(ctx->context(), property);
662 if (!ctx->sandbox()->GetPropertyNames(ctx->context()).ToLocal(&properties))
678 Uint32ToName(ctx->context(), index), args);
692 Uint32ToName(ctx->context(), index), value, args);
705 Uint32ToName(ctx->context(), index), args);
719 Uint32ToName(ctx->context(), index), desc, args);
731 Maybe<bool> success = ctx->sandbox()->Delete(ctx->context(), index);
754 Local<Context> context = env->context();
756 target->Set(context, class_name,
757 script_tmpl->GetFunction(context).ToLocalChecked()).Check();
771 Local<Context> context = env->context();
788 Local<Context> parsing_context = context;
812 parsing_context = sandbox->context();
888 ->SetPrivate(context, env->host_defined_option_symbol(), id_symbol)
904 ->Set(env->context(),
920 Local<Context> context;
921 if (!target->GetCreationContext().ToLocal(&context)) {
927 context,
941 if (target->Set(context, env->cached_data_string(), buf.ToLocalChecked())
947 ->Set(context,
992 Local<Context> context;
997 // Get the context from the sandbox
1003 context = contextify_context->context();
1004 if (context.IsEmpty()) return;
1008 context = env->context();
1014 int64_t timeout = args[1]->IntegerValue(env->context()).FromJust();
1025 // Do the eval within the context
1026 EvalMachine(context,
1036 bool ContextifyScript::EvalMachine(Local<Context> context,
1044 Context::Scope context_scope(context);
1073 MaybeLocal<Value> result = script->Run(context);
1140 Local<Context> context = env->context();
1169 // Argument 7: parsing context (optional)
1177 parsing_context = sandbox->context();
1179 parsing_context = context;
1182 // Argument 8: context extensions (optional)
1237 // Read context extensions from buffer
1242 if (!context_extensions_buf->Get(context, n).ToLocal(&val)) return;
1253 if (!params_buf->Get(context, n).ToLocal(&val)) return;
1277 if (fn->SetPrivate(context, env->host_defined_option_symbol(), id_symbol)
1367 Local<Context> context = env->context();
1372 SetConstructorFunction(context, target, "MicrotaskQueue", tmpl);
1382 Local<Context> context,
1384 Environment* env = Environment::GetCurrent(context);
1390 SetMethod(context, target, "startSigintWatchdog", StartSigintWatchdog);
1391 SetMethod(context, target, "stopSigintWatchdog", StopSigintWatchdog);
1394 context, target, "watchdogHasPendingSigint", WatchdogHasPendingSigint);
1419 target->Set(context, env->constants_string(), constants).Check();
1421 SetMethod(context, target, "measureMemory", MeasureMemory);