summaryrefslogtreecommitdiff
path: root/fxjs
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-05-25 14:41:33 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-25 14:41:33 +0000
commitbe0f656a8e61336cbe0089904c9bfb6e23521bce (patch)
tree8d36382f267423c90086b613e5b4f693acd41324 /fxjs
parent97db69faaeb4f8481f9d8824bff644509949cb0d (diff)
downloadpdfium-be0f656a8e61336cbe0089904c9bfb6e23521bce.tar.xz
Add code to display XFA JS log messages
This CL adds a bit of commented out code to CJX_LogPseudoModel to dump any xfa.log.message() commands to the terminal. It's commented out as we don't want it running normally but we can enable as needed. Change-Id: Ia53759253391cbaa249a1801aa1541213020ad68 Reviewed-on: https://pdfium-review.googlesource.com/32915 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fxjs')
-rw-r--r--fxjs/xfa/cjx_logpseudomodel.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/fxjs/xfa/cjx_logpseudomodel.cpp b/fxjs/xfa/cjx_logpseudomodel.cpp
index 446c937fc3..18093f5263 100644
--- a/fxjs/xfa/cjx_logpseudomodel.cpp
+++ b/fxjs/xfa/cjx_logpseudomodel.cpp
@@ -28,6 +28,13 @@ CJX_LogPseudoModel::~CJX_LogPseudoModel() {}
CJS_Return CJX_LogPseudoModel::message(
CFX_V8* runtime,
const std::vector<v8::Local<v8::Value>>& params) {
+ // Uncomment to allow using xfa.log.message(""); from JS.
+ // fprintf(stderr, "LOG\n");
+ // for (auto& val : params) {
+ // v8::String::Utf8Value str(runtime->GetIsolate(), val);
+ // fprintf(stderr, " %ls\n", WideString::FromUTF8(*str).c_str());
+ // }
+
return CJS_Return(true);
}