summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-07-14 12:07:48 -0700
committerCommit bot <commit-bot@chromium.org>2016-07-14 12:07:48 -0700
commit88b6686f6e56a01dab0172f4b3129ab7ae0cd8d8 (patch)
treef468bcfd290387726af632c8a462b15cc4d1e241 /fpdfsdk/javascript
parent0089a685b6eb620ff24170cfddac502901fde495 (diff)
downloadpdfium-88b6686f6e56a01dab0172f4b3129ab7ae0cd8d8.tar.xz
Do not try to v8::Object::Clone() any objects
v8::Object::Clone() is deprecated, and gets us into trouble with some corner cases. Create a new handle to the same object instead. Remove FXJS_NewObject() and FXJS_NewObject2(), and replace with direct assignments. Pass isolate to FXJS_NewNull() while were at it, even though not needed, for consistency with all remaining FXJS_New*() calls. BUG=628106 R=jochen@chromium.org Review-Url: https://codereview.chromium.org/2151023002
Diffstat (limited to 'fpdfsdk/javascript')
-rw-r--r--fpdfsdk/javascript/JS_Value.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/fpdfsdk/javascript/JS_Value.cpp b/fpdfsdk/javascript/JS_Value.cpp
index 53d6d59833..6bc45c555d 100644
--- a/fpdfsdk/javascript/JS_Value.cpp
+++ b/fpdfsdk/javascript/JS_Value.cpp
@@ -186,7 +186,7 @@ void CJS_Value::operator=(float fValue) {
}
void CJS_Value::operator=(v8::Local<v8::Object> pObj) {
- m_pValue = FXJS_NewObject(m_pJSRuntime->GetIsolate(), pObj);
+ m_pValue = pObj;
m_eType = VT_fxobject;
}
@@ -208,7 +208,7 @@ void CJS_Value::operator=(const FX_WCHAR* pWstr) {
}
void CJS_Value::SetNull() {
- m_pValue = FXJS_NewNull();
+ m_pValue = FXJS_NewNull(m_pJSRuntime->GetIsolate());
m_eType = VT_null;
}
@@ -217,8 +217,7 @@ void CJS_Value::operator=(const FX_CHAR* pStr) {
}
void CJS_Value::operator=(CJS_Array& array) {
- m_pValue =
- FXJS_NewObject2(m_pJSRuntime->GetIsolate(), (v8::Local<v8::Array>)array);
+ m_pValue = static_cast<v8::Local<v8::Array>>(array);
m_eType = VT_object;
}