7#include "fxjs/cfxjs_engine.h"
12#include "core/fxcrt/stl_util.h"
13#include "core/fxcrt/unowned_ptr.h"
14#include "fxjs/cfx_v8_array_buffer_allocator.h"
15#include "fxjs/cjs_object.h"
17#include "fxjs/xfa/cfxjse_runtimedata.h"
18#include "third_party/base/check.h"
19#include "third_party/base/check_op.h"
20#include "v8/include/v8-context.h"
21#include "v8/include/v8-exception.h"
22#include "v8/include/v8-isolate.h"
23#include "v8/include/v8-message.h"
24#include "v8/include/v8-primitive.h"
25#include "v8/include/v8-script.h"
26#include "v8/include/v8-util.h"
30unsigned int g_embedderDataSlot = 1u;
31v8::Isolate* g_isolate =
nullptr;
32size_t g_isolate_ref_count = 0;
33CFX_V8ArrayBufferAllocator* g_arrayBufferAllocator =
nullptr;
34v8::Global<v8::ObjectTemplate>* g_DefaultGlobalObjectTemplate =
nullptr;
41const wchar_t kPerObjectDataTag[] = L"CFXJS_PerObjectData";
42const wchar_t kPerIsolateDataTag[] = L"FXJS_PerIsolateData";
44void* GetAlignedPointerForPerObjectDataTag() {
45 return const_cast<
void*>(
static_cast<
const void*>(kPerObjectDataTag));
48std::pair<
int,
int> GetLineAndColumnFromError(v8::Local<v8::Message> message,
49 v8::Local<v8::Context> context) {
50 if (message.IsEmpty())
51 return std::make_pair(-1, -1);
52 return std::make_pair(message->GetLineNumber(context).FromMaybe(-1),
53 message->GetStartColumn());
63 v8::Local<v8::Object> pObj) {
64 if (pObj->InternalFieldCount() == 2) {
65 pObj->SetAlignedPointerInInternalField(
66 0, GetAlignedPointerForPerObjectDataTag());
67 pObj->SetAlignedPointerInInternalField(
73 if (pObj.IsEmpty() || pObj->InternalFieldCount() != 2 ||
74 pObj->GetAlignedPointerFromInternalField(0) !=
75 GetAlignedPointerForPerObjectDataTag()) {
79 pObj->GetAlignedPointerFromInternalField(1));
84 void SetPrivate(std::unique_ptr<CJS_Object> p) { m_pPrivate = std::move(p); }
87 explicit CFXJS_PerObjectData(uint32_t nObjDefnID) : m_ObjDefnID(nObjDefnID) {}
89 const uint32_t m_ObjDefnID;
90 std::unique_ptr<CJS_Object> m_pPrivate;
94class V8TemplateMapTraits
final
95 :
public v8::StdMapTraits<CFXJS_PerObjectData*, v8::Object> {
99 GlobalValueMap<WeakCallbackDataType*, v8::Object, V8TemplateMapTraits>;
102 v8::kWeakWithInternalFields;
106 WeakCallbackDataType* key,
107 v8::Local<v8::Object> value) {
111 const v8::WeakCallbackInfo<WeakCallbackDataType>&);
113 const v8::WeakCallbackInfo<WeakCallbackDataType>& data) {
114 return data.GetParameter();
117 const v8::WeakCallbackInfo<WeakCallbackDataType>& data) {}
119 const v8::WeakCallbackInfo<WeakCallbackDataType>& data);
121 v8::Global<v8::Object> value,
122 WeakCallbackDataType* key);
136 WeakCallbackDataType* key = CFXJS_PerObjectData::GetFromObject(handle);
137 DCHECK(!m_map.Contains(key));
142 m_map.Set(key, handle);
154 const char* sObjName,
157 CFXJS_Engine::Destructor pDestructor)
163 v8::Isolate::Scope isolate_scope(isolate);
164 v8::HandleScope handle_scope(isolate);
165 v8::Local<v8::FunctionTemplate> fn = v8::FunctionTemplate::New(isolate);
166 fn->InstanceTemplate()->SetInternalFieldCount(2);
167 fn->InstanceTemplate()->SetImmutableProto();
168 fn->SetCallHandler(CallHandler, v8::Number::New(isolate, eObjType));
170 fn->InstanceTemplate()->Set(v8::Symbol::GetToStringTag(isolate),
171 fxv8::NewStringHelper(isolate,
"global"));
173 m_FunctionTemplate.Reset(isolate, fn);
174 m_Signature.Reset(isolate, v8::Signature::New(isolate, fn));
177 static void CallHandler(
const v8::FunctionCallbackInfo<v8::Value>& info) {
178 v8::Isolate* isolate = info.GetIsolate();
179 if (!info.IsConstructCall()) {
183 if (info.Data().As<v8::Int32>()->Value() != FXJSOBJTYPE_DYNAMIC) {
187 v8::Local<v8::Object> holder = info.Holder();
188 DCHECK_EQ(holder->InternalFieldCount(), 2);
189 holder->SetAlignedPointerInInternalField(0,
nullptr);
190 holder->SetAlignedPointerInInternalField(1,
nullptr);
197 void DefineConst(
const char* sConstName, v8::Local<v8::Value> pDefault) {
198 GetInstanceTemplate()->Set(GetIsolate(), sConstName, pDefault);
202 v8::AccessorGetterCallback pPropGet,
203 v8::AccessorSetterCallback pPropPut) {
204 GetInstanceTemplate()->SetAccessor(sPropName, pPropGet, pPropPut);
208 v8::FunctionCallback pMethodCall) {
209 v8::Local<v8::FunctionTemplate> fun = v8::FunctionTemplate::New(
210 GetIsolate(), pMethodCall, v8::Local<v8::Value>(), GetSignature());
211 fun->RemovePrototype();
212 GetInstanceTemplate()->Set(sMethodName, fun, v8::ReadOnly);
216 v8::GenericNamedPropertyQueryCallback pPropQurey,
217 v8::GenericNamedPropertyGetterCallback pPropGet,
218 v8::GenericNamedPropertySetterCallback pPropPut,
219 v8::GenericNamedPropertyDeleterCallback pPropDel,
220 v8::GenericNamedPropertyEnumeratorCallback pPropEnum) {
221 GetInstanceTemplate()->SetHandler(v8::NamedPropertyHandlerConfiguration(
222 pPropGet, pPropPut, pPropQurey, pPropDel, pPropEnum,
223 v8::Local<v8::Value>(),
224 v8::PropertyHandlerFlags::kOnlyInterceptStrings));
228 v8::EscapableHandleScope scope(GetIsolate());
229 v8::Local<v8::FunctionTemplate> function =
230 m_FunctionTemplate.Get(GetIsolate());
231 return scope.Escape(function->InstanceTemplate());
235 v8::EscapableHandleScope scope(GetIsolate());
236 return scope.Escape(m_Signature.Get(GetIsolate()));
240 v8::Local<v8::Object> obj,
241 v8::Local<v8::Object> proxy) {
243 m_pConstructor(pEngine, obj, proxy);
255 const CFXJS_Engine::Destructor m_pDestructor;
256 UnownedPtr<v8::Isolate> m_pIsolate;
257 v8::Global<v8::FunctionTemplate> m_FunctionTemplate;
258 v8::Global<v8::Signature> m_Signature;
262 v8::Isolate* pIsolate) {
267 return pObjDef->GetInstanceTemplate();
269 if (!g_DefaultGlobalObjectTemplate) {
270 v8::Local<v8::ObjectTemplate> hGlobalTemplate =
271 v8::ObjectTemplate::New(pIsolate);
272 hGlobalTemplate->Set(v8::Symbol::GetToStringTag(pIsolate),
273 fxv8::NewStringHelper(pIsolate,
"global"));
274 g_DefaultGlobalObjectTemplate =
275 new v8::Global<v8::ObjectTemplate>(pIsolate, hGlobalTemplate);
277 return g_DefaultGlobalObjectTemplate->Get(pIsolate);
280void V8TemplateMapTraits::Dispose(v8::Isolate* isolate,
281 v8::Global<v8::Object> value,
282 WeakCallbackDataType* key) {
283 v8::Local<v8::Object> obj = value.Get(isolate);
286 uint32_t id = CFXJS_Engine::GetObjDefnID(obj);
289 FXJS_PerIsolateData* pIsolateData = FXJS_PerIsolateData::Get(isolate);
290 CFXJS_ObjDefinition* pObjDef = pIsolateData->ObjDefinitionForID(id);
293 pObjDef->RunDestructor(obj);
294 CFXJS_Engine::FreeObjectPrivate(obj);
297void V8TemplateMapTraits::DisposeWeak(
298 const v8::WeakCallbackInfo<WeakCallbackDataType>& data) {
302V8TemplateMapTraits::MapType* V8TemplateMapTraits::MapFromWeakCallbackInfo(
303 const v8::WeakCallbackInfo<WeakCallbackDataType>& info) {
304 auto* pIsolateData = FXJS_PerIsolateData::Get(info.GetIsolate());
306 return pObjsMap ? pObjsMap->GetMap() :
nullptr;
311 DCHECK_EQ(g_embedderDataSlot, embedderDataSlot);
312 DCHECK_EQ(g_isolate, pIsolate);
315 g_embedderDataSlot = embedderDataSlot;
316 g_isolate = pIsolate;
320 DCHECK(!g_isolate || g_isolate_ref_count == 0);
321 delete g_DefaultGlobalObjectTemplate;
322 g_DefaultGlobalObjectTemplate =
nullptr;
325 delete g_arrayBufferAllocator;
326 g_arrayBufferAllocator =
nullptr;
331 *pResultIsolate = g_isolate;
335 if (!g_arrayBufferAllocator)
336 g_arrayBufferAllocator =
new CFX_V8ArrayBufferAllocator
();
337 v8::Isolate::CreateParams params;
338 params.array_buffer_allocator = g_arrayBufferAllocator;
339 *pResultIsolate = v8::Isolate::New(params);
344 return g_isolate_ref_count;
349 if (!pIsolate->GetData(g_embedderDataSlot))
357 CHECK(result->m_Tag == kPerIsolateDataTag);
362 : m_Tag(kPerIsolateDataTag),
363 m_pDynamicObjsMap(std::make_unique<V8TemplateMap>(pIsolate)) {}
368 return fxcrt::CollectionSize<uint32_t>(m_ObjectDefnArray);
373 return id > 0 && id <= CurrentMaxObjDefinitionID()
374 ? m_ObjectDefnArray[id - 1].get()
379 std::unique_ptr<CFXJS_ObjDefinition> pDefn) {
380 m_ObjectDefnArray.push_back(std::move(pDefn));
392 CFXJS_PerObjectData* pData = CFXJS_PerObjectData::GetFromObject(pObj);
393 return pData ? pData->GetObjDefnID() : 0;
398 std::unique_ptr<CJS_Object> p) {
399 CFXJS_PerObjectData* pPerObjectData =
400 CFXJS_PerObjectData::GetFromObject(pObj);
402 pPerObjectData->SetPrivate(std::move(p));
407 CFXJS_PerObjectData* pData = CFXJS_PerObjectData::GetFromObject(pObj);
408 pObj->SetAlignedPointerInInternalField(0,
nullptr);
409 pObj->SetAlignedPointerInInternalField(1,
nullptr);
416 CFXJS_Engine::Destructor pDestructor) {
417 v8::Isolate::Scope isolate_scope(GetIsolate());
418 v8::HandleScope handle_scope(GetIsolate());
419 FXJS_PerIsolateData::SetUp(GetIsolate());
421 return pIsolateData->AssignIDForObjDefinition(
422 std::make_unique<CFXJS_ObjDefinition>(GetIsolate(), sObjName, eObjType,
423 pConstructor, pDestructor));
427 const char* sMethodName,
428 v8::FunctionCallback pMethodCall) {
429 v8::Isolate::Scope isolate_scope(GetIsolate());
430 v8::HandleScope handle_scope(GetIsolate());
433 pObjDef->DefineMethod(NewString(sMethodName), pMethodCall);
437 const char* sPropName,
438 v8::AccessorGetterCallback pPropGet,
439 v8::AccessorSetterCallback pPropPut) {
440 v8::Isolate::Scope isolate_scope(GetIsolate());
441 v8::HandleScope handle_scope(GetIsolate());
444 pObjDef->DefineProperty(NewString(sPropName), pPropGet, pPropPut);
449 v8::GenericNamedPropertyQueryCallback pPropQurey,
450 v8::GenericNamedPropertyGetterCallback pPropGet,
451 v8::GenericNamedPropertySetterCallback pPropPut,
452 v8::GenericNamedPropertyDeleterCallback pPropDel,
453 v8::GenericNamedPropertyEnumeratorCallback pPropEnum) {
454 v8::Isolate::Scope isolate_scope(GetIsolate());
455 v8::HandleScope handle_scope(GetIsolate());
458 pObjDef->DefineAllProperties(pPropQurey, pPropGet, pPropPut, pPropDel,
463 const char* sConstName,
464 v8::Local<v8::Value> pDefault) {
465 v8::Isolate::Scope isolate_scope(GetIsolate());
466 v8::HandleScope handle_scope(GetIsolate());
469 pObjDef->DefineConst(sConstName, pDefault);
473 v8::FunctionCallback pMethodCall) {
474 v8::Isolate::Scope isolate_scope(GetIsolate());
475 v8::HandleScope handle_scope(GetIsolate());
476 v8::Local<v8::FunctionTemplate> fun =
477 v8::FunctionTemplate::New(GetIsolate(), pMethodCall);
478 fun->RemovePrototype();
479 GetGlobalObjectTemplate(GetIsolate())
480 ->Set(NewString(sMethodName), fun, v8::ReadOnly);
484 v8::FunctionCallback pConstGetter) {
485 v8::Isolate::Scope isolate_scope(GetIsolate());
486 v8::HandleScope handle_scope(GetIsolate());
487 v8::Local<v8::FunctionTemplate> fun =
488 v8::FunctionTemplate::New(GetIsolate(), pConstGetter);
489 fun->RemovePrototype();
490 GetGlobalObjectTemplate(GetIsolate())
491 ->SetAccessorProperty(NewString(sConstName), fun);
495 if (GetIsolate() == g_isolate)
496 ++g_isolate_ref_count;
498 v8::Isolate::Scope isolate_scope(GetIsolate());
499 v8::HandleScope handle_scope(GetIsolate());
503 FXJS_PerIsolateData::SetUp(GetIsolate());
505 v8::Local<v8::Context> v8Context = v8::Context::New(
506 GetIsolate(),
nullptr, GetGlobalObjectTemplate(GetIsolate()));
509 v8::Local<v8::Object> pThisProxy = v8Context->Global();
510 if (pThisProxy->InternalFieldCount() == 2) {
511 pThisProxy->SetAlignedPointerInInternalField(0,
nullptr);
512 pThisProxy->SetAlignedPointerInInternalField(1,
nullptr);
514 v8::Local<v8::Object> pThis = pThisProxy->GetPrototype().As<v8::Object>();
515 if (pThis->InternalFieldCount() == 2) {
516 pThis->SetAlignedPointerInInternalField(0,
nullptr);
517 pThis->SetAlignedPointerInInternalField(1,
nullptr);
520 v8::Context::Scope context_scope(v8Context);
523 m_StaticObjects.resize(maxID + 1);
524 for (uint32_t i = 1; i <= maxID; ++i) {
527 CFXJS_PerObjectData::SetNewDataInObject(i, pThis);
528 pObjDef->RunConstructor(
this, pThis, pThisProxy);
530 v8::Local<v8::String> pObjName = NewString(pObjDef->GetObjName());
531 v8::Local<v8::Object> obj = NewFXJSBoundObject(i, FXJSOBJTYPE_STATIC);
532 if (!obj.IsEmpty()) {
533 v8Context->Global()->Set(v8Context, pObjName, obj).FromJust();
534 m_StaticObjects[i] = v8::Global<v8::Object>(GetIsolate(), obj);
538 m_V8Context.Reset(GetIsolate(), v8Context);
542 v8::Isolate::Scope isolate_scope(GetIsolate());
543 v8::HandleScope handle_scope(GetIsolate());
544 v8::Local<v8::Context> context = GetV8Context();
545 v8::Context::Scope context_scope(context);
550 m_ConstArrays.clear();
554 v8::Local<v8::Object> pObj;
557 context->Global()->GetPrototype()->ToObject(context).ToLocalChecked();
558 }
else if (!m_StaticObjects[i].IsEmpty()) {
559 pObj = v8::Local<v8::Object>::New(GetIsolate(), m_StaticObjects[i]);
560 m_StaticObjects[i].Reset();
562 if (!pObj.IsEmpty()) {
563 pObjDef->RunDestructor(pObj);
564 FreeObjectPrivate(pObj);
570 if (GetIsolate() == g_isolate && --g_isolate_ref_count > 0)
574 GetIsolate()->SetData(g_embedderDataSlot,
nullptr);
578 const WideString& script) {
579 v8::Isolate::Scope isolate_scope(GetIsolate());
580 v8::TryCatch try_catch(GetIsolate());
581 v8::Local<v8::Context> context = GetIsolate()->GetCurrentContext();
582 v8::Local<v8::Script> compiled_script;
583 if (!v8::Script::Compile(context, NewString(script.AsStringView()))
584 .ToLocal(&compiled_script)) {
585 v8::String::Utf8Value error(GetIsolate(), try_catch.Exception());
586 v8::Local<v8::Message> msg = try_catch.Message();
589 std::tie(line, column) = GetLineAndColumnFromError(msg, context);
590 return IJS_Runtime::JS_Error(line, column, WideString::FromUTF8(*error));
593 v8::Local<v8::Value> result;
594 if (!compiled_script->Run(context).ToLocal(&result)) {
595 v8::String::Utf8Value error(GetIsolate(), try_catch.Exception());
596 auto msg = try_catch.Message();
599 std::tie(line, column) = GetLineAndColumnFromError(msg, context);
600 return IJS_Runtime::JS_Error(line, column, WideString::FromUTF8(*error));
602 return absl::nullopt;
607 v8::Isolate::Scope isolate_scope(GetIsolate());
608 v8::Local<v8::Context> context = GetIsolate()->GetCurrentContext();
611 return v8::Local<v8::Object>();
615 return v8::Local<v8::Object>();
617 v8::Local<v8::Object> obj;
618 if (!pObjDef->GetInstanceTemplate()->NewInstance(context).ToLocal(&obj))
619 return v8::Local<v8::Object>();
621 CFXJS_PerObjectData::SetNewDataInObject(nObjDefnID, obj);
622 pObjDef->RunConstructor(
this, obj, obj);
624 auto* pIsolateData = FXJS_PerIsolateData::Get(GetIsolate());
627 pObjsMap->SetAndMakeWeak(obj);
633 v8::Isolate::Scope isolate_scope(GetIsolate());
634 if (!FXJS_PerIsolateData::Get(GetIsolate()))
635 return v8::Local<v8::Object>();
638 v8::Local<v8::Context> context = GetIsolate()->GetCurrentContext();
639 return context->Global()->GetPrototype()->ToObject(context).ToLocalChecked();
643 fxv8::ThrowExceptionHelper(GetIsolate(), message.AsStringView());
647 return v8::Local<v8::Context>::New(GetIsolate(), m_V8Context);
652 v8::Local<v8::Object> pObj) {
653 auto* pData = CFXJS_PerObjectData::GetFromObject(pObj);
655 return pData->GetPrivate();
662 v8::Local<v8::Value> val = pObj->GetPrototype();
663 if (!val->IsObject())
666 auto* pProtoData = CFXJS_PerObjectData::GetFromObject(val.As<v8::Object>());
670 auto* pIsolateData = FXJS_PerIsolateData::Get(pIsolate);
674 CFXJS_ObjDefinition* pObjDef =
675 pIsolateData->ObjDefinitionForID(pProtoData->GetObjDefnID());
676 if (!pObjDef || pObjDef->GetObjType() != FXJSOBJTYPE_GLOBAL)
679 return pProtoData->GetPrivate();
683 return v8::Local<v8::Array>::New(GetIsolate(), m_ConstArrays[name]);
687 v8::Local<v8::Array> array) {
688 m_ConstArrays[name] = v8::Global<v8::Array>(GetIsolate(), array);
bool FXJS_GetIsolate(v8::Isolate **pResultIsolate)
size_t FXJS_GlobalIsolateRefCount()
void FXJS_Initialize(unsigned int embedderDataSlot, v8::Isolate *pIsolate)
static v8::Local< v8::ObjectTemplate > GetGlobalObjectTemplate(v8::Isolate *pIsolate)
void DefineObjMethod(uint32_t nObjDefnID, const char *sMethodName, v8::FunctionCallback pMethodCall)
void DefineObjProperty(uint32_t nObjDefnID, const char *sPropName, v8::AccessorGetterCallback pPropGet, v8::AccessorSetterCallback pPropPut)
v8::Local< v8::Context > GetV8Context()
void DefineObjConst(uint32_t nObjDefnID, const char *sConstName, v8::Local< v8::Value > pDefault)
v8::Local< v8::Object > GetThisObj()
void DefineObjAllProperties(uint32_t nObjDefnID, v8::GenericNamedPropertyQueryCallback pPropQurey, v8::GenericNamedPropertyGetterCallback pPropGet, v8::GenericNamedPropertySetterCallback pPropPut, v8::GenericNamedPropertyDeleterCallback pPropDel, v8::GenericNamedPropertyEnumeratorCallback pPropEnum)
absl::optional< IJS_Runtime::JS_Error > Execute(const WideString &script)
void SetConstArray(const WideString &name, v8::Local< v8::Array > array)
v8::Local< v8::Array > GetConstArray(const WideString &name)
uint32_t DefineObj(const char *sObjName, FXJSOBJTYPE eObjType, Constructor pConstructor, Destructor pDestructor)
CFXJS_Engine(v8::Isolate *pIsolate)
void Error(const WideString &message)
v8::Local< v8::Object > NewFXJSBoundObject(uint32_t nObjDefnID, FXJSOBJTYPE type)
void DefineGlobalConst(const wchar_t *sConstName, v8::FunctionCallback pConstGetter)
void DefineGlobalMethod(const char *sMethodName, v8::FunctionCallback pMethodCall)
void RunConstructor(CFXJS_Engine *pEngine, v8::Local< v8::Object > obj, v8::Local< v8::Object > proxy)
const char * GetObjName() const
void DefineAllProperties(v8::GenericNamedPropertyQueryCallback pPropQurey, v8::GenericNamedPropertyGetterCallback pPropGet, v8::GenericNamedPropertySetterCallback pPropPut, v8::GenericNamedPropertyDeleterCallback pPropDel, v8::GenericNamedPropertyEnumeratorCallback pPropEnum)
void DefineConst(const char *sConstName, v8::Local< v8::Value > pDefault)
static void CallHandler(const v8::FunctionCallbackInfo< v8::Value > &info)
v8::Isolate * GetIsolate() const
void DefineMethod(v8::Local< v8::String > sMethodName, v8::FunctionCallback pMethodCall)
void RunDestructor(v8::Local< v8::Object > obj)
CFXJS_ObjDefinition(v8::Isolate *isolate, const char *sObjName, FXJSOBJTYPE eObjType, CFXJS_Engine::Constructor pConstructor, CFXJS_Engine::Destructor pDestructor)
FXJSOBJTYPE GetObjType() const
v8::Local< v8::ObjectTemplate > GetInstanceTemplate()
void DefineProperty(v8::Local< v8::String > sPropName, v8::AccessorGetterCallback pPropGet, v8::AccessorSetterCallback pPropPut)
v8::Local< v8::Signature > GetSignature()
void SetPrivate(std::unique_ptr< CJS_Object > p)
~CFXJS_PerObjectData()=default
static void SetNewDataInObject(uint32_t nObjDefnID, v8::Local< v8::Object > pObj)
CJS_Object * GetPrivate()
static CFXJS_PerObjectData * GetFromObject(v8::Local< v8::Object > pObj)
uint32_t GetObjDefnID() const
CFX_V8ArrayBufferAllocator()
uint32_t CurrentMaxObjDefinitionID() const
CFXJS_ObjDefinition * ObjDefinitionForID(uint32_t id) const
uint32_t AssignIDForObjDefinition(std::unique_ptr< CFXJS_ObjDefinition > pDefn)
static void OnWeakCallback(const v8::WeakCallbackInfo< WeakCallbackDataType > &data)
static void DisposeCallbackData(WeakCallbackDataType *callbackData)
static void Dispose(v8::Isolate *isolate, v8::Global< v8::Object > value, WeakCallbackDataType *key)
static WeakCallbackDataType * KeyFromWeakCallbackInfo(const v8::WeakCallbackInfo< WeakCallbackDataType > &data)
static MapType * MapFromWeakCallbackInfo(const v8::WeakCallbackInfo< WeakCallbackDataType > &)
static WeakCallbackDataType * WeakCallbackParameter(MapType *map, WeakCallbackDataType *key, v8::Local< v8::Object > value)
static const v8::PersistentContainerCallbackType kCallbackType
static void DisposeWeak(const v8::WeakCallbackInfo< WeakCallbackDataType > &data)
V8TemplateMap(v8::Isolate *isolate)
void SetAndMakeWeak(v8::Local< v8::Object > handle)
void ThrowExceptionHelper(v8::Isolate *pIsolate, WideStringView str)