From ddaa40fe873070d3aae9a21b9a93848fc7e809f1 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 6 Jun 2018 18:30:15 +0000 Subject: Stop using some v8::Context slot to find runtime. Instead, use the object binding's pointer. Puts the cart back behind the horse. Change-Id: I4c06ae991b871c6e90b0e6c70b69886addca2354 Reviewed-on: https://pdfium-review.googlesource.com/33630 Commit-Queue: dsinclair Reviewed-by: dsinclair --- fxjs/cjs_runtime.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'fxjs/cjs_runtime.cpp') diff --git a/fxjs/cjs_runtime.cpp b/fxjs/cjs_runtime.cpp index a8640eaa34..2896c5f701 100644 --- a/fxjs/cjs_runtime.cpp +++ b/fxjs/cjs_runtime.cpp @@ -168,14 +168,12 @@ void CJS_Runtime::SetFormFillEnvToDocument() { v8::Context::Scope context_scope(context); v8::Local pThis = GetThisObj(); - if (pThis.IsEmpty()) + if (pThis.IsEmpty() || + CFXJS_Engine::GetObjDefnID(pThis) != CJS_Document::GetObjDefnID()) { return; - - if (CFXJS_Engine::GetObjDefnID(pThis) != CJS_Document::GetObjDefnID()) - return; - - CJS_Document* pJSDocument = - static_cast(GetObjectPrivate(pThis)); + } + auto* pJSDocument = + static_cast(CFXJS_Engine::GetObjectPrivate(pThis)); if (!pJSDocument) return; -- cgit v1.2.3