mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
better naming by @michaelficarra
This commit is contained in:
@@ -1,30 +1,26 @@
|
||||
// Generated by CoffeeScript 1.6.1
|
||||
(function() {
|
||||
var CoffeeScript, compile, isModernBrowser, runScripts,
|
||||
var CoffeeScript, canGenerateDataUris, 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;
|
||||
|
||||
isModernBrowser = typeof window !== "undefined" && window !== null ? function() {
|
||||
if (btoa && JSON) {
|
||||
return true;
|
||||
}
|
||||
} : function() {};
|
||||
canGenerateDataUris = (typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null);
|
||||
|
||||
compile = function(code, options) {
|
||||
var answer, js, res, v3SourceMap, _ref;
|
||||
var base64SourceMap, js, res, v3SourceMap, _ref;
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
res = void 0;
|
||||
if (isModernBrowser()) {
|
||||
if (canGenerateDataUris) {
|
||||
options.sourceMap = true;
|
||||
options.inline = true;
|
||||
_ref = CoffeeScript.compile(code, options), js = _ref.js, v3SourceMap = _ref.v3SourceMap;
|
||||
answer = btoa(v3SourceMap);
|
||||
res = "" + js + "\n//@ sourceMappingURL=data:application/json;base64," + answer + "\n//@ sourceURL=coffeescript";
|
||||
base64SourceMap = btoa(v3SourceMap);
|
||||
res = "" + js + "\n//@ sourceMappingURL=data:application/json;base64," + base64SourceMap + "\n//@ sourceURL=coffeescript";
|
||||
} else {
|
||||
res = CoffeeScript.compile(code, options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user