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 <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
diff --git a/fxjs/cjs_console.cpp b/fxjs/cjs_console.cpp
index 1ccf72f..d2cbb24 100644
--- a/fxjs/cjs_console.cpp
+++ b/fxjs/cjs_console.cpp
@@ -22,6 +22,11 @@
 const char CJS_Console::kName[] = "console";
 
 // static
+int CJS_Console::GetObjDefnID() {
+  return ObjDefnID;
+}
+
+// static
 void CJS_Console::DefineJSObjects(CFXJS_Engine* pEngine) {
   ObjDefnID = pEngine->DefineObj(CJS_Console::kName, FXJSOBJTYPE_STATIC,
                                  JSConstructor<CJS_Console>, JSDestructor);