summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/global.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-02-17 13:30:23 -0800
committerTom Sepez <tsepez@chromium.org>2015-02-17 13:30:23 -0800
commitccc948344564f0e2079c3c3a5b1483ab5203fec9 (patch)
treed125f481a7a63a728e8bd2af151f5a633876eaa5 /fpdfsdk/src/javascript/global.cpp
parentca6c0d3262d994fbb008ee1ae5ff19c1612bc982 (diff)
downloadpdfium-ccc948344564f0e2079c3c3a5b1483ab5203fec9.tar.xz
Merge to XFA: Tidy up JS_Defines.h
Original Review URL: https://codereview.chromium.org/927263003 TBR=brucedawson@chromium.org Review URL: https://codereview.chromium.org/936613002
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;
+}
+