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/javascript/global.cpp | |
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/javascript/global.cpp')
-rw-r--r-- | fpdfsdk/src/javascript/global.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp index 39e6dc0237..208fa20d2f 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; } |