summaryrefslogtreecommitdiff
path: root/xfa/fxjse
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxjse')
-rw-r--r--xfa/fxjse/context.cpp7
-rw-r--r--xfa/fxjse/context.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/xfa/fxjse/context.cpp b/xfa/fxjse/context.cpp
index 8eacc77a74..e5d5f994d5 100644
--- a/xfa/fxjse/context.cpp
+++ b/xfa/fxjse/context.cpp
@@ -157,13 +157,16 @@ CFXJSE_Context::CFXJSE_Context(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {}
CFXJSE_Context::~CFXJSE_Context() {}
-void CFXJSE_Context::GetGlobalObject(CFXJSE_Value* pValue) {
- ASSERT(pValue);
+std::unique_ptr<CFXJSE_Value> CFXJSE_Context::GetGlobalObject() {
+ std::unique_ptr<CFXJSE_Value> pValue(new CFXJSE_Value(m_pIsolate));
+
CFXJSE_ScopeUtil_IsolateHandleContext scope(this);
v8::Local<v8::Context> hContext =
v8::Local<v8::Context>::New(m_pIsolate, m_hContext);
v8::Local<v8::Object> hGlobalObject = hContext->Global();
pValue->ForceSetValue(hGlobalObject);
+
+ return pValue;
}
void CFXJSE_Context::EnableCompatibleMode() {
diff --git a/xfa/fxjse/context.h b/xfa/fxjse/context.h
index 4219713ece..0bb1e4fa26 100644
--- a/xfa/fxjse/context.h
+++ b/xfa/fxjse/context.h
@@ -27,7 +27,7 @@ class CFXJSE_Context {
~CFXJSE_Context();
V8_INLINE v8::Isolate* GetRuntime(void) { return m_pIsolate; }
- void GetGlobalObject(CFXJSE_Value* pValue);
+ std::unique_ptr<CFXJSE_Value> GetGlobalObject();
void EnableCompatibleMode();
FX_BOOL ExecuteScript(const FX_CHAR* szScript,
CFXJSE_Value* lpRetValue,