Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Unified Diff: fpdfsdk/src/jsapi/fxjs_v8.cpp

Issue 971013002: Merge to XFA: Return error information from pdfium to JS. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/javascript/resource.cpp ('k') | testing/resources/javascript/document_props.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/jsapi/fxjs_v8.cpp
diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp
index 46a6cba3604ded785a55ec1f05c570c2c0309f07..72966e9c6376f4011f6a9723eeea987e416b5807 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);
« no previous file with comments | « fpdfsdk/src/javascript/resource.cpp ('k') | testing/resources/javascript/document_props.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698