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

Unified Diff: fpdfsdk/src/javascript/JS_Context.cpp

Issue 1389163007: Pass IJS_Runtime, not IJS_Context, to native object constructors. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: comment Created 5 years, 2 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
Index: fpdfsdk/src/javascript/JS_Context.cpp
diff --git a/fpdfsdk/src/javascript/JS_Context.cpp b/fpdfsdk/src/javascript/JS_Context.cpp
index b67096d9bc0db49d93b5bcf9b4cad72576ec58bd..7e7a14a008c1bd1755408db5689d8d200c8c904d 100644
--- a/fpdfsdk/src/javascript/JS_Context.cpp
+++ b/fpdfsdk/src/javascript/JS_Context.cpp
@@ -53,18 +53,15 @@ FX_BOOL CJS_Context::RunScript(const CFX_WideString& script,
return FALSE;
}
- FXJSErr error = {NULL, NULL, 0};
+ CFX_WideString sErrorMessage;
int nRet = 0;
if (script.GetLength() > 0) {
- nRet = FXJS_Execute(m_pRuntime->GetIsolate(), this, script.c_str(),
- script.GetLength(), &error);
+ nRet = m_pRuntime->Execute(this, script.c_str(), script.GetLength(),
+ sErrorMessage);
}
if (nRet < 0) {
- CFX_WideString sLine;
- sLine.Format(L"[ Line: %05d { %s } ] : %s", error.linnum - 1, error.srcline,
- error.message);
- info += sLine;
+ info += sErrorMessage;
} else {
info = JSGetStringFromID(this, IDS_STRING_RUN);
}

Powered by Google App Engine
This is Rietveld 408576698