better naming by @michaelficarra

This commit is contained in:
Hao-kang Den
2013-03-18 10:23:33 +08:00
parent b2aa1798b1
commit 011d7dc245
2 changed files with 10 additions and 14 deletions

View File

@@ -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);
}