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

Unified Diff: fpdfsdk/src/javascript/global.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/console.cpp ('k') | fpdfsdk/src/javascript/resource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/global.cpp
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp
index 39e6dc0237b8602c0f5b4aa811452ff486d18294..208fa20d2f59024ba89e279651dc3c4ebb12e2e1 100644
--- a/fpdfsdk/src/javascript/global.cpp
+++ b/fpdfsdk/src/javascript/global.cpp
@@ -4,16 +4,17 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "../../include/javascript/JavaScript.h"
#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Context.h"
#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_EventHandler.h"
+#include "../../include/javascript/JS_GlobalData.h"
#include "../../include/javascript/JS_Object.h"
#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/JS_GlobalData.h"
+#include "../../include/javascript/JavaScript.h"
#include "../../include/javascript/global.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Context.h"
#include "../../include/fpdfxfa/fpdfxfa_app.h"
+#include "../../include/javascript/resource.h"
/* ---------------------------- global ---------------------------- */
@@ -271,9 +272,10 @@ FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS
FX_BOOL global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError)
{
+ CJS_Context* pContext = static_cast<CJS_Context*>(cc);
if (params.size() != 2)
{
- //sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
return FALSE;
}
@@ -289,7 +291,7 @@ FX_BOOL global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters&
}
}
- //sError = JSGetStringFromID(IDS_JSPARAM_INCORRECT);
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSNOGLOBAL);
return FALSE;
}
« no previous file with comments | « fpdfsdk/src/javascript/console.cpp ('k') | fpdfsdk/src/javascript/resource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698