summaryrefslogtreecommitdiff
path: root/fxjs/cjs_runtime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs/cjs_runtime.cpp')
-rw-r--r--fxjs/cjs_runtime.cpp12
1 files changed, 5 insertions, 7 deletions
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<v8::Object> 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<CJS_Document*>(GetObjectPrivate(pThis));
+ }
+ auto* pJSDocument =
+ static_cast<CJS_Document*>(CFXJS_Engine::GetObjectPrivate(pThis));
if (!pJSDocument)
return;