void ScriptEngine::setup() { if (getGlobalScriptEngine()) return; setGlobalScriptEngine(new mozjs::MozJSScriptEngine()); if (hasGlobalServiceContext()) { getGlobalServiceContext()->registerKillOpListener(getGlobalScriptEngine()); } }
BSONObj interpreterVersion(const BSONObj& a, void* data) { uassert(16453, "interpreterVersion accepts no arguments", a.nFields() == 0); return BSON("" << getGlobalScriptEngine()->getInterpreterVersionString()); }