Disable JavaScript entirely if no JSPlatform passed by embedder.
Allows run-time selection of whether to permit JS inside PDF. Previously,
this was a link-time decision only. This requires a little more caution
before we decide that we have the CJS_Runtime, and not the CJS_RuntimeStub
in a few casts.
Adds a kDisableJavaScript option to the form fill embeddertests.
Adds a --disable-javascript flag to the pdfium_test executable.
Also adds a --disable-xfa flag while we're at it.
Change-Id: I8d8ac95f6474459cadba9a60572fbb342e984646
Reviewed-on: https://pdfium-review.googlesource.com/31090
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/cjs_runtime.cpp b/fxjs/cjs_runtime.cpp
index b9b9c03..3a607f1 100644
--- a/fxjs/cjs_runtime.cpp
+++ b/fxjs/cjs_runtime.cpp
@@ -143,6 +143,10 @@
CJS_Annot::DefineJSObjects(this);
}
+CJS_Runtime* CJS_Runtime::AsCJSRuntime() {
+ return this;
+}
+
IJS_EventContext* CJS_Runtime::NewEventContext() {
m_EventContextArray.push_back(pdfium::MakeUnique<CJS_EventContext>(this));
return m_EventContextArray.back().get();