react / wstein / node_modules / jest-cli / node_modules / jasmine-only / node_modules / coffee-script / lib / coffee-script / browser.js
81146 views// Generated by CoffeeScript 1.6.31(function() {2var CoffeeScript, compile, runScripts,3__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };45CoffeeScript = require('./coffee-script');67CoffeeScript.require = require;89compile = CoffeeScript.compile;1011CoffeeScript["eval"] = function(code, options) {12if (options == null) {13options = {};14}15if (options.bare == null) {16options.bare = true;17}18return eval(compile(code, options));19};2021CoffeeScript.run = function(code, options) {22if (options == null) {23options = {};24}25options.bare = true;26options.shiftLine = true;27return Function(compile(code, options))();28};2930if (typeof window === "undefined" || window === null) {31return;32}3334if ((typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null) && (typeof unescape !== "undefined" && unescape !== null) && (typeof encodeURIComponent !== "undefined" && encodeURIComponent !== null)) {35compile = function(code, options) {36var js, v3SourceMap, _ref;37if (options == null) {38options = {};39}40options.sourceMap = true;41options.inline = true;42_ref = CoffeeScript.compile(code, options), js = _ref.js, v3SourceMap = _ref.v3SourceMap;43return "" + js + "\n//@ sourceMappingURL=data:application/json;base64," + (btoa(unescape(encodeURIComponent(v3SourceMap)))) + "\n//@ sourceURL=coffeescript";44};45}4647CoffeeScript.load = function(url, callback, options) {48var xhr;49if (options == null) {50options = {};51}52options.sourceFiles = [url];53xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new window.XMLHttpRequest();54xhr.open('GET', url, true);55if ('overrideMimeType' in xhr) {56xhr.overrideMimeType('text/plain');57}58xhr.onreadystatechange = function() {59var _ref;60if (xhr.readyState === 4) {61if ((_ref = xhr.status) === 0 || _ref === 200) {62CoffeeScript.run(xhr.responseText, options);63} else {64throw new Error("Could not load " + url);65}66if (callback) {67return callback();68}69}70};71return xhr.send(null);72};7374runScripts = function() {75var coffees, coffeetypes, execute, index, length, s, scripts;76scripts = window.document.getElementsByTagName('script');77coffeetypes = ['text/coffeescript', 'text/literate-coffeescript'];78coffees = (function() {79var _i, _len, _ref, _results;80_results = [];81for (_i = 0, _len = scripts.length; _i < _len; _i++) {82s = scripts[_i];83if (_ref = s.type, __indexOf.call(coffeetypes, _ref) >= 0) {84_results.push(s);85}86}87return _results;88})();89index = 0;90length = coffees.length;91(execute = function() {92var mediatype, options, script;93script = coffees[index++];94mediatype = script != null ? script.type : void 0;95if (__indexOf.call(coffeetypes, mediatype) >= 0) {96options = {97literate: mediatype === 'text/literate-coffeescript'98};99if (script.src) {100return CoffeeScript.load(script.src, execute, options);101} else {102options.sourceFiles = ['embedded'];103CoffeeScript.run(script.innerHTML, options);104return execute();105}106}107})();108return null;109};110111if (window.addEventListener) {112window.addEventListener('DOMContentLoaded', runScripts, false);113} else {114window.attachEvent('onload', runScripts);115}116117}).call(this);118119120