diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-03-02 12:59:05 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-03-02 12:59:05 -0800 |
commit | 3a83266acee37e99832adaf1337c6b3ab7559f50 (patch) | |
tree | 8700b04028864100e2618a72e4a9f52a6bc2f224 /fpdfsdk/src/jsapi | |
parent | fb3eea5323bf59884659510a6743037cc1d546cd (diff) | |
download | pdfium-3a83266acee37e99832adaf1337c6b3ab7559f50.tar.xz |
Merge to XFA: Return error information from pdfium to JS.
Cherry-pick from b720d0a14601f1496ef15297bc46d401f5a2a890 +
Manually resolve merge conflicts +
Fix more IWYU to fix compile.
Original Review URL: https://codereview.chromium.org/963193003
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/971013002
Diffstat (limited to 'fpdfsdk/src/jsapi')
-rw-r--r-- | fpdfsdk/src/jsapi/fxjs_v8.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp index 46a6cba360..72966e9c63 100644 --- a/fpdfsdk/src/jsapi/fxjs_v8.cpp +++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp @@ -460,9 +460,14 @@ int JS_GetObjDefnID(IJS_Runtime * pJSRuntime, const wchar_t* pObjName) return -1; } -void JS_Error(v8::Value * pError,const wchar_t * main,const wchar_t * sub) +void JS_Error(v8::Isolate* isolate, const CFX_WideString& message) { - + // Conversion from pdfium's wchar_t wide-strings to v8's uint16_t + // wide-strings isn't handled by v8, so use UTF8 as a common + // intermediate format. + CFX_ByteString utf8_message = message.UTF8Encode(); + isolate->ThrowException(v8::String::NewFromUtf8(isolate, + utf8_message.c_str())); } unsigned JS_CalcHash(const wchar_t* main, unsigned nLen) @@ -494,11 +499,6 @@ const wchar_t* JS_GetTypeof(v8::Handle<v8::Value> pObj) return NULL; } -const wchar_t* JS_GetClassname(v8::Handle<v8::Object> pObj) -{ - return NULL; -} - void JS_SetPrivate(v8::Handle<v8::Object> pObj, void* p) { JS_SetPrivate(NULL, pObj, p); |