_base.js
function Context(opt_configureForTesting) {
  var closure = this.closure = vm.createContext({
    console: console,
    setTimeout: setTimeout,
    setInterval: setInterval,
    clearTimeout: clearTimeout,
    clearInterval: clearInterval,
    process: process,
    require: require,
    Buffer: Buffer,
    Error: Error,
    CLOSURE_BASE_PATH: path.dirname(CLOSURE_BASE_FILE_PATH) + '/',
    CLOSURE_IMPORT_SCRIPT: function(src) {
      loadScript(src);
      return true;
    },
    CLOSURE_NO_DEPS: !isDevMode(),
    goog: {}
  });
  closure.window = closure.top = closure;

  if (opt_configureForTesting) {
    closure.document = {
      body: {},
      createElement: function() { return {}; },
      getElementsByTagName: function() { return []; }
    };
    closure.document.body.ownerDocument = closure.document;
  }

  loadScript(CLOSURE_BASE_FILE_PATH);
  loadScript(DEPS_FILE_PATH);

  /**
   * Synchronously loads a script into the protected Closure context.
   * @param {string} src Path to the file to load.
   */
  function loadScript(src) {
    src = path.normalize(src);
    var contents = fs.readFileSync(src, 'utf8');
    vm.runInContext(contents, closure, src);
  }
}
function Context(opt_configureForTesting) {
  var closure = this.closure = vm.createContext({
    console: console,
    setTimeout: setTimeout,
    setInterval: setInterval,
    clearTimeout: clearTimeout,
    clearInterval: clearInterval,
    process: process,
    require: require,
    Buffer: Buffer,
    Error: Error,
    CLOSURE_BASE_PATH: path.dirname(CLOSURE_BASE_FILE_PATH) + '/',
    CLOSURE_IMPORT_SCRIPT: function(src) {
      loadScript(src);
      return true;
    },
    CLOSURE_NO_DEPS: !isDevMode(),
    goog: {}
  });
  closure.window = closure.top = closure;

  if (opt_configureForTesting) {
    closure.document = {
      body: {},
      createElement: function() { return {}; },
      getElementsByTagName: function() { return []; }
    };
    closure.document.body.ownerDocument = closure.document;
  }

  loadScript(CLOSURE_BASE_FILE_PATH);
  loadScript(DEPS_FILE_PATH);

  /**
   * Synchronously loads a script into the protected Closure context.
   * @param {string} src Path to the file to load.
   */
  function loadScript(src) {
    src = path.normalize(src);
    var contents = fs.readFileSync(src, 'utf8');
    vm.runInContext(contents, closure, src);
  }
}
function Context ( opt_configureForTesting ) { var closure = this . closure = vm . createContext ( { console : console , setTimeout : setTimeout , setInterval : setInterval , clearTimeout : clearTimeout , clearInterval : clearInterval , process : process , require : require , Buffer : Buffer , Error : Error , CLOSURE_BASE_PATH : path . dirname ( CLOSURE_BASE_FILE_PATH ) + '/' , CLOSURE_IMPORT_SCRIPT : function ( src ) { loadScript ( src ) ; return true ; } , CLOSURE_NO_DEPS : ! isDevMode ( ) , goog : { } } ) ; closure . window = closure . top = closure ; if ( opt_configureForTesting ) { closure . document = { body : { } , createElement : function ( ) { return { } ; } , getElementsByTagName : function ( ) { return [ ] ; } } ; closure . document . body . ownerDocument = closure . document ; } loadScript ( CLOSURE_BASE_FILE_PATH ) ; loadScript ( DEPS_FILE_PATH ) ; /**
   * Synchronously loads a script into the protected Closure context.
   * @param {string} src Path to the file to load.
   */ function loadScript ( src ) { src = path . normalize ( src ) ; var contents = fs . readFileSync ( src , 'utf8' ) ; vm . runInContext ( contents , closure , src ) ; } }
Maintains a unique context for Closure library-based code.
@param {boolean=} opt_configureForTesting Whether to configure a fake DOM
for Closure-testing code that (incorrectly) assumes a DOM is always
present.
@constructor
Maintains a unique context for Closure library - based code .