From 998fee395fc8a543968c7db3db9e3cf81dee57fc Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 5 Feb 2018 21:43:19 +0000 Subject: Remove the CJS_EmbedObj template param from JSConstructor. Each of the CJS_Objects can create their CJS_EmbedObj's internally and we don't need to do it though the JSConstructor. This also removes the need for the SetEmbedObj method in CJS_Object. Change-Id: Ib0535ad922b370634fd1e622a04860a96c4f2825 Reviewed-on: https://pdfium-review.googlesource.com/25370 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- fxjs/cjs_event.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'fxjs/cjs_event.cpp') diff --git a/fxjs/cjs_event.cpp b/fxjs/cjs_event.cpp index 09b104a8d5..7736f0dda4 100644 --- a/fxjs/cjs_event.cpp +++ b/fxjs/cjs_event.cpp @@ -39,13 +39,17 @@ int CJS_Event::ObjDefnID = -1; // static void CJS_Event::DefineJSObjects(CFXJS_Engine* pEngine) { ObjDefnID = pEngine->DefineObj("event", FXJSOBJTYPE_STATIC, - JSConstructor, JSDestructor); + JSConstructor, JSDestructor); DefineProps(pEngine, ObjDefnID, PropertySpecs, FX_ArraySize(PropertySpecs)); } +CJS_Event::CJS_Event(v8::Local pObject) : CJS_Object(pObject) { + m_pEmbedObj = pdfium::MakeUnique(this); +} + event::event(CJS_Object* pJsObject) : CJS_EmbedObj(pJsObject) {} -event::~event() {} +event::~event() = default; CJS_Return event::get_change(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = -- cgit v1.2.3