mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
small stylistic change and optimisation to code from #2847
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user