diff options
author | tsepez <tsepez@chromium.org> | 2016-07-15 17:58:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-15 17:58:02 -0700 |
commit | 40faa79da0bc902d7f1f5cc43464b94e6dfa5d22 (patch) | |
tree | 3e6ef034906a3cb46eb833b3e2309b34f7549c1d /fpdfsdk/javascript/JS_Value.h | |
parent | 514e8c914c0e6c2c69167d03786a83b1ebd15d70 (diff) | |
download | pdfium-40faa79da0bc902d7f1f5cc43464b94e6dfa5d22.tar.xz |
Remove type info from CJS_Value, interrogate v8 instead
Review-Url: https://codereview.chromium.org/2154503002
Diffstat (limited to 'fpdfsdk/javascript/JS_Value.h')
-rw-r--r-- | fpdfsdk/javascript/JS_Value.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/fpdfsdk/javascript/JS_Value.h b/fpdfsdk/javascript/JS_Value.h index e8544504d2..8e791253c6 100644 --- a/fpdfsdk/javascript/JS_Value.h +++ b/fpdfsdk/javascript/JS_Value.h @@ -27,20 +27,17 @@ class CJS_Value { VT_boolean, VT_date, VT_object, - VT_fxobject, VT_null, VT_undefined }; CJS_Value(CJS_Runtime* pRuntime); - CJS_Value(CJS_Runtime* pRuntime, v8::Local<v8::Value> pValue, Type t); + CJS_Value(CJS_Runtime* pRuntime, v8::Local<v8::Value> pValue); CJS_Value(CJS_Runtime* pRuntime, const int& iValue); CJS_Value(CJS_Runtime* pRuntime, const double& dValue); CJS_Value(CJS_Runtime* pRuntime, const float& fValue); CJS_Value(CJS_Runtime* pRuntime, const bool& bValue); - CJS_Value(CJS_Runtime* pRuntime, v8::Local<v8::Object>); - CJS_Value(CJS_Runtime* pRuntime, CJS_Object*); - CJS_Value(CJS_Runtime* pRuntime, CJS_Document*); + CJS_Value(CJS_Runtime* pRuntime, CJS_Object* pObj); CJS_Value(CJS_Runtime* pRuntime, const FX_CHAR* pStr); CJS_Value(CJS_Runtime* pRuntime, const FX_WCHAR* pWstr); CJS_Value(CJS_Runtime* pRuntime, CJS_Array& array); @@ -49,11 +46,12 @@ class CJS_Value { CJS_Value(const CJS_Value& other); void SetNull(); - void Attach(v8::Local<v8::Value> pValue, Type t); + void Attach(v8::Local<v8::Value> pValue); void Attach(CJS_Value* pValue); void Detach(); - Type GetType() const; + static Type GetValueType(v8::Local<v8::Value> value); + Type GetType() const { return GetValueType(m_pValue); } int ToInt() const; bool ToBool() const; double ToDouble() const; @@ -66,8 +64,7 @@ class CJS_Value { v8::Local<v8::Value> ToV8Value() const; // Replace the current |m_pValue| with a v8::Number if possible - // to make one from the current |m_pValue|, updating |m_eType| - // as appropriate to indicate the result. + // to make one from the current |m_pValue|. void MaybeCoerceToNumber(); void operator=(int iValue); @@ -75,7 +72,6 @@ class CJS_Value { void operator=(double val); void operator=(float val); void operator=(CJS_Object* val); - void operator=(CJS_Document* val); void operator=(v8::Local<v8::Object> val); void operator=(CJS_Array& val); void operator=(CJS_Date& val); @@ -91,7 +87,6 @@ class CJS_Value { CJS_Runtime* GetJSRuntime() const { return m_pJSRuntime; } protected: - Type m_eType; v8::Local<v8::Value> m_pValue; CJS_Runtime* m_pJSRuntime; }; |