small stylistic change and optimisation to code from #2847

This commit is contained in:
Michael Ficarra
2013-03-17 21:49:49 -05:00
parent 2d6a856d61
commit 84c44c0099
2 changed files with 16 additions and 30 deletions

View File

@@ -1,31 +1,22 @@
// Generated by CoffeeScript 1.6.1
(function() {
var CoffeeScript, canGenerateDataUris, compile, runScripts,
var CoffeeScript, compile, runScripts,
__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; };
CoffeeScript = require('./coffee-script');
CoffeeScript.require = require;
canGenerateDataUris = (typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null);
compile = function(code, options) {
var base64SourceMap, js, res, v3SourceMap, _ref;
compile = (typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null) ? function(code, options) {
var js, v3SourceMap, _ref;
if (options == null) {
options = {};
}
res = void 0;
if (canGenerateDataUris) {
options.sourceMap = true;
options.inline = true;
_ref = CoffeeScript.compile(code, options), js = _ref.js, v3SourceMap = _ref.v3SourceMap;
base64SourceMap = btoa(v3SourceMap);
res = "" + js + "\n//@ sourceMappingURL=data:application/json;base64," + base64SourceMap + "\n//@ sourceURL=coffeescript";
} else {
res = CoffeeScript.compile(code, options);
}
return res;
};
options.sourceMap = true;
options.inline = true;
_ref = CoffeeScript.compile(code, options), js = _ref.js, v3SourceMap = _ref.v3SourceMap;
return "" + js + "\n//@ sourceMappingURL=data:application/json;base64," + (btoa(v3SourceMap)) + "\n//@ sourceURL=coffeescript";
} : CoffeeScript.compile;
CoffeeScript["eval"] = function(code, options) {
var _ref;