summaryrefslogtreecommitdiff
path: root/tools/eliminator/node_modules/coffee-script/lib/browser.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-10-13 18:44:15 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-10-13 18:44:15 -0700
commit86c90950a8ea0b942acb8fd17798b30c00fd72fa (patch)
treede8843611cdf711a4a6cf4abfd9559191621367f /tools/eliminator/node_modules/coffee-script/lib/browser.js
parent922608f31f0322de6e89e1741d3b2f1244f754db (diff)
update coffeescript to d8905e2f8799931013e227b869b1c6f6c85122f0
Diffstat (limited to 'tools/eliminator/node_modules/coffee-script/lib/browser.js')
-rw-r--r--tools/eliminator/node_modules/coffee-script/lib/browser.js75
1 files changed, 0 insertions, 75 deletions
diff --git a/tools/eliminator/node_modules/coffee-script/lib/browser.js b/tools/eliminator/node_modules/coffee-script/lib/browser.js
deleted file mode 100644
index 2fb7b2e2..00000000
--- a/tools/eliminator/node_modules/coffee-script/lib/browser.js
+++ /dev/null
@@ -1,75 +0,0 @@
-(function() {
- var CoffeeScript, runScripts;
- CoffeeScript = require('./coffee-script');
- CoffeeScript.require = require;
- CoffeeScript.eval = function(code, options) {
- return eval(CoffeeScript.compile(code, options));
- };
- CoffeeScript.run = function(code, options) {
- if (options == null) {
- options = {};
- }
- options.bare = true;
- return Function(CoffeeScript.compile(code, options))();
- };
- if (typeof window === "undefined" || window === null) {
- return;
- }
- CoffeeScript.load = function(url, callback) {
- var xhr;
- xhr = new (window.ActiveXObject || XMLHttpRequest)('Microsoft.XMLHTTP');
- xhr.open('GET', url, true);
- if ('overrideMimeType' in xhr) {
- xhr.overrideMimeType('text/plain');
- }
- xhr.onreadystatechange = function() {
- var _ref;
- if (xhr.readyState === 4) {
- if ((_ref = xhr.status) === 0 || _ref === 200) {
- CoffeeScript.run(xhr.responseText);
- } else {
- throw new Error("Could not load " + url);
- }
- if (callback) {
- return callback();
- }
- }
- };
- return xhr.send(null);
- };
- runScripts = function() {
- var coffees, execute, index, length, s, scripts;
- scripts = document.getElementsByTagName('script');
- coffees = (function() {
- var _i, _len, _results;
- _results = [];
- for (_i = 0, _len = scripts.length; _i < _len; _i++) {
- s = scripts[_i];
- if (s.type === 'text/coffeescript') {
- _results.push(s);
- }
- }
- return _results;
- })();
- index = 0;
- length = coffees.length;
- (execute = function() {
- var script;
- script = coffees[index++];
- if ((script != null ? script.type : void 0) === 'text/coffeescript') {
- if (script.src) {
- return CoffeeScript.load(script.src, execute);
- } else {
- CoffeeScript.run(script.innerHTML);
- return execute();
- }
- }
- })();
- return null;
- };
- if (window.addEventListener) {
- addEventListener('DOMContentLoaded', runScripts, false);
- } else {
- attachEvent('onload', runScripts);
- }
-}).call(this);