Thanks Ben. We tried GetCurrentContext(), but it didn't worked. i.e in below piece of code in deps/v8/src/builtins/builtins-function.cc:
MaybeHandle<Object> CreateDynamicFunction(Isolate* isolate,
BuiltinArguments args,
const char* token) {
. Handle<JSFunction> function;
................
ASSIGN_RETURN_ON_EXCEPTION(
isolate, function,
Compiler::GetFunctionFromString(
handle(target->native_context(), isolate), source,
ONLY_SINGLE_FUNCTION_LITERAL, parameters_end_pos),
Object);
Handle<Object> result;
ASSIGN_RETURN_ON_EXCEPTION(
isolate, result,
Execution::Call(isolate, function, target_global_proxy, 0, nullptr),
Object);
........
}
Here, dynamic Functions() are created and we want to share the context of the calling javascript to it, instead of native context. So, using GetCallingContext() helped here.
Please share your thoughts and best approach to solve this.
Thanks.
Regards,
Madan