From 0784c7317e3aaa2c65d098cf2593b6b49986307d Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 23 Apr 2018 18:02:57 +0000 Subject: 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 Commit-Queue: Tom Sepez --- fxjs/cjs_runtimestub.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fxjs/cjs_runtimestub.cpp') diff --git a/fxjs/cjs_runtimestub.cpp b/fxjs/cjs_runtimestub.cpp index 98c7679a04..c1e680e5d5 100644 --- a/fxjs/cjs_runtimestub.cpp +++ b/fxjs/cjs_runtimestub.cpp @@ -14,6 +14,10 @@ CJS_RuntimeStub::CJS_RuntimeStub(CPDFSDK_FormFillEnvironment* pFormFillEnv) CJS_RuntimeStub::~CJS_RuntimeStub() = default; +CJS_Runtime* CJS_RuntimeStub::AsCJSRuntime() { + return nullptr; +} + IJS_EventContext* CJS_RuntimeStub::NewEventContext() { if (!m_pContext) m_pContext = pdfium::MakeUnique(); -- cgit v1.2.3