text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  exports.default = function (realm) {
    var global = realm.$GlobalObject;
  
    global.$DefineOwnProperty("console", {
      value: (0, _console2.default)(realm),
      writable: true,
      enumerable: false,
      configurable: true
    });
  
    global.$DefineOwnProperty("self", {
      value: global,
      writable: true,
      enumerable: true,
      configurable: true
    });
  
    global.$DefineOwnProperty("window", {
      value: global,
      writable: true,
      enumerable: true,
      configurable: true
    });
  
    global.$DefineOwnProperty("document", {
      value: (0, _document2.default)(realm),
      writable: true,
      enumerable: false,
      configurable: true
    });
  
    global.$DefineOwnProperty("setTimeout", {
      value: new _index.NativeFunctionValue(realm, "::global.setTimeout", "", 2, function (context, args) {
        var callback = args[0].throwIfNotConcrete();
        if (!(callback instanceof _index.FunctionValue)) throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, "callback arguments must be function");
        if (!realm.isPartial) throw new Error("TODO: implement global.setTimeout");
        (0, _invariant2.default)(realm.generator !== undefined);
        var generator = realm.generator;
        return generator.emitCallAndCaptureResult(_index2.TypesDomain.topVal, _index2.ValuesDomain.topVal, function () {
          return generator.preludeGenerator.memoizeReference("::global.setTimeout");
        }, args);
      }),
      writable: true,
      enumerable: true,
      configurable: true
    });
  
    global.$DefineOwnProperty("clearTimeout", {
      value: new _index.NativeFunctionValue(realm, "::global.clearTimeout", "", 2, function (context, args) {
        if (!realm.isPartial) throw new Error("TODO: implement global.clearTimeout");
        (0, _invariant2.default)(realm.generator !== undefined);
        var generator = realm.generator;
        generator.emitCall(function () {
          return generator.preludeGenerator.memoizeReference("::global.clearTimeout");
        }, args);
        return realm.intrinsics.undefined;
      }),
      writable: true,
      enumerable: true,
      configurable: true
    });
  
    global.$DefineOwnProperty("setInterval", {
      value: new _index.NativeFunctionValue(realm, "::global.setInterval", "", 2, function (context, args) {
        if (!realm.isPartial) throw new Error("TODO: implement global.setInterval");
        var callback = args[0].throwIfNotConcrete();
        if (!(callback instanceof _index.FunctionValue)) throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, "callback arguments must be function");
        (0, _invariant2.default)(realm.generator !== undefined);
        var generator = realm.generator;
        return generator.emitCallAndCaptureResult(_index2.TypesDomain.topVal, _index2.ValuesDomain.topVal, function () {
          return generator.preludeGenerator.memoizeReference("::global.setInterval");
        }, args);
      }),
      writable: true,
      enumerable: true,
      configurable: true
    });
  
    global.$DefineOwnProperty("clearInterval", {
      value: new _index.NativeFunctionValue(realm, "::global.clearInterval", "", 2, function (context, args) {
        if (!realm.isPartial) throw new Error("TODO: implement global.clearInterval");
        (0, _invariant2.default)(realm.generator !== undefined);
        var generator = realm.generator;
        generator.emitCall(function () {
          return generator.preludeGenerator.memoizeReference("::global.clearInterval");
        }, args);
        return realm.intrinsics.undefined;
      }),
      writable: true,
      enumerable: true,
      configurable: true
    });
  };
  
  var _index = require("../../values/index.js");
  
  var _document = require("./document.js");
  
  var _document2 = _interopRequireDefault(_document);
  
  var _console = require("../common/console.js");
  
  var _console2 = _interopRequireDefault(_console);
  
  var _invariant = require("../../invariant.js");
  
  var _invariant2 = _interopRequireDefault(_invariant);
  
  var _index2 = require("../../domains/index.js");
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  //# sourceMappingURL=global.js.map