Socket
Socket
Sign inDemoInstall

coffeescript

Package Overview
Dependencies
Maintainers
3
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coffeescript - npm Package Compare versions

Comparing version 1.6.2 to 1.6.3

25

lib/coffee-script/browser.js

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.3
(function() {

@@ -13,8 +13,6 @@ var CoffeeScript, compile, runScripts,

CoffeeScript["eval"] = function(code, options) {
var _ref;
if (options == null) {
options = {};
}
if ((_ref = options.bare) == null) {
if (options.bare == null) {
options.bare = true;

@@ -30,2 +28,3 @@ }

options.bare = true;
options.shiftLine = true;
return Function(compile(code, options))();

@@ -38,6 +37,5 @@ };

if ((typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null)) {
if ((typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null) && (typeof unescape !== "undefined" && unescape !== null) && (typeof encodeURIComponent !== "undefined" && encodeURIComponent !== null)) {
compile = function(code, options) {
var js, v3SourceMap, _ref;
if (options == null) {

@@ -49,3 +47,3 @@ options = {};

_ref = CoffeeScript.compile(code, options), js = _ref.js, v3SourceMap = _ref.v3SourceMap;
return "" + js + "\n//@ sourceMappingURL=data:application/json;base64," + (btoa(v3SourceMap)) + "\n//@ sourceURL=coffeescript";
return "" + js + "\n//@ sourceMappingURL=data:application/json;base64," + (btoa(unescape(encodeURIComponent(v3SourceMap)))) + "\n//@ sourceURL=coffeescript";
};

@@ -56,3 +54,2 @@ }

var xhr;
if (options == null) {

@@ -62,3 +59,3 @@ options = {};

options.sourceFiles = [url];
xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest();
xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new window.XMLHttpRequest();
xhr.open('GET', url, true);

@@ -70,3 +67,2 @@ if ('overrideMimeType' in xhr) {

var _ref;
if (xhr.readyState === 4) {

@@ -88,8 +84,6 @@ if ((_ref = xhr.status) === 0 || _ref === 200) {

var coffees, coffeetypes, execute, index, length, s, scripts;
scripts = document.getElementsByTagName('script');
scripts = window.document.getElementsByTagName('script');
coffeetypes = ['text/coffeescript', 'text/literate-coffeescript'];
coffees = (function() {
var _i, _len, _ref, _results;
_results = [];

@@ -108,3 +102,2 @@ for (_i = 0, _len = scripts.length; _i < _len; _i++) {

var mediatype, options, script;
script = coffees[index++];

@@ -129,7 +122,7 @@ mediatype = script != null ? script.type : void 0;

if (window.addEventListener) {
addEventListener('DOMContentLoaded', runScripts, false);
window.addEventListener('DOMContentLoaded', runScripts, false);
} else {
attachEvent('onload', runScripts);
window.attachEvent('onload', runScripts);
}
}).call(this);

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.3
(function() {

@@ -28,3 +28,2 @@ var CoffeeScript, cakefileDirectory, existsSync, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks;

var _ref;
if (!action) {

@@ -52,3 +51,2 @@ _ref = [description, action], action = _ref[0], description = _ref[1];

var arg, args, e, _i, _len, _ref, _results;
global.__originalDirname = fs.realpathSync('.');

@@ -81,3 +79,2 @@ process.chdir(cakefileDirectory(__originalDirname));

var cakefilePath, desc, name, relative, spaces, task;
relative = path.relative || path.resolve;

@@ -110,3 +107,2 @@ cakefilePath = path.join(relative(__originalDirname, process.cwd()), 'Cakefile');

var parent;
if (existsSync(path.join(dir, 'Cakefile'))) {

@@ -113,0 +109,0 @@ return dir;

@@ -1,4 +0,4 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.3
(function() {
var Lexer, child_process, compile, ext, fork, formatSourcePosition, fs, helpers, lexer, loadFile, parser, patchStackTrace, patched, path, sourcemap, vm, _i, _len, _ref,
var Lexer, Module, SourceMap, child_process, compile, ext, findExtension, fork, formatSourcePosition, fs, helpers, lexer, loadFile, parser, patchStackTrace, patched, path, sourceMaps, vm, _i, _len, _ref,
__hasProp = {}.hasOwnProperty;

@@ -20,5 +20,5 @@

sourcemap = require('./sourcemap');
SourceMap = require('./sourcemap');
exports.VERSION = '1.6.2';
exports.VERSION = '1.6.3';

@@ -28,16 +28,18 @@ exports.helpers = helpers;

exports.compile = compile = function(code, options) {
var answer, currentColumn, currentLine, fragment, fragments, header, js, merge, newLines, sourceMap, _i, _len;
var answer, currentColumn, currentLine, fragment, fragments, header, js, map, merge, newLines, _i, _len;
if (options == null) {
options = {};
}
merge = exports.helpers.merge;
merge = helpers.merge;
if (options.sourceMap) {
sourceMap = new sourcemap.SourceMap();
map = new SourceMap;
}
fragments = (parser.parse(lexer.tokenize(code, options))).compileToFragments(options);
fragments = parser.parse(lexer.tokenize(code, options)).compileToFragments(options);
currentLine = 0;
if (options.header || options.inline) {
if (options.header) {
currentLine += 1;
}
if (options.shiftLine) {
currentLine += 1;
}
currentColumn = 0;

@@ -47,5 +49,5 @@ js = "";

fragment = fragments[_i];
if (sourceMap) {
if (options.sourceMap) {
if (fragment.locationData) {
sourceMap.addMapping([fragment.locationData.first_line, fragment.locationData.first_column], [currentLine, currentColumn], {
map.add([fragment.locationData.first_line, fragment.locationData.first_column], [currentLine, currentColumn], {
noReplace: true

@@ -68,6 +70,4 @@ });

};
if (sourceMap) {
answer.sourceMap = sourceMap;
answer.v3SourceMap = sourcemap.generateV3SourceMap(sourceMap, options, code);
}
answer.sourceMap = map;
answer.v3SourceMap = map.generate(options, code);
return answer;

@@ -92,4 +92,3 @@ } else {

exports.run = function(code, options) {
var answer, mainModule, _ref;
var answer, mainModule;
if (options == null) {

@@ -99,3 +98,3 @@ options = {};

mainModule = require.main;
if ((_ref = options.sourceMap) == null) {
if (options.sourceMap == null) {
options.sourceMap = true;

@@ -109,3 +108,3 @@ }

patchStackTrace();
mainModule._sourceMaps[mainModule.filename] = answer.sourceMap;
sourceMaps[mainModule.filename] = answer.sourceMap;
return mainModule._compile(answer.js, mainModule.filename);

@@ -119,3 +118,2 @@ } else {

var Module, Script, js, k, o, r, sandbox, v, _i, _len, _module, _ref, _ref1, _require;
if (options == null) {

@@ -183,10 +181,12 @@ options = {};

loadFile = function(module, filename) {
var raw, stripped;
var answer, raw, stripped;
raw = fs.readFileSync(filename, 'utf8');
stripped = raw.charCodeAt(0) === 0xFEFF ? raw.substring(1) : raw;
return module._compile(compile(stripped, {
answer = compile(stripped, {
filename: filename,
sourceMap: true,
literate: helpers.isLiterate(filename)
}), filename);
});
sourceMaps[filename] = answer.sourceMap;
return module._compile(answer.js, filename);
};

@@ -200,2 +200,25 @@

}
Module = require('module');
findExtension = function(filename) {
var curExtension, extensions;
extensions = path.basename(filename).split('.');
if (extensions[0] === '') {
extensions.shift();
}
while (extensions.shift()) {
curExtension = '.' + extensions.join('.');
if (Module._extensions[curExtension]) {
return curExtension;
}
}
return '.js';
};
Module.prototype.load = function(filename) {
var extension;
this.filename = filename;
this.paths = Module._nodeModulePaths(path.dirname(filename));
extension = findExtension(filename);
Module._extensions[extension](this, filename);
return this.loaded = true;
};
}

@@ -207,3 +230,2 @@

var execPath;
if (args == null) {

@@ -230,3 +252,2 @@ args = [];

var tag, token;
token = this.tokens[this.pos++];

@@ -254,3 +275,2 @@ if (token) {

var token;
token = _arg.token;

@@ -263,5 +283,6 @@ message = "unexpected " + (token === 1 ? 'end of input' : token);

sourceMaps = {};
patchStackTrace = function() {
var mainModule;
if (patched) {

@@ -272,13 +293,10 @@ return;

mainModule = require.main;
mainModule._sourceMaps = {};
return Error.prepareStackTrace = function(err, stack) {
var frame, frames, getSourceMapping, sourceFiles, _ref1;
sourceFiles = {};
getSourceMapping = function(filename, line, column) {
var answer, sourceMap;
sourceMap = mainModule._sourceMaps[filename];
sourceMap = sourceMaps[filename];
if (sourceMap) {
answer = sourceMap.getSourcePosition([line - 1, column - 1]);
answer = sourceMap.sourceLocation([line - 1, column - 1]);
}

@@ -293,3 +311,2 @@ if (answer) {

var _j, _len1, _results;
_results = [];

@@ -311,3 +328,2 @@ for (_j = 0, _len1 = stack.length; _j < _len1; _j++) {

var as, column, fileLocation, fileName, functionName, isConstructor, isMethodCall, line, methodName, source, tp, typeName;
fileName = void 0;

@@ -314,0 +330,0 @@ fileLocation = '';

@@ -1,4 +0,4 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.3
(function() {
var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, exists, forkNode, fs, helpers, hidden, joinTimeout, lint, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, sourceCode, sources, spawn, timeLog, unwatchDir, usage, version, wait, watch, watchDir, watchers, writeJs, _ref;
var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, exists, forkNode, fs, helpers, hidden, joinTimeout, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, sourceCode, sources, spawn, timeLog, unwatchDir, usage, useWinPathSep, version, wait, watch, watchDir, watchers, writeJs, _ref;

@@ -21,2 +21,4 @@ fs = require('fs');

useWinPathSep = path.sep === '\\';
helpers.extend(CoffeeScript, new EventEmitter);

@@ -38,3 +40,3 @@

SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-l', '--lint', 'pipe the compiled JavaScript through JavaScript Lint'], ['-m', '--map', 'generate source map and save as .map files'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']];
SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-m', '--map', 'generate source map and save as .map files'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-l', '--literate', 'treat stdio as literate style coffee-script'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']];

@@ -55,3 +57,2 @@ opts = {};

var literals, source, _i, _len, _results;
parseOptions();

@@ -108,3 +109,2 @@ if (opts.nodejs) {

var file, index, _ref1, _ref2;
if (err && err.code !== 'ENOENT') {

@@ -122,3 +122,2 @@ throw err;

var _i, _len, _results;
_results = [];

@@ -160,3 +159,2 @@ for (_i = 0, _len = files.length; _i < _len; _i++) {

var compiled, err, message, o, options, t, task, useColors;
if (base == null) {

@@ -198,4 +196,2 @@ base = null;

return writeJs(base, t.file, t.output, options.jsPath, t.sourceMap);
} else if (o.lint) {
return lint(t.file, t.output);
}

@@ -222,3 +218,2 @@ }

var code, stdin;
code = '';

@@ -254,3 +249,2 @@ stdin = process.openStdin();

var compile, compileTimeout, e, prevStats, rewatch, watchErr, watcher;
prevStats = null;

@@ -312,3 +306,2 @@ compileTimeout = null;

var e, readdirTimeout, watcher;
readdirTimeout = null;

@@ -321,3 +314,2 @@ try {

var file, _i, _len, _results;
if (err) {

@@ -360,7 +352,5 @@ if (err.code !== 'ENOENT') {

var file, prevSources, toRemove, _i, _len;
prevSources = sources.slice(0);
toRemove = (function() {
var _i, _len, _results;
_results = [];

@@ -389,3 +379,2 @@ for (_i = 0, _len = sources.length; _i < _len; _i++) {

var index, jsPath;
index = sources.indexOf(source);

@@ -411,7 +400,6 @@ sources.splice(index, 1);

var baseDir, basename, dir, srcDir;
if (extension == null) {
extension = ".js";
}
basename = helpers.baseFileName(source, true, path.sep);
basename = helpers.baseFileName(source, true, useWinPathSep);
srcDir = path.dirname(source);

@@ -425,3 +413,2 @@ baseDir = base === '.' ? srcDir : srcDir.substring(base.length);

var compile, jsDir, sourceMapPath;
if (generatedSourceMap == null) {

@@ -438,3 +425,3 @@ generatedSourceMap = null;

if (generatedSourceMap) {
js = "" + js + "\n/*\n//@ sourceMappingURL=" + (helpers.baseFileName(sourceMapPath, false, path.sep)) + "\n*/\n";
js = "" + js + "\n/*\n//@ sourceMappingURL=" + (helpers.baseFileName(sourceMapPath, false, useWinPathSep)) + "\n*/\n";
}

@@ -474,22 +461,6 @@ fs.writeFile(jsPath, js, function(err) {

lint = function(file, js) {
var conf, jsl, printIt;
printIt = function(buffer) {
return printLine(file + ':\t' + buffer.toString().trim());
};
conf = __dirname + '/../../extras/jsl.conf';
jsl = spawn('jsl', ['-nologo', '-stdin', '-conf', conf]);
jsl.stdout.on('data', printIt);
jsl.stderr.on('data', printIt);
jsl.stdin.write(js);
return jsl.stdin.end();
};
printTokens = function(tokens) {
var strings, tag, token, value;
strings = (function() {
var _i, _len, _results;
_results = [];

@@ -509,7 +480,6 @@ for (_i = 0, _len = tokens.length; _i < _len; _i++) {

var i, o, source, _i, _len;
optionParser = new optparse.OptionParser(SWITCHES, BANNER);
o = opts = optionParser.parse(process.argv.slice(2));
o.compile || (o.compile = !!o.output);
o.run = !(o.compile || o.print || o.lint || o.map);
o.run = !(o.compile || o.print || o.map);
o.print = !!(o.print || (o["eval"] || o.stdio && o.compile));

@@ -525,6 +495,5 @@ sources = o["arguments"];

var answer, cwd, jsDir, jsPath;
answer = {
filename: filename,
literate: helpers.isLiterate(filename),
literate: opts.literate || helpers.isLiterate(filename),
bare: opts.bare,

@@ -543,3 +512,3 @@ header: opts.compile,

sourceFiles: [path.relative(cwd, filename)],
generatedFile: helpers.baseFileName(jsPath, false, path.sep)
generatedFile: helpers.baseFileName(jsPath, false, useWinPathSep)
});

@@ -549,4 +518,4 @@ } else {

sourceRoot: "",
sourceFiles: [helpers.baseFileName(filename, false, path.sep)],
generatedFile: helpers.baseFileName(filename, true, path.sep) + ".js"
sourceFiles: [helpers.baseFileName(filename, false, useWinPathSep)],
generatedFile: helpers.baseFileName(filename, true, useWinPathSep) + ".js"
});

@@ -560,3 +529,2 @@ }

var args, nodeArgs;
nodeArgs = opts.nodejs.split(/\s+/);

@@ -563,0 +531,0 @@ args = process.argv.slice(1);

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.3
(function() {

@@ -11,3 +11,2 @@ var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap;

var addLocationDataFn, match, patternCount;
patternString = patternString.replace(/\s{2,}/g, ' ');

@@ -355,2 +354,4 @@ patternCount = patternString.split(' ').length;

return [LOC(2)(new Value($2)), $3];
}), o('CATCH Block', function() {
return [null, $2];
})

@@ -600,3 +601,2 @@ ],

var _i, _j, _len, _len1, _ref, _results;
_results = [];

@@ -603,0 +603,0 @@ for (_i = 0, _len = alternatives.length; _i < _len; _i++) {

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.3
(function() {

@@ -11,3 +11,2 @@ var buildLocationData, extend, flatten, last, repeat, _ref;

var len;
len = literal.length;

@@ -19,3 +18,2 @@ return literal === string.substr(string.length - len - (back || 0), len);

var res;
res = '';

@@ -34,3 +32,2 @@ while (n > 0) {

var item, _i, _len, _results;
_results = [];

@@ -48,3 +45,2 @@ for (_i = 0, _len = array.length; _i < _len; _i++) {

var num, pos;
num = pos = 0;

@@ -66,3 +62,2 @@ if (!substr.length) {

var key, val;
for (key in properties) {

@@ -77,3 +72,2 @@ val = properties[key];

var element, flattened, _i, _len;
flattened = [];

@@ -93,3 +87,2 @@ for (_i = 0, _len = array.length; _i < _len; _i++) {

var val;
val = obj[key];

@@ -106,3 +99,2 @@ delete obj[key];

var e, _i, _len;
for (_i = 0, _len = this.length; _i < _len; _i++) {

@@ -119,7 +111,5 @@ e = this[_i];

var line, lines, maybe_code;
maybe_code = true;
lines = (function() {
var _i, _len, _ref1, _results;
_ref1 = code.split('\n');

@@ -166,3 +156,2 @@ _results = [];

var locationData;
if (("2" in obj) && ("first_line" in obj[2])) {

@@ -180,11 +169,11 @@ locationData = obj[2];

exports.baseFileName = function(file, stripExt, pathSep) {
var parts;
exports.baseFileName = function(file, stripExt, useWinPathSep) {
var parts, pathSep;
if (stripExt == null) {
stripExt = false;
}
if (pathSep == null) {
pathSep = '/';
if (useWinPathSep == null) {
useWinPathSep = false;
}
pathSep = useWinPathSep ? /\\|\// : /\//;
parts = file.split(pathSep);

@@ -212,8 +201,7 @@ file = parts[parts.length - 1];

exports.throwSyntaxError = function(message, location) {
var error, _ref1, _ref2;
if ((_ref1 = location.last_line) == null) {
var error;
if (location.last_line == null) {
location.last_line = location.first_line;
}
if ((_ref2 = location.last_column) == null) {
if (location.last_column == null) {
location.last_column = location.first_column;

@@ -228,3 +216,2 @@ }

var codeLine, colorize, end, first_column, first_line, last_column, last_line, marker, message, start, _ref1;
if (!error.location) {

@@ -231,0 +218,0 @@ return error.stack || ("" + error);

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.3
(function() {

@@ -3,0 +3,0 @@ var key, val, _ref;

@@ -1,4 +0,4 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.3
(function() {
var BOM, BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDEXABLE, INVERSES, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LINE_BREAK, LINE_CONTINUER, LOGIC, Lexer, MATH, MULTILINER, MULTI_DENT, NOT_REGEX, NOT_SPACED_REGEX, NUMBER, OPERATOR, REGEX, RELATION, RESERVED, Rewriter, SHIFT, SIMPLESTR, STRICT_PROSCRIBED, TRAILING_SPACES, UNARY, WHITESPACE, compact, count, invertLiterate, key, last, locationDataToString, starts, throwSyntaxError, _ref, _ref1,
var BOM, BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDEXABLE, INVERSES, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LINE_BREAK, LINE_CONTINUER, LOGIC, Lexer, MATH, MULTILINER, MULTI_DENT, NOT_REGEX, NOT_SPACED_REGEX, NUMBER, OPERATOR, REGEX, RELATION, RESERVED, Rewriter, SHIFT, SIMPLESTR, STRICT_PROSCRIBED, TRAILING_SPACES, UNARY, WHITESPACE, compact, count, invertLiterate, key, last, locationDataToString, repeat, starts, throwSyntaxError, _ref, _ref1,
__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; };

@@ -8,3 +8,3 @@

_ref1 = require('./helpers'), count = _ref1.count, starts = _ref1.starts, compact = _ref1.compact, last = _ref1.last, invertLiterate = _ref1.invertLiterate, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError;
_ref1 = require('./helpers'), count = _ref1.count, starts = _ref1.starts, compact = _ref1.compact, last = _ref1.last, repeat = _ref1.repeat, invertLiterate = _ref1.invertLiterate, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError;

@@ -16,3 +16,2 @@ exports.Lexer = Lexer = (function() {

var consumed, i, tag, _ref2;
if (opts == null) {

@@ -64,3 +63,2 @@ opts = {};

var colon, colonOffset, forcedIdentifier, id, idLength, input, match, poppedToken, prev, tag, tagToken, _ref2, _ref3, _ref4;
if (!(match = IDENTIFIER.exec(this.chunk))) {

@@ -148,3 +146,2 @@ return 0;

var binaryLiteral, lexedLength, match, number, octalLiteral;
if (!(match = NUMBER.exec(this.chunk))) {

@@ -165,6 +162,6 @@ return 0;

if (octalLiteral = /^0o([0-7]+)/.exec(number)) {
number = '0x' + (parseInt(octalLiteral[1], 8)).toString(16);
number = '0x' + parseInt(octalLiteral[1], 8).toString(16);
}
if (binaryLiteral = /^0b([01]+)/.exec(number)) {
number = '0x' + (parseInt(binaryLiteral[1], 2)).toString(16);
number = '0x' + parseInt(binaryLiteral[1], 2).toString(16);
}

@@ -177,3 +174,2 @@ this.token('NUMBER', number, 0, lexedLength);

var match, octalEsc, string;
switch (this.chunk.charAt(0)) {

@@ -211,3 +207,2 @@ case "'":

var doc, heredoc, match, quote;
if (!(match = HEREDOC.exec(this.chunk))) {

@@ -236,3 +231,2 @@ return 0;

var comment, here, match;
if (!(match = this.chunk.match(COMMENT))) {

@@ -245,3 +239,3 @@ return 0;

herecomment: true,
indent: Array(this.indent + 1).join(' ')
indent: repeat(' ', this.indent)
}), 0, comment.length);

@@ -254,3 +248,2 @@ }

var match, script;
if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) {

@@ -265,3 +258,2 @@ return 0;

var flags, length, match, prev, regex, _ref2, _ref3;
if (this.chunk.charAt(0) !== '/') {

@@ -294,3 +286,2 @@ return 0;

var body, flags, flagsOffset, heregex, plusToken, prev, re, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4;
heregex = match[0], body = match[1], flags = match[2];

@@ -349,3 +340,2 @@ if (0 > body.indexOf('#{')) {

var diff, indent, match, noNewlines, size;
if (!(match = MULTI_DENT.exec(this.chunk))) {

@@ -387,3 +377,2 @@ return 0;

var dent, len;
while (moveOut > 0) {

@@ -421,3 +410,2 @@ len = this.indents.length - 1;

var match, nline, prev;
if (!((match = WHITESPACE.exec(this.chunk)) || (nline = this.chunk.charAt(0) === '\n'))) {

@@ -456,3 +444,2 @@ return 0;

var match, prev, tag, value, _ref2, _ref3, _ref4, _ref5;
if (match = OPERATOR.exec(this.chunk)) {

@@ -524,3 +511,2 @@ value = match[0];

var attempt, herecomment, indent, match, _ref2;
indent = options.indent, herecomment = options.herecomment;

@@ -553,3 +539,2 @@ if (herecomment) {

var i, stack, tok, tokens;
if (this.tag() !== ')') {

@@ -588,3 +573,2 @@ return this;

var continueCount, i, letter, match, prev, stack, _i, _ref2;
continueCount = 0;

@@ -625,3 +609,2 @@ stack = [end];

var column, expr, heredoc, i, inner, interpolated, len, letter, lexedLength, line, locationToken, nested, offsetInChunk, pi, plusToken, popped, regex, rparen, strOffset, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4;
if (options == null) {

@@ -725,3 +708,2 @@ options = {};

var size, wanted;
if (tag !== (wanted = last(this.ends))) {

@@ -740,3 +722,2 @@ if ('OUTDENT' !== wanted) {

var column, lineCount, lines, string;
if (offset === 0) {

@@ -754,3 +735,3 @@ return [this.chunkLine, this.chunkColumn];

lines = string.split('\n');
column = (last(lines)).length;
column = last(lines).length;
} else {

@@ -764,3 +745,2 @@ column += string.length;

var lastCharacter, locationData, token, _ref2, _ref3;
if (offsetInChunk == null) {

@@ -782,3 +762,2 @@ offsetInChunk = 0;

var token;
token = this.makeToken(tag, value, offsetInChunk, length);

@@ -791,3 +770,2 @@ this.tokens.push(token);

var tok;
return (tok = last(this.tokens, index)) && (tag ? tok[0] = tag : tok[0]);

@@ -798,3 +776,2 @@ };

var tok;
return (tok = last(this.tokens, index)) && (val ? tok[1] = val : tok[1]);

@@ -805,3 +782,2 @@ };

var _ref2;
return LINE_CONTINUER.test(this.chunk) || ((_ref2 = this.tag()) === '\\' || _ref2 === '.' || _ref2 === '?.' || _ref2 === '?::' || _ref2 === 'UNARY' || _ref2 === 'MATH' || _ref2 === '+' || _ref2 === '-' || _ref2 === 'SHIFT' || _ref2 === 'RELATION' || _ref2 === 'COMPARE' || _ref2 === 'LOGIC' || _ref2 === 'THROW' || _ref2 === 'EXTENDS');

@@ -858,3 +834,2 @@ };

var _results;
_results = [];

@@ -933,5 +908,5 @@ for (key in COFFEE_ALIAS_MAP) {

NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--', ']'];
NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--'];
NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING');
NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING', ']');

@@ -938,0 +913,0 @@ CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER'];

@@ -1,5 +0,7 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.3
(function() {
var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments;
var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments, repeat;
repeat = require('./helpers').repeat;
exports.OptionParser = OptionParser = (function() {

@@ -13,3 +15,2 @@ function OptionParser(rules, banner) {

var arg, i, isOption, matchedRule, options, originalArgs, pos, rule, seenNonOptionArg, skippingArgument, value, _i, _j, _len, _len1, _ref;
options = {

@@ -63,3 +64,2 @@ "arguments": []

var letPart, lines, rule, spaces, _i, _len, _ref;
lines = [];

@@ -73,3 +73,3 @@ if (this.banner) {

spaces = 15 - rule.longFlag.length;
spaces = spaces > 0 ? Array(spaces + 1).join(' ') : '';
spaces = spaces > 0 ? repeat(' ', spaces) : '';
letPart = rule.shortFlag ? rule.shortFlag + ', ' : ' ';

@@ -95,3 +95,2 @@ lines.push(' ' + letPart + rule.longFlag + spaces + rule.description);

var tuple, _i, _len, _results;
_results = [];

@@ -110,3 +109,2 @@ for (_i = 0, _len = rules.length; _i < _len; _i++) {

var match;
if (options == null) {

@@ -129,3 +127,2 @@ options = {};

var arg, l, match, result, _i, _j, _len, _len1, _ref;
args = args.slice(0);

@@ -132,0 +129,0 @@ result = [];

@@ -1,5 +0,9 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.3
(function() {
var CoffeeScript, addMultilineHandler, merge, nodeREPL, prettyErrorMessage, replDefaults, vm, _ref;
var CoffeeScript, addHistory, addMultilineHandler, fs, merge, nodeREPL, path, prettyErrorMessage, replDefaults, vm, _ref;
fs = require('fs');
path = require('path');
vm = require('vm');

@@ -15,5 +19,6 @@

prompt: 'coffee> ',
historyFile: process.env.HOME ? path.join(process.env.HOME, '.coffee_history') : void 0,
historyMaxInputSize: 10240,
"eval": function(input, context, filename, cb) {
var Assign, Block, Literal, Value, ast, err, js, _ref1;
input = input.replace(/\uFF00/g, '\n');

@@ -39,3 +44,2 @@ input = input.replace(/^\(([\s\S]*)\n\)$/m, '$1');

var inputStream, multiline, nodeLineListener, outputStream, rli;
rli = repl.rli, inputStream = repl.inputStream, outputStream = repl.outputStream;

@@ -93,6 +97,43 @@ multiline = {

addHistory = function(repl, filename, maxSize) {
var buffer, fd, lastLine, readFd, size, stat;
lastLine = null;
try {
stat = fs.statSync(filename);
size = Math.min(maxSize, stat.size);
readFd = fs.openSync(filename, 'r');
buffer = new Buffer(size);
fs.readSync(readFd, buffer, 0, size, stat.size - size);
repl.rli.history = buffer.toString().split('\n').reverse();
if (stat.size > maxSize) {
repl.rli.history.pop();
}
if (repl.rli.history[0] === '') {
repl.rli.history.shift();
}
repl.rli.historyIndex = -1;
lastLine = repl.rli.history[0];
} catch (_error) {}
fd = fs.openSync(filename, 'a');
repl.rli.addListener('line', function(code) {
if (code && code.length && code !== '.history' && lastLine !== code) {
fs.write(fd, "" + code + "\n");
return lastLine = code;
}
});
repl.rli.on('exit', function() {
return fs.close(fd);
});
return repl.commands['.history'] = {
help: 'Show command history',
action: function() {
repl.outputStream.write("" + (repl.rli.history.slice(0).reverse().join('\n')) + "\n");
return repl.displayPrompt();
}
};
};
module.exports = {
start: function(opts) {
var build, major, minor, repl, _ref1;
if (opts == null) {

@@ -114,2 +155,5 @@ opts = {};

addMultilineHandler(repl);
if (opts.historyFile) {
addHistory(repl, opts.historyFile, opts.historyMaxInputSize);
}
return repl;

@@ -116,0 +160,0 @@ }

@@ -1,4 +0,4 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.3
(function() {
var BALANCED_PAIRS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_BLOCK, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, generate, left, rite, _i, _len, _ref,
var BALANCED_PAIRS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, generate, left, rite, _i, _len, _ref,
__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; },

@@ -9,3 +9,2 @@ __slice = [].slice;

var tok;
tok = [tag, value];

@@ -34,3 +33,2 @@ tok.generated = true;

var i, token, tokens;
tokens = this.tokens;

@@ -46,3 +44,2 @@ i = 0;

var levels, token, tokens, _ref, _ref1;
tokens = this.tokens;

@@ -69,3 +66,2 @@ levels = 0;

var i, tag, _i, _len, _ref;
_ref = this.tokens;

@@ -86,3 +82,2 @@ for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {

var _ref;
if (!(token[0] === 'TERMINATOR' && (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0))) {

@@ -98,6 +93,4 @@ return 1;

var action, condition;
condition = function(token, i) {
var _ref;
return ((_ref = token[0]) === ')' || _ref === 'CALL_END') || token[0] === 'OUTDENT' && this.tag(i - 1) === ')';

@@ -118,6 +111,4 @@ };

var action, condition;
condition = function(token, i) {
var _ref;
return (_ref = token[0]) === ']' || _ref === 'INDEX_END';

@@ -138,3 +129,2 @@ };

var fuzz, i, j, pattern, _i, _ref, _ref1;
i = arguments[0], pattern = 2 <= arguments.length ? __slice.call(arguments, 1) : [];

@@ -165,3 +155,2 @@ fuzz = 0;

var backStack, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
backStack = [];

@@ -182,7 +171,5 @@ while (i >= 0 && (backStack.length || (_ref2 = this.tag(i), __indexOf.call(tags, _ref2) < 0) && ((_ref3 = this.tag(i), __indexOf.call(EXPRESSION_START, _ref3) < 0) || this.tokens[i].generated) && (_ref4 = this.tag(i), __indexOf.call(LINEBREAKS, _ref4) < 0))) {

var stack;
stack = [];
return this.scanTokens(function(token, i, tokens) {
var endImplicitCall, endImplicitObject, forward, inImplicit, inImplicitCall, inImplicitControl, inImplicitObject, nextTag, offset, prevTag, s, sameLine, stackIdx, stackTag, stackTop, startIdx, startImplicitCall, startImplicitObject, startsLine, tag, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
tag = token[0];

@@ -200,3 +187,2 @@ prevTag = (i > 0 ? tokens[i - 1] : [])[0];

var _ref, _ref1;
return (_ref = stackTop()) != null ? (_ref1 = _ref[2]) != null ? _ref1.ours : void 0 : void 0;

@@ -206,3 +192,2 @@ };

var _ref;
return inImplicit() && ((_ref = stackTop()) != null ? _ref[0] : void 0) === '(';

@@ -212,3 +197,2 @@ };

var _ref;
return inImplicit() && ((_ref = stackTop()) != null ? _ref[0] : void 0) === '{';

@@ -218,3 +202,2 @@ };

var _ref;
return inImplicit && ((_ref = stackTop()) != null ? _ref[0] : void 0) === 'CONTROL';

@@ -224,3 +207,2 @@ };

var idx;
idx = j != null ? j : i;

@@ -244,3 +226,2 @@ stack.push([

var idx;
if (startsLine == null) {

@@ -311,3 +292,3 @@ startsLine = true;

}
if (this.matchTags(i, IMPLICIT_FUNC, 'INDENT', null, ':') && !this.findTagsBackwards(i, ['CLASS', 'EXTENDS', 'IF', 'CATCH', 'SWITCH', 'LEADING_WHEN', 'FOR', 'WHILE', 'UNTIL'])) {
if (__indexOf.call(IMPLICIT_FUNC, tag) >= 0 && this.matchTags(i + 1, 'INDENT', null, ':') && !this.findTagsBackwards(i, ['CLASS', 'EXTENDS', 'IF', 'CATCH', 'SWITCH', 'LEADING_WHEN', 'FOR', 'WHILE', 'UNTIL'])) {
startImplicitCall(i + 1);

@@ -370,3 +351,2 @@ stack.push(['INDENT', i + 2]);

var column, line, nextLocation, prevLocation, _ref, _ref1;
if (token[2]) {

@@ -397,8 +377,6 @@ return 1;

var action, condition, indent, outdent, starter;
starter = indent = outdent = null;
condition = function(token, i) {
var _ref;
return token[1] !== ';' && (_ref = token[0], __indexOf.call(SINGLE_CLOSERS, _ref) >= 0) && !(token[0] === 'ELSE' && (starter !== 'IF' && starter !== 'THEN'));
var _ref, _ref1;
return token[1] !== ';' && (_ref = token[0], __indexOf.call(SINGLE_CLOSERS, _ref) >= 0) && !(token[0] === 'ELSE' && starter !== 'THEN') && !(((_ref1 = token[0]) === 'CATCH' || _ref1 === 'FINALLY') && (starter === '->' || starter === '=>'));
};

@@ -409,4 +387,3 @@ action = function(token, i) {

return this.scanTokens(function(token, i, tokens) {
var tag, _ref, _ref1;
var j, tag, _i, _ref, _ref1;
tag = token[0];

@@ -421,5 +398,10 @@ if (tag === 'TERMINATOR' && this.tag(i + 1) === 'THEN') {

}
if (tag === 'CATCH' && ((_ref = this.tag(i + 2)) === 'OUTDENT' || _ref === 'TERMINATOR' || _ref === 'FINALLY')) {
tokens.splice.apply(tokens, [i + 2, 0].concat(__slice.call(this.indentation())));
return 4;
if (tag === 'CATCH') {
for (j = _i = 1; _i <= 2; j = ++_i) {
if (!((_ref = this.tag(i + j)) === 'OUTDENT' || _ref === 'TERMINATOR' || _ref === 'FINALLY')) {
continue;
}
tokens.splice.apply(tokens, [i + j, 0].concat(__slice.call(this.indentation())));
return 2 + j;
}
}

@@ -445,7 +427,5 @@ if (__indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) {

var action, condition, original;
original = null;
condition = function(token, i) {
var prevTag, tag;
tag = token[0];

@@ -472,3 +452,2 @@ prevTag = this.tokens[i - 1][0];

var indent, outdent;
if (implicit == null) {

@@ -492,3 +471,2 @@ implicit = false;

var _ref;
return (_ref = this.tokens[i]) != null ? _ref[0] : void 0;

@@ -523,4 +501,2 @@ };

IMPLICIT_BLOCK = ['->', '=>', '{', '[', ','];
IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR'];

@@ -527,0 +503,0 @@

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.3
(function() {

@@ -42,3 +42,2 @@ var Scope, extend, last, _ref;

var _ref1;
if (((_ref1 = this.method) != null ? _ref1.name : void 0) || !this.parent) {

@@ -67,3 +66,2 @@ return this.method;

var _ref1;
return !!(this.type(name) || ((_ref1 = this.parent) != null ? _ref1.check(name) : void 0));

@@ -82,3 +80,2 @@ };

var v, _i, _len, _ref1;
_ref1 = this.variables;

@@ -96,3 +93,2 @@ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {

var index, temp;
if (reserve == null) {

@@ -125,3 +121,2 @@ reserve = true;

var realVars, tempVars, v, _i, _len, _ref1;
realVars = [];

@@ -141,3 +136,2 @@ tempVars = [];

var v, _i, _len, _ref1, _results;
_ref1 = this.variables;

@@ -144,0 +138,0 @@ _results = [];

@@ -1,15 +0,13 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.3
(function() {
var BASE64_CHARS, LineMapping, MAX_BASE64_VALUE, VLQ_CONTINUATION_BIT, VLQ_SHIFT, VLQ_VALUE_MASK, decodeBase64Char, encodeBase64Char;
var LineMap, SourceMap;
LineMapping = (function() {
function LineMapping(generatedLine) {
this.generatedLine = generatedLine;
this.columnMap = {};
this.columnMappings = [];
LineMap = (function() {
function LineMap(line) {
this.line = line;
this.columns = [];
}
LineMapping.prototype.addMapping = function(generatedColumn, _arg, options) {
LineMap.prototype.add = function(column, _arg, options) {
var sourceColumn, sourceLine;
sourceLine = _arg[0], sourceColumn = _arg[1];

@@ -19,231 +17,146 @@ if (options == null) {

}
if (this.columnMap[generatedColumn] && options.noReplace) {
if (this.columns[column] && options.noReplace) {
return;
}
this.columnMap[generatedColumn] = {
generatedLine: this.generatedLine,
generatedColumn: generatedColumn,
return this.columns[column] = {
line: this.line,
column: column,
sourceLine: sourceLine,
sourceColumn: sourceColumn
};
this.columnMappings.push(this.columnMap[generatedColumn]);
return this.columnMappings.sort(function(a, b) {
return a.generatedColumn - b.generatedColumn;
});
};
LineMapping.prototype.getSourcePosition = function(generatedColumn) {
var answer, columnMapping, lastColumnMapping, _i, _len, _ref;
answer = null;
lastColumnMapping = null;
_ref = this.columnMappings;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
columnMapping = _ref[_i];
if (columnMapping.generatedColumn > generatedColumn) {
break;
} else {
lastColumnMapping = columnMapping;
}
LineMap.prototype.sourceLocation = function(column) {
var mapping;
while (!((mapping = this.columns[column]) || (column <= 0))) {
column--;
}
if (lastColumnMapping) {
return answer = [lastColumnMapping.sourceLine, lastColumnMapping.sourceColumn];
}
return mapping && [mapping.sourceLine, mapping.sourceColumn];
};
return LineMapping;
return LineMap;
})();
exports.SourceMap = (function() {
SourceMap = (function() {
var BASE64_CHARS, VLQ_CONTINUATION_BIT, VLQ_SHIFT, VLQ_VALUE_MASK;
function SourceMap() {
this.generatedLines = [];
this.lines = [];
}
SourceMap.prototype.addMapping = function(sourceLocation, generatedLocation, options) {
var generatedColumn, generatedLine, lineMapping;
SourceMap.prototype.add = function(sourceLocation, generatedLocation, options) {
var column, line, lineMap, _base;
if (options == null) {
options = {};
}
generatedLine = generatedLocation[0], generatedColumn = generatedLocation[1];
lineMapping = this.generatedLines[generatedLine];
if (!lineMapping) {
lineMapping = this.generatedLines[generatedLine] = new LineMapping(generatedLine);
}
return lineMapping.addMapping(generatedColumn, sourceLocation, options);
line = generatedLocation[0], column = generatedLocation[1];
lineMap = ((_base = this.lines)[line] || (_base[line] = new LineMap(line)));
return lineMap.add(column, sourceLocation, options);
};
SourceMap.prototype.getSourcePosition = function(_arg) {
var answer, generatedColumn, generatedLine, lineMapping;
generatedLine = _arg[0], generatedColumn = _arg[1];
answer = null;
lineMapping = this.generatedLines[generatedLine];
if (!lineMapping) {
} else {
answer = lineMapping.getSourcePosition(generatedColumn);
SourceMap.prototype.sourceLocation = function(_arg) {
var column, line, lineMap;
line = _arg[0], column = _arg[1];
while (!((lineMap = this.lines[line]) || (line <= 0))) {
line--;
}
return answer;
return lineMap && lineMap.sourceLocation(column);
};
SourceMap.prototype.forEachMapping = function(fn) {
var columnMapping, generatedLineNumber, lineMapping, _i, _len, _ref, _results;
_ref = this.generatedLines;
_results = [];
for (generatedLineNumber = _i = 0, _len = _ref.length; _i < _len; generatedLineNumber = ++_i) {
lineMapping = _ref[generatedLineNumber];
if (lineMapping) {
_results.push((function() {
var _j, _len1, _ref1, _results1;
_ref1 = lineMapping.columnMappings;
_results1 = [];
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
columnMapping = _ref1[_j];
_results1.push(fn(columnMapping));
SourceMap.prototype.generate = function(options, code) {
var buffer, lastColumn, lastSourceColumn, lastSourceLine, lineMap, lineNumber, mapping, needComma, v3, writingline, _i, _j, _len, _len1, _ref, _ref1;
if (options == null) {
options = {};
}
if (code == null) {
code = null;
}
writingline = 0;
lastColumn = 0;
lastSourceLine = 0;
lastSourceColumn = 0;
needComma = false;
buffer = "";
_ref = this.lines;
for (lineNumber = _i = 0, _len = _ref.length; _i < _len; lineNumber = ++_i) {
lineMap = _ref[lineNumber];
if (lineMap) {
_ref1 = lineMap.columns;
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
mapping = _ref1[_j];
if (!(mapping)) {
continue;
}
return _results1;
})());
} else {
_results.push(void 0);
while (writingline < mapping.line) {
lastColumn = 0;
needComma = false;
buffer += ";";
writingline++;
}
if (needComma) {
buffer += ",";
needComma = false;
}
buffer += this.encodeVlq(mapping.column - lastColumn);
lastColumn = mapping.column;
buffer += this.encodeVlq(0);
buffer += this.encodeVlq(mapping.sourceLine - lastSourceLine);
lastSourceLine = mapping.sourceLine;
buffer += this.encodeVlq(mapping.sourceColumn - lastSourceColumn);
lastSourceColumn = mapping.sourceColumn;
needComma = true;
}
}
}
return _results;
v3 = {
version: 3,
file: options.generatedFile || '',
sourceRoot: options.sourceRoot || '',
sources: options.sourceFiles || [''],
names: [],
mappings: buffer
};
if (options.inline) {
v3.sourcesContent = [code];
}
return JSON.stringify(v3, null, 2);
};
return SourceMap;
VLQ_SHIFT = 5;
})();
VLQ_CONTINUATION_BIT = 1 << VLQ_SHIFT;
exports.generateV3SourceMap = function(sourceMap, options, code) {
var answer, generatedFile, lastGeneratedColumnWritten, lastSourceColumnWritten, lastSourceLineWritten, mappings, needComma, sourceFiles, sourceRoot, writingGeneratedLine;
VLQ_VALUE_MASK = VLQ_CONTINUATION_BIT - 1;
if (options == null) {
options = {};
}
sourceRoot = options.sourceRoot || "";
sourceFiles = options.sourceFiles || [""];
generatedFile = options.generatedFile || "";
writingGeneratedLine = 0;
lastGeneratedColumnWritten = 0;
lastSourceLineWritten = 0;
lastSourceColumnWritten = 0;
needComma = false;
mappings = "";
sourceMap.forEachMapping(function(mapping) {
while (writingGeneratedLine < mapping.generatedLine) {
lastGeneratedColumnWritten = 0;
needComma = false;
mappings += ";";
writingGeneratedLine++;
SourceMap.prototype.encodeVlq = function(value) {
var answer, nextChunk, signBit, valueToEncode;
answer = '';
signBit = value < 0 ? 1 : 0;
valueToEncode = (Math.abs(value) << 1) + signBit;
while (valueToEncode || !answer) {
nextChunk = valueToEncode & VLQ_VALUE_MASK;
valueToEncode = valueToEncode >> VLQ_SHIFT;
if (valueToEncode) {
nextChunk |= VLQ_CONTINUATION_BIT;
}
answer += this.encodeBase64(nextChunk);
}
if (needComma) {
mappings += ",";
needComma = false;
}
mappings += exports.vlqEncodeValue(mapping.generatedColumn - lastGeneratedColumnWritten);
lastGeneratedColumnWritten = mapping.generatedColumn;
mappings += exports.vlqEncodeValue(0);
mappings += exports.vlqEncodeValue(mapping.sourceLine - lastSourceLineWritten);
lastSourceLineWritten = mapping.sourceLine;
mappings += exports.vlqEncodeValue(mapping.sourceColumn - lastSourceColumnWritten);
lastSourceColumnWritten = mapping.sourceColumn;
return needComma = true;
});
answer = {
version: 3,
file: generatedFile,
sourceRoot: sourceRoot,
sources: sourceFiles,
names: [],
mappings: mappings
return answer;
};
if (options.inline) {
answer.sourcesContent = [code];
}
return JSON.stringify(answer, null, 2);
};
exports.loadV3SourceMap = function(sourceMap) {
return todo();
};
BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
SourceMap.prototype.encodeBase64 = function(value) {
return BASE64_CHARS[value] || (function() {
throw new Error("Cannot Base64 encode value: " + value);
})();
};
MAX_BASE64_VALUE = BASE64_CHARS.length - 1;
return SourceMap;
encodeBase64Char = function(value) {
if (value > MAX_BASE64_VALUE) {
throw new Error("Cannot encode value " + value + " > " + MAX_BASE64_VALUE);
} else if (value < 0) {
throw new Error("Cannot encode value " + value + " < 0");
}
return BASE64_CHARS[value];
};
})();
decodeBase64Char = function(char) {
var value;
module.exports = SourceMap;
value = BASE64_CHARS.indexOf(char);
if (value === -1) {
throw new Error("Invalid Base 64 character: " + char);
}
return value;
};
VLQ_SHIFT = 5;
VLQ_CONTINUATION_BIT = 1 << VLQ_SHIFT;
VLQ_VALUE_MASK = VLQ_CONTINUATION_BIT - 1;
exports.vlqEncodeValue = function(value) {
var answer, nextVlqChunk, signBit, valueToEncode;
signBit = value < 0 ? 1 : 0;
valueToEncode = (Math.abs(value) << 1) + signBit;
answer = "";
while (valueToEncode || !answer) {
nextVlqChunk = valueToEncode & VLQ_VALUE_MASK;
valueToEncode = valueToEncode >> VLQ_SHIFT;
if (valueToEncode) {
nextVlqChunk |= VLQ_CONTINUATION_BIT;
}
answer += encodeBase64Char(nextVlqChunk);
}
return answer;
};
exports.vlqDecodeValue = function(str, offset) {
var consumed, continuationShift, done, nextChunkValue, nextVlqChunk, position, signBit, value;
if (offset == null) {
offset = 0;
}
position = offset;
done = false;
value = 0;
continuationShift = 0;
while (!done) {
nextVlqChunk = decodeBase64Char(str[position]);
position += 1;
nextChunkValue = nextVlqChunk & VLQ_VALUE_MASK;
value += nextChunkValue << continuationShift;
if (!(nextVlqChunk & VLQ_CONTINUATION_BIT)) {
done = true;
}
continuationShift += VLQ_SHIFT;
}
consumed = position - offset;
signBit = value & 1;
value = value >> 1;
if (signBit) {
value = -value;
}
return [value, consumed];
};
}).call(this);

@@ -6,3 +6,3 @@ {

"author": "Jeremy Ashkenas",
"version": "1.6.2",
"version": "1.6.3",
"licenses": [{

@@ -9,0 +9,0 @@ "type": "MIT",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc