Ejemplo n.º 1
0
void ScriptEngine::setup() {
    if (getGlobalScriptEngine())
        return;

    setGlobalScriptEngine(new mozjs::MozJSScriptEngine());

    if (hasGlobalServiceContext()) {
        getGlobalServiceContext()->registerKillOpListener(getGlobalScriptEngine());
    }
}
Ejemplo n.º 2
0
BSONObj interpreterVersion(const BSONObj& a, void* data) {
    uassert(16453, "interpreterVersion accepts no arguments", a.nFields() == 0);
    return BSON("" << getGlobalScriptEngine()->getInterpreterVersionString());
}