summaryrefslogtreecommitdiff
path: root/xfa/src/fxjse/src/class.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fxjse/src/class.cpp')
-rw-r--r--xfa/src/fxjse/src/class.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/xfa/src/fxjse/src/class.cpp b/xfa/src/fxjse/src/class.cpp
index 6ca3be8b72..206ad05734 100644
--- a/xfa/src/fxjse/src/class.cpp
+++ b/xfa/src/fxjse/src/class.cpp
@@ -33,7 +33,8 @@ void FXJSE_DefineFunctions(FXJSE_HCONTEXT hContext,
v8::Local<v8::Object> hGlobalObject =
FXJSE_GetGlobalObjectFromContext(scope.GetLocalContext());
for (int32_t i = 0; i < nNum; i++) {
- hGlobalObject->ForceSet(
+ hGlobalObject->DefineOwnProperty(
+ scope.GetLocalContext(),
v8::String::NewFromUtf8(pIsolate, lpFunctions[i].name),
v8::Function::New(
pIsolate, FXJSE_V8FunctionCallback_Wrapper,
@@ -240,7 +241,11 @@ static void FXJSE_Context_GlobalObjToString(
info.GetIsolate(), (const FX_CHAR*)szStringVal,
v8::String::kNormalString, szStringVal.GetLength()));
} else {
- info.GetReturnValue().Set(info.This()->ObjectProtoToString());
+ v8::Local<v8::String> local_str =
+ info.This()
+ ->ObjectProtoToString(info.GetIsolate()->GetCurrentContext())
+ .FromMaybe(v8::Local<v8::String>());
+ info.GetReturnValue().Set(local_str);
}
}