summaryrefslogtreecommitdiff
path: root/fxjs/js_define.h
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs/js_define.h')
-rw-r--r--fxjs/js_define.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/fxjs/js_define.h b/fxjs/js_define.h
index 93dfd49099..0f16749779 100644
--- a/fxjs/js_define.h
+++ b/fxjs/js_define.h
@@ -50,9 +50,8 @@ std::vector<v8::Local<v8::Value>> ExpandKeywordParams(
template <class T>
static void JSConstructor(CFXJS_Engine* pEngine, v8::Local<v8::Object> obj) {
- auto pObj = pdfium::MakeUnique<T>(obj, static_cast<CJS_Runtime*>(pEngine));
- pObj->InitInstance();
- pEngine->SetObjectPrivate(obj, std::move(pObj));
+ pEngine->SetObjectPrivate(
+ obj, pdfium::MakeUnique<T>(obj, static_cast<CJS_Runtime*>(pEngine)));
}
// CJS_Object has vitual dtor, template not required.