summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/global.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/javascript/global.cpp')
-rw-r--r--fpdfsdk/src/javascript/global.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp
index 23d8926bd3..906c73705c 100644
--- a/fpdfsdk/src/javascript/global.cpp
+++ b/fpdfsdk/src/javascript/global.cpp
@@ -269,7 +269,7 @@ FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS
return FALSE;
}
-FX_BOOL global_alternate::setPersistent(OBJ_METHOD_PARAMS)
+FX_BOOL global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError)
{
if (params.size() != 2)
{
@@ -616,3 +616,28 @@ FX_BOOL global_alternate::SetGlobalVariables(FX_LPCSTR propname, int nType,
return TRUE;
}
+
+FXJSVALUETYPE GET_VALUE_TYPE(v8::Handle<v8::Value> p)
+{
+ const unsigned int nHash = JS_CalcHash(JS_GetTypeof(p));
+
+ if (nHash == JSCONST_nUndefHash)
+ return VT_undefined;
+ if (nHash == JSCONST_nNullHash)
+ return VT_null;
+ if (nHash == JSCONST_nStringHash)
+ return VT_string;
+ if (nHash == JSCONST_nNumberHash)
+ return VT_number;
+ if (nHash == JSCONST_nBoolHash)
+ return VT_boolean;
+ if (nHash == JSCONST_nDateHash)
+ return VT_date;
+ if (nHash == JSCONST_nObjectHash)
+ return VT_object;
+ if (nHash == JSCONST_nFXobjHash)
+ return VT_fxobject;
+
+ return VT_unknown;
+}
+