From ad1f7b410cd6885bd22d9ee49d9f80d3017f131f Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 11 Jul 2018 13:04:43 +0000 Subject: Check GetObjDefnID() in various JS functions. Consolidate all the checks into JSGetObject(), and add GetObjDefnID() methods for classes that are missing it. BUG=chromium:862059 Change-Id: I2c2b725a01dcd259ef712d2513fcf740cc410b15 Reviewed-on: https://pdfium-review.googlesource.com/37510 Commit-Queue: dsinclair Reviewed-by: dsinclair --- fxjs/cjs_util.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fxjs/cjs_util.cpp') diff --git a/fxjs/cjs_util.cpp b/fxjs/cjs_util.cpp index 3889f5ab63..eee9db3fb9 100644 --- a/fxjs/cjs_util.cpp +++ b/fxjs/cjs_util.cpp @@ -67,6 +67,11 @@ const JSMethodSpec CJS_Util::MethodSpecs[] = { int CJS_Util::ObjDefnID = -1; const char CJS_Util::kName[] = "util"; +// static +int CJS_Util::GetObjDefnID() { + return ObjDefnID; +} + // static void CJS_Util::DefineJSObjects(CFXJS_Engine* pEngine) { ObjDefnID = pEngine->DefineObj(CJS_Util::kName, FXJSOBJTYPE_STATIC, -- cgit v1.2.3