diff --git a/src/script/v8/engine.cpp b/src/script/v8/engine.cpp index 6204f8d6a..631e19feb 100644 --- a/src/script/v8/engine.cpp +++ b/src/script/v8/engine.cpp @@ -27,6 +27,7 @@ #include #include +#include #include using namespace script; @@ -254,7 +255,7 @@ class V8ScriptObject : public InternalScriptObject { auto isolate = args.GetIsolate(); v8::HandleScope handle_scope(isolate); auto data = args.Data().As(); - auto& func = *reinterpret_cast(data->Value()); + auto& func = *reinterpret_cast(data->Value(v8::kExternalPointerTypeTagDefault)); for (int i = 0; i < args.Length(); i++) { func.arguments.push_back(getValue(isolate, args[i])); @@ -274,7 +275,7 @@ class V8ScriptObject : public InternalScriptObject { auto isolate = m_engine.get()->m_isolate; auto context = m_engine.get()->context(); for (auto& entry : functions) { - auto tpl = v8::FunctionTemplate::New(isolate, callFunc, v8::External::New(isolate, &entry.second)); + auto tpl = v8::FunctionTemplate::New(isolate, callFunc, v8::External::New(isolate, &entry.second, v8::kExternalPointerTypeTagDefault)); auto func = tpl->GetFunction(context).ToLocalChecked(); Check(object->Set(context, ToLocal(v8::String::NewFromUtf8(isolate, entry.first.c_str())), @@ -287,10 +288,10 @@ class V8ScriptObject : public InternalScriptObject { auto context = m_engine.get()->context(); for (auto& entry : properties) { - auto getterTpl = v8::FunctionTemplate::New(isolate, callFunc, v8::External::New(isolate, &entry.second.getter)); + auto getterTpl = v8::FunctionTemplate::New(isolate, callFunc, v8::External::New(isolate, &entry.second.getter, v8::kExternalPointerTypeTagDefault)); auto getter = getterTpl->GetFunction(context).ToLocalChecked(); - auto setterTpl = v8::FunctionTemplate::New(isolate, callFunc, v8::External::New(isolate, &entry.second.setter)); + auto setterTpl = v8::FunctionTemplate::New(isolate, callFunc, v8::External::New(isolate, &entry.second.setter, v8::kExternalPointerTypeTagDefault)); auto setter = setterTpl->GetFunction(context).ToLocalChecked(); v8::PropertyDescriptor descriptor(getter, setter);