diff options
author | Jochen Eisinger <jochen@chromium.org> | 2015-05-17 13:07:02 +0200 |
---|---|---|
committer | Jochen Eisinger <jochen@chromium.org> | 2015-05-17 13:07:02 +0200 |
commit | d94df885e9e680e7dc8a5ac116c8d4ab5e4790cd (patch) | |
tree | 0fcfab1afcc892edd79086b86a6bcb29bfefcd0c /fpdfsdk/src/javascript/global.cpp | |
parent | 1962d61b28df03284e3e5c6de6a19f397a066e68 (diff) | |
download | pdfium-d94df885e9e680e7dc8a5ac116c8d4ab5e4790cd.tar.xz |
Replace deprecated with non-deprecated V8 APIs
In most cases, we just CHECK() that no exception was thrown. Previously,
we'd just crash.
Ideally, this should all be fixed and the system should cope with those
exceptions, but that's beyond this CL.
R=tsepez@chromium.org
BUG=
Review URL: https://codereview.chromium.org/1126203010
Diffstat (limited to 'fpdfsdk/src/javascript/global.cpp')
-rw-r--r-- | fpdfsdk/src/javascript/global.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp index 418508f89e..99db9e7a71 100644 --- a/fpdfsdk/src/javascript/global.cpp +++ b/fpdfsdk/src/javascript/global.cpp @@ -387,16 +387,15 @@ void global_alternate::CommitGlobalPersisitentVariables() void global_alternate::ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVariableArray& array) { - v8::Handle<v8::Array> pKeyList = JS_GetObjectElementNames(pObj); - int nObjElements = pKeyList->Length(); - v8::Local<v8::Context> context = pObj->CreationContext(); v8::Isolate* isolate = context->GetIsolate(); + v8::Handle<v8::Array> pKeyList = JS_GetObjectElementNames(isolate, pObj); + int nObjElements = pKeyList->Length(); for (int i=0; i<nObjElements; i++) { - CFX_WideString ws = JS_ToString(JS_GetArrayElemnet(pKeyList, i)); + CFX_WideString ws = JS_ToString(isolate, JS_GetArrayElement(isolate, pKeyList, i)); CFX_ByteString sKey = ws.UTF8Encode(); v8::Handle<v8::Value> v = JS_GetObjectElement(isolate, pObj, ws.c_str()); @@ -408,7 +407,7 @@ void global_alternate::ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVari CJS_KeyValue* pObjElement = new CJS_KeyValue; pObjElement->nType = JS_GLOBALDATA_TYPE_NUMBER; pObjElement->sKey = sKey; - pObjElement->dData = JS_ToNumber(v); + pObjElement->dData = JS_ToNumber(isolate, v); array.Add(pObjElement); } break; @@ -417,7 +416,7 @@ void global_alternate::ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVari CJS_KeyValue* pObjElement = new CJS_KeyValue; pObjElement->nType = JS_GLOBALDATA_TYPE_BOOLEAN; pObjElement->sKey = sKey; - pObjElement->dData = JS_ToBoolean(v); + pObjElement->dData = JS_ToBoolean(isolate, v); array.Add(pObjElement); } break; @@ -436,7 +435,7 @@ void global_alternate::ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVari CJS_KeyValue* pObjElement = new CJS_KeyValue; pObjElement->nType = JS_GLOBALDATA_TYPE_OBJECT; pObjElement->sKey = sKey; - ObjectToArray(JS_ToObject(v), pObjElement->objData); + ObjectToArray(JS_ToObject(isolate, v), pObjElement->objData); array.Add(pObjElement); } break; |