version 1.0.1
diff --git a/escodegen.browser.js b/escodegen.browser.js
new file mode 100644
index 0000000..c9e59e4
--- /dev/null
+++ b/escodegen.browser.js
@@ -0,0 +1,3872 @@
+// Generated by CommonJS Everywhere 0.8.1
+(function (global) {
+ function require(file, parentModule) {
+ if ({}.hasOwnProperty.call(require.cache, file))
+ return require.cache[file];
+ var resolved = require.resolve(file);
+ if (!resolved)
+ throw new Error('Failed to resolve module ' + file);
+ var module$ = {
+ id: file,
+ require: require,
+ filename: file,
+ exports: {},
+ loaded: false,
+ parent: parentModule,
+ children: []
+ };
+ if (parentModule)
+ parentModule.children.push(module$);
+ var dirname = file.slice(0, file.lastIndexOf('/') + 1);
+ require.cache[file] = module$.exports;
+ resolved.call(module$.exports, module$, module$.exports, dirname, file);
+ module$.loaded = true;
+ return require.cache[file] = module$.exports;
+ }
+ require.modules = {};
+ require.cache = {};
+ require.resolve = function (file) {
+ return {}.hasOwnProperty.call(require.modules, file) ? require.modules[file] : void 0;
+ };
+ require.define = function (file, fn) {
+ require.modules[file] = fn;
+ };
+ var process = function () {
+ var cwd = '/';
+ return {
+ title: 'browser',
+ version: 'v0.10.21',
+ browser: true,
+ env: {},
+ argv: [],
+ nextTick: global.setImmediate || function (fn) {
+ setTimeout(fn, 0);
+ },
+ cwd: function () {
+ return cwd;
+ },
+ chdir: function (dir) {
+ cwd = dir;
+ }
+ };
+ }();
+ require.define('/tools/entry-point.js', function (module, exports, __dirname, __filename) {
+ (function () {
+ 'use strict';
+ global.escodegen = require('/escodegen.js', module);
+ escodegen.browser = true;
+ }());
+ });
+ require.define('/escodegen.js', function (module, exports, __dirname, __filename) {
+ (function () {
+ 'use strict';
+ var Syntax, Precedence, BinaryPrecedence, SourceNode, estraverse, esutils, isArray, base, indent, json, renumber, hexadecimal, quotes, escapeless, newline, space, parentheses, semicolons, safeConcatenation, directive, extra, parse, sourceMap, FORMAT_MINIFY, FORMAT_DEFAULTS;
+ estraverse = require('/node_modules/estraverse/estraverse.js', module);
+ esutils = require('/node_modules/esutils/lib/utils.js', module);
+ Syntax = {
+ AssignmentExpression: 'AssignmentExpression',
+ ArrayExpression: 'ArrayExpression',
+ ArrayPattern: 'ArrayPattern',
+ ArrowFunctionExpression: 'ArrowFunctionExpression',
+ BlockStatement: 'BlockStatement',
+ BinaryExpression: 'BinaryExpression',
+ BreakStatement: 'BreakStatement',
+ CallExpression: 'CallExpression',
+ CatchClause: 'CatchClause',
+ ComprehensionBlock: 'ComprehensionBlock',
+ ComprehensionExpression: 'ComprehensionExpression',
+ ConditionalExpression: 'ConditionalExpression',
+ ContinueStatement: 'ContinueStatement',
+ DirectiveStatement: 'DirectiveStatement',
+ DoWhileStatement: 'DoWhileStatement',
+ DebuggerStatement: 'DebuggerStatement',
+ EmptyStatement: 'EmptyStatement',
+ ExpressionStatement: 'ExpressionStatement',
+ ForStatement: 'ForStatement',
+ ForInStatement: 'ForInStatement',
+ FunctionDeclaration: 'FunctionDeclaration',
+ FunctionExpression: 'FunctionExpression',
+ Identifier: 'Identifier',
+ IfStatement: 'IfStatement',
+ Literal: 'Literal',
+ LabeledStatement: 'LabeledStatement',
+ LogicalExpression: 'LogicalExpression',
+ MemberExpression: 'MemberExpression',
+ NewExpression: 'NewExpression',
+ ObjectExpression: 'ObjectExpression',
+ ObjectPattern: 'ObjectPattern',
+ Program: 'Program',
+ Property: 'Property',
+ ReturnStatement: 'ReturnStatement',
+ SequenceExpression: 'SequenceExpression',
+ SwitchStatement: 'SwitchStatement',
+ SwitchCase: 'SwitchCase',
+ ThisExpression: 'ThisExpression',
+ ThrowStatement: 'ThrowStatement',
+ TryStatement: 'TryStatement',
+ UnaryExpression: 'UnaryExpression',
+ UpdateExpression: 'UpdateExpression',
+ VariableDeclaration: 'VariableDeclaration',
+ VariableDeclarator: 'VariableDeclarator',
+ WhileStatement: 'WhileStatement',
+ WithStatement: 'WithStatement',
+ YieldExpression: 'YieldExpression'
+ };
+ Precedence = {
+ Sequence: 0,
+ Yield: 1,
+ Assignment: 1,
+ Conditional: 2,
+ ArrowFunction: 2,
+ LogicalOR: 3,
+ LogicalAND: 4,
+ BitwiseOR: 5,
+ BitwiseXOR: 6,
+ BitwiseAND: 7,
+ Equality: 8,
+ Relational: 9,
+ BitwiseSHIFT: 10,
+ Additive: 11,
+ Multiplicative: 12,
+ Unary: 13,
+ Postfix: 14,
+ Call: 15,
+ New: 16,
+ Member: 17,
+ Primary: 18
+ };
+ BinaryPrecedence = {
+ '||': Precedence.LogicalOR,
+ '&&': Precedence.LogicalAND,
+ '|': Precedence.BitwiseOR,
+ '^': Precedence.BitwiseXOR,
+ '&': Precedence.BitwiseAND,
+ '==': Precedence.Equality,
+ '!=': Precedence.Equality,
+ '===': Precedence.Equality,
+ '!==': Precedence.Equality,
+ 'is': Precedence.Equality,
+ 'isnt': Precedence.Equality,
+ '<': Precedence.Relational,
+ '>': Precedence.Relational,
+ '<=': Precedence.Relational,
+ '>=': Precedence.Relational,
+ 'in': Precedence.Relational,
+ 'instanceof': Precedence.Relational,
+ '<<': Precedence.BitwiseSHIFT,
+ '>>': Precedence.BitwiseSHIFT,
+ '>>>': Precedence.BitwiseSHIFT,
+ '+': Precedence.Additive,
+ '-': Precedence.Additive,
+ '*': Precedence.Multiplicative,
+ '%': Precedence.Multiplicative,
+ '/': Precedence.Multiplicative
+ };
+ function getDefaultOptions() {
+ return {
+ indent: null,
+ base: null,
+ parse: null,
+ comment: false,
+ format: {
+ indent: {
+ style: ' ',
+ base: 0,
+ adjustMultilineComment: false
+ },
+ newline: '\n',
+ space: ' ',
+ json: false,
+ renumber: false,
+ hexadecimal: false,
+ quotes: 'single',
+ escapeless: false,
+ compact: false,
+ parentheses: true,
+ semicolons: true,
+ safeConcatenation: false
+ },
+ moz: {
+ starlessGenerator: false,
+ parenthesizedComprehensionBlock: false
+ },
+ sourceMap: null,
+ sourceMapRoot: null,
+ sourceMapWithCode: false,
+ directive: false,
+ verbatim: null
+ };
+ }
+ function stringRepeat(str, num) {
+ var result = '';
+ for (num |= 0; num > 0; num >>>= 1, str += str) {
+ if (num & 1) {
+ result += str;
+ }
+ }
+ return result;
+ }
+ isArray = Array.isArray;
+ if (!isArray) {
+ isArray = function isArray(array) {
+ return Object.prototype.toString.call(array) === '[object Array]';
+ };
+ }
+ function SourceNodeMock(line, column, filename, chunk) {
+ var result = [];
+ function flatten(input) {
+ var i, iz;
+ if (isArray(input)) {
+ for (i = 0, iz = input.length; i < iz; ++i) {
+ flatten(input[i]);
+ }
+ } else if (input instanceof SourceNodeMock) {
+ result.push(input);
+ } else if (typeof input === 'string' && input) {
+ result.push(input);
+ }
+ }
+ flatten(chunk);
+ this.children = result;
+ }
+ SourceNodeMock.prototype.toString = function toString() {
+ var res = '', i, iz, node;
+ for (i = 0, iz = this.children.length; i < iz; ++i) {
+ node = this.children[i];
+ if (node instanceof SourceNodeMock) {
+ res += node.toString();
+ } else {
+ res += node;
+ }
+ }
+ return res;
+ };
+ SourceNodeMock.prototype.replaceRight = function replaceRight(pattern, replacement) {
+ var last = this.children[this.children.length - 1];
+ if (last instanceof SourceNodeMock) {
+ last.replaceRight(pattern, replacement);
+ } else if (typeof last === 'string') {
+ this.children[this.children.length - 1] = last.replace(pattern, replacement);
+ } else {
+ this.children.push(''.replace(pattern, replacement));
+ }
+ return this;
+ };
+ SourceNodeMock.prototype.join = function join(sep) {
+ var i, iz, result;
+ result = [];
+ iz = this.children.length;
+ if (iz > 0) {
+ --iz;
+ for (i = 0; i < iz; ++i) {
+ result.push(this.children[i], sep);
+ }
+ result.push(this.children[iz]);
+ this.children = result;
+ }
+ return this;
+ };
+ function hasLineTerminator(str) {
+ return /[\r\n]/g.test(str);
+ }
+ function endsWithLineTerminator(str) {
+ var len = str.length;
+ return len && esutils.code.isLineTerminator(str.charCodeAt(len - 1));
+ }
+ function updateDeeply(target, override) {
+ var key, val;
+ function isHashObject(target) {
+ return typeof target === 'object' && target instanceof Object && !(target instanceof RegExp);
+ }
+ for (key in override) {
+ if (override.hasOwnProperty(key)) {
+ val = override[key];
+ if (isHashObject(val)) {
+ if (isHashObject(target[key])) {
+ updateDeeply(target[key], val);
+ } else {
+ target[key] = updateDeeply({}, val);
+ }
+ } else {
+ target[key] = val;
+ }
+ }
+ }
+ return target;
+ }
+ function generateNumber(value) {
+ var result, point, temp, exponent, pos;
+ if (value !== value) {
+ throw new Error('Numeric literal whose value is NaN');
+ }
+ if (value < 0 || value === 0 && 1 / value < 0) {
+ throw new Error('Numeric literal whose value is negative');
+ }
+ if (value === 1 / 0) {
+ return json ? 'null' : renumber ? '1e400' : '1e+400';
+ }
+ result = '' + value;
+ if (!renumber || result.length < 3) {
+ return result;
+ }
+ point = result.indexOf('.');
+ if (!json && result.charCodeAt(0) === 48 && point === 1) {
+ point = 0;
+ result = result.slice(1);
+ }
+ temp = result;
+ result = result.replace('e+', 'e');
+ exponent = 0;
+ if ((pos = temp.indexOf('e')) > 0) {
+ exponent = +temp.slice(pos + 1);
+ temp = temp.slice(0, pos);
+ }
+ if (point >= 0) {
+ exponent -= temp.length - point - 1;
+ temp = +(temp.slice(0, point) + temp.slice(point + 1)) + '';
+ }
+ pos = 0;
+ while (temp.charCodeAt(temp.length + pos - 1) === 48) {
+ --pos;
+ }
+ if (pos !== 0) {
+ exponent -= pos;
+ temp = temp.slice(0, pos);
+ }
+ if (exponent !== 0) {
+ temp += 'e' + exponent;
+ }
+ if ((temp.length < result.length || hexadecimal && value > 1e12 && Math.floor(value) === value && (temp = '0x' + value.toString(16)).length < result.length) && +temp === value) {
+ result = temp;
+ }
+ return result;
+ }
+ function escapeRegExpCharacter(ch, previousIsBackslash) {
+ if ((ch & ~1) === 8232) {
+ return (previousIsBackslash ? 'u' : '\\u') + (ch === 8232 ? '2028' : '2029');
+ } else if (ch === 10 || ch === 13) {
+ return (previousIsBackslash ? '' : '\\') + (ch === 10 ? 'n' : 'r');
+ }
+ return String.fromCharCode(ch);
+ }
+ function generateRegExp(reg) {
+ var match, result, flags, i, iz, ch, characterInBrack, previousIsBackslash;
+ result = reg.toString();
+ if (reg.source) {
+ match = result.match(/\/([^/]*)$/);
+ if (!match) {
+ return result;
+ }
+ flags = match[1];
+ result = '';
+ characterInBrack = false;
+ previousIsBackslash = false;
+ for (i = 0, iz = reg.source.length; i < iz; ++i) {
+ ch = reg.source.charCodeAt(i);
+ if (!previousIsBackslash) {
+ if (characterInBrack) {
+ if (ch === 93) {
+ characterInBrack = false;
+ }
+ } else {
+ if (ch === 47) {
+ result += '\\';
+ } else if (ch === 91) {
+ characterInBrack = true;
+ }
+ }
+ result += escapeRegExpCharacter(ch, previousIsBackslash);
+ previousIsBackslash = ch === 92;
+ } else {
+ result += escapeRegExpCharacter(ch, previousIsBackslash);
+ previousIsBackslash = false;
+ }
+ }
+ return '/' + result + '/' + flags;
+ }
+ return result;
+ }
+ function escapeAllowedCharacter(code, next) {
+ var hex, result = '\\';
+ switch (code) {
+ case 8:
+ result += 'b';
+ break;
+ case 12:
+ result += 'f';
+ break;
+ case 9:
+ result += 't';
+ break;
+ default:
+ hex = code.toString(16);
+ if (json || code > 255) {
+ result += 'u' + '0000'.slice(hex.length) + hex;
+ } else if (code === 0 && !esutils.code.isDecimalDigit(next)) {
+ result += '0';
+ } else if (code === 11) {
+ result += 'x0B';
+ } else {
+ result += 'x' + '00'.slice(hex.length) + hex;
+ }
+ break;
+ }
+ return result;
+ }
+ function escapeDisallowedCharacter(code) {
+ var result = '\\';
+ switch (code) {
+ case 92:
+ result += '\\';
+ break;
+ case 10:
+ result += 'n';
+ break;
+ case 13:
+ result += 'r';
+ break;
+ case 8232:
+ result += 'u2028';
+ break;
+ case 8233:
+ result += 'u2029';
+ break;
+ default:
+ throw new Error('Incorrectly classified character');
+ }
+ return result;
+ }
+ function escapeDirective(str) {
+ var i, iz, code, quote;
+ quote = quotes === 'double' ? '"' : "'";
+ for (i = 0, iz = str.length; i < iz; ++i) {
+ code = str.charCodeAt(i);
+ if (code === 39) {
+ quote = '"';
+ break;
+ } else if (code === 34) {
+ quote = "'";
+ break;
+ } else if (code === 92) {
+ ++i;
+ }
+ }
+ return quote + str + quote;
+ }
+ function escapeString(str) {
+ var result = '', i, len, code, singleQuotes = 0, doubleQuotes = 0, single, quote;
+ for (i = 0, len = str.length; i < len; ++i) {
+ code = str.charCodeAt(i);
+ if (code === 39) {
+ ++singleQuotes;
+ } else if (code === 34) {
+ ++doubleQuotes;
+ } else if (code === 47 && json) {
+ result += '\\';
+ } else if (esutils.code.isLineTerminator(code) || code === 92) {
+ result += escapeDisallowedCharacter(code);
+ continue;
+ } else if (json && code < 32 || !(json || escapeless || code >= 32 && code <= 126)) {
+ result += escapeAllowedCharacter(code, str.charCodeAt(i + 1));
+ continue;
+ }
+ result += String.fromCharCode(code);
+ }
+ single = !(quotes === 'double' || quotes === 'auto' && doubleQuotes < singleQuotes);
+ quote = single ? "'" : '"';
+ if (!(single ? singleQuotes : doubleQuotes)) {
+ return quote + result + quote;
+ }
+ str = result;
+ result = quote;
+ for (i = 0, len = str.length; i < len; ++i) {
+ code = str.charCodeAt(i);
+ if (code === 39 && single || code === 34 && !single) {
+ result += '\\';
+ }
+ result += String.fromCharCode(code);
+ }
+ return result + quote;
+ }
+ function toSourceNode(generated, node) {
+ if (node == null) {
+ if (generated instanceof SourceNode) {
+ return generated;
+ } else {
+ node = {};
+ }
+ }
+ if (node.loc == null) {
+ return new SourceNode(null, null, sourceMap, generated, node.name || null);
+ }
+ return new SourceNode(node.loc.start.line, node.loc.start.column, sourceMap === true ? node.loc.source || null : sourceMap, generated, node.name || null);
+ }
+ function noEmptySpace() {
+ return space ? space : ' ';
+ }
+ function join(left, right) {
+ var leftSource = toSourceNode(left).toString(), rightSource = toSourceNode(right).toString(), leftCharCode = leftSource.charCodeAt(leftSource.length - 1), rightCharCode = rightSource.charCodeAt(0);
+ if ((leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPart(leftCharCode) && esutils.code.isIdentifierPart(rightCharCode) || leftCharCode === 47 && rightCharCode === 105) {
+ return [
+ left,
+ noEmptySpace(),
+ right
+ ];
+ } else if (esutils.code.isWhiteSpace(leftCharCode) || esutils.code.isLineTerminator(leftCharCode) || esutils.code.isWhiteSpace(rightCharCode) || esutils.code.isLineTerminator(rightCharCode)) {
+ return [
+ left,
+ right
+ ];
+ }
+ return [
+ left,
+ space,
+ right
+ ];
+ }
+ function addIndent(stmt) {
+ return [
+ base,
+ stmt
+ ];
+ }
+ function withIndent(fn) {
+ var previousBase, result;
+ previousBase = base;
+ base += indent;
+ result = fn.call(this, base);
+ base = previousBase;
+ return result;
+ }
+ function calculateSpaces(str) {
+ var i;
+ for (i = str.length - 1; i >= 0; --i) {
+ if (esutils.code.isLineTerminator(str.charCodeAt(i))) {
+ break;
+ }
+ }
+ return str.length - 1 - i;
+ }
+ function adjustMultilineComment(value, specialBase) {
+ var array, i, len, line, j, spaces, previousBase;
+ array = value.split(/\r\n|[\r\n]/);
+ spaces = Number.MAX_VALUE;
+ for (i = 1, len = array.length; i < len; ++i) {
+ line = array[i];
+ j = 0;
+ while (j < line.length && esutils.code.isWhiteSpace(line.charCodeAt(j))) {
+ ++j;
+ }
+ if (spaces > j) {
+ spaces = j;
+ }
+ }
+ if (typeof specialBase !== 'undefined') {
+ previousBase = base;
+ if (array[1][spaces] === '*') {
+ specialBase += ' ';
+ }
+ base = specialBase;
+ } else {
+ if (spaces & 1) {
+ --spaces;
+ }
+ previousBase = base;
+ }
+ for (i = 1, len = array.length; i < len; ++i) {
+ array[i] = toSourceNode(addIndent(array[i].slice(spaces))).join('');
+ }
+ base = previousBase;
+ return array.join('\n');
+ }
+ function generateComment(comment, specialBase) {
+ if (comment.type === 'Line') {
+ if (endsWithLineTerminator(comment.value)) {
+ return '//' + comment.value;
+ } else {
+ return '//' + comment.value + '\n';
+ }
+ }
+ if (extra.format.indent.adjustMultilineComment && /[\n\r]/.test(comment.value)) {
+ return adjustMultilineComment('/*' + comment.value + '*/', specialBase);
+ }
+ return '/*' + comment.value + '*/';
+ }
+ function addCommentsToStatement(stmt, result) {
+ var i, len, comment, save, tailingToStatement, specialBase, fragment;
+ if (stmt.leadingComments && stmt.leadingComments.length > 0) {
+ save = result;
+ comment = stmt.leadingComments[0];
+ result = [];
+ if (safeConcatenation && stmt.type === Syntax.Program && stmt.body.length === 0) {
+ result.push('\n');
+ }
+ result.push(generateComment(comment));
+ if (!endsWithLineTerminator(toSourceNode(result).toString())) {
+ result.push('\n');
+ }
+ for (i = 1, len = stmt.leadingComments.length; i < len; ++i) {
+ comment = stmt.leadingComments[i];
+ fragment = [generateComment(comment)];
+ if (!endsWithLineTerminator(toSourceNode(fragment).toString())) {
+ fragment.push('\n');
+ }
+ result.push(addIndent(fragment));
+ }
+ result.push(addIndent(save));
+ }
+ if (stmt.trailingComments) {
+ tailingToStatement = !endsWithLineTerminator(toSourceNode(result).toString());
+ specialBase = stringRepeat(' ', calculateSpaces(toSourceNode([
+ base,
+ result,
+ indent
+ ]).toString()));
+ for (i = 0, len = stmt.trailingComments.length; i < len; ++i) {
+ comment = stmt.trailingComments[i];
+ if (tailingToStatement) {
+ if (i === 0) {
+ result = [
+ result,
+ indent
+ ];
+ } else {
+ result = [
+ result,
+ specialBase
+ ];
+ }
+ result.push(generateComment(comment, specialBase));
+ } else {
+ result = [
+ result,
+ addIndent(generateComment(comment))
+ ];
+ }
+ if (i !== len - 1 && !endsWithLineTerminator(toSourceNode(result).toString())) {
+ result = [
+ result,
+ '\n'
+ ];
+ }
+ }
+ }
+ return result;
+ }
+ function parenthesize(text, current, should) {
+ if (current < should) {
+ return [
+ '(',
+ text,
+ ')'
+ ];
+ }
+ return text;
+ }
+ function maybeBlock(stmt, semicolonOptional, functionBody) {
+ var result, noLeadingComment;
+ noLeadingComment = !extra.comment || !stmt.leadingComments;
+ if (stmt.type === Syntax.BlockStatement && noLeadingComment) {
+ return [
+ space,
+ generateStatement(stmt, { functionBody: functionBody })
+ ];
+ }
+ if (stmt.type === Syntax.EmptyStatement && noLeadingComment) {
+ return ';';
+ }
+ withIndent(function () {
+ result = [
+ newline,
+ addIndent(generateStatement(stmt, {
+ semicolonOptional: semicolonOptional,
+ functionBody: functionBody
+ }))
+ ];
+ });
+ return result;
+ }
+ function maybeBlockSuffix(stmt, result) {
+ var ends = endsWithLineTerminator(toSourceNode(result).toString());
+ if (stmt.type === Syntax.BlockStatement && (!extra.comment || !stmt.leadingComments) && !ends) {
+ return [
+ result,
+ space
+ ];
+ }
+ if (ends) {
+ return [
+ result,
+ base
+ ];
+ }
+ return [
+ result,
+ newline,
+ base
+ ];
+ }
+ function generateVerbatim(expr, option) {
+ var i, result;
+ result = expr[extra.verbatim].split(/\r\n|\n/);
+ for (i = 1; i < result.length; i++) {
+ result[i] = newline + base + result[i];
+ }
+ result = parenthesize(result, Precedence.Sequence, option.precedence);
+ return toSourceNode(result, expr);
+ }
+ function generateIdentifier(node) {
+ return toSourceNode(node.name, node);
+ }
+ function generateFunctionBody(node) {
+ var result, i, len, expr, arrow;
+ arrow = node.type === Syntax.ArrowFunctionExpression;
+ if (arrow && node.params.length === 1 && node.params[0].type === Syntax.Identifier) {
+ result = [generateIdentifier(node.params[0])];
+ } else {
+ result = ['('];
+ for (i = 0, len = node.params.length; i < len; ++i) {
+ result.push(generateIdentifier(node.params[i]));
+ if (i + 1 < len) {
+ result.push(',' + space);
+ }
+ }
+ result.push(')');
+ }
+ if (arrow) {
+ result.push(space, '=>');
+ }
+ if (node.expression) {
+ result.push(space);
+ expr = generateExpression(node.body, {
+ precedence: Precedence.Assignment,
+ allowIn: true,
+ allowCall: true
+ });
+ if (expr.toString().charAt(0) === '{') {
+ expr = [
+ '(',
+ expr,
+ ')'
+ ];
+ }
+ result.push(expr);
+ } else {
+ result.push(maybeBlock(node.body, false, true));
+ }
+ return result;
+ }
+ function generateExpression(expr, option) {
+ var result, precedence, type, currentPrecedence, i, len, raw, fragment, multiline, leftCharCode, leftSource, rightCharCode, allowIn, allowCall, allowUnparenthesizedNew, property;
+ precedence = option.precedence;
+ allowIn = option.allowIn;
+ allowCall = option.allowCall;
+ type = expr.type || option.type;
+ if (extra.verbatim && expr.hasOwnProperty(extra.verbatim)) {
+ return generateVerbatim(expr, option);
+ }
+ switch (type) {
+ case Syntax.SequenceExpression:
+ result = [];
+ allowIn |= Precedence.Sequence < precedence;
+ for (i = 0, len = expr.expressions.length; i < len; ++i) {
+ result.push(generateExpression(expr.expressions[i], {
+ precedence: Precedence.Assignment,
+ allowIn: allowIn,
+ allowCall: true
+ }));
+ if (i + 1 < len) {
+ result.push(',' + space);
+ }
+ }
+ result = parenthesize(result, Precedence.Sequence, precedence);
+ break;
+ case Syntax.AssignmentExpression:
+ allowIn |= Precedence.Assignment < precedence;
+ result = parenthesize([
+ generateExpression(expr.left, {
+ precedence: Precedence.Call,
+ allowIn: allowIn,
+ allowCall: true
+ }),
+ space + expr.operator + space,
+ generateExpression(expr.right, {
+ precedence: Precedence.Assignment,
+ allowIn: allowIn,
+ allowCall: true
+ })
+ ], Precedence.Assignment, precedence);
+ break;
+ case Syntax.ArrowFunctionExpression:
+ allowIn |= Precedence.ArrowFunction < precedence;
+ result = parenthesize(generateFunctionBody(expr), Precedence.ArrowFunction, precedence);
+ break;
+ case Syntax.ConditionalExpression:
+ allowIn |= Precedence.Conditional < precedence;
+ result = parenthesize([
+ generateExpression(expr.test, {
+ precedence: Precedence.LogicalOR,
+ allowIn: allowIn,
+ allowCall: true
+ }),
+ space + '?' + space,
+ generateExpression(expr.consequent, {
+ precedence: Precedence.Assignment,
+ allowIn: allowIn,
+ allowCall: true
+ }),
+ space + ':' + space,
+ generateExpression(expr.alternate, {
+ precedence: Precedence.Assignment,
+ allowIn: allowIn,
+ allowCall: true
+ })
+ ], Precedence.Conditional, precedence);
+ break;
+ case Syntax.LogicalExpression:
+ case Syntax.BinaryExpression:
+ currentPrecedence = BinaryPrecedence[expr.operator];
+ allowIn |= currentPrecedence < precedence;
+ fragment = generateExpression(expr.left, {
+ precedence: currentPrecedence,
+ allowIn: allowIn,
+ allowCall: true
+ });
+ leftSource = fragment.toString();
+ if (leftSource.charCodeAt(leftSource.length - 1) === 47 && esutils.code.isIdentifierPart(expr.operator.charCodeAt(0))) {
+ result = [
+ fragment,
+ noEmptySpace(),
+ expr.operator
+ ];
+ } else {
+ result = join(fragment, expr.operator);
+ }
+ fragment = generateExpression(expr.right, {
+ precedence: currentPrecedence + 1,
+ allowIn: allowIn,
+ allowCall: true
+ });
+ if (expr.operator === '/' && fragment.toString().charAt(0) === '/' || expr.operator.slice(-1) === '<' && fragment.toString().slice(0, 3) === '!--') {
+ result.push(noEmptySpace(), fragment);
+ } else {
+ result = join(result, fragment);
+ }
+ if (expr.operator === 'in' && !allowIn) {
+ result = [
+ '(',
+ result,
+ ')'
+ ];
+ } else {
+ result = parenthesize(result, currentPrecedence, precedence);
+ }
+ break;
+ case Syntax.CallExpression:
+ result = [generateExpression(expr.callee, {
+ precedence: Precedence.Call,
+ allowIn: true,
+ allowCall: true,
+ allowUnparenthesizedNew: false
+ })];
+ result.push('(');
+ for (i = 0, len = expr['arguments'].length; i < len; ++i) {
+ result.push(generateExpression(expr['arguments'][i], {
+ precedence: Precedence.Assignment,
+ allowIn: true,
+ allowCall: true
+ }));
+ if (i + 1 < len) {
+ result.push(',' + space);
+ }
+ }
+ result.push(')');
+ if (!allowCall) {
+ result = [
+ '(',
+ result,
+ ')'
+ ];
+ } else {
+ result = parenthesize(result, Precedence.Call, precedence);
+ }
+ break;
+ case Syntax.NewExpression:
+ len = expr['arguments'].length;
+ allowUnparenthesizedNew = option.allowUnparenthesizedNew === undefined || option.allowUnparenthesizedNew;
+ result = join('new', generateExpression(expr.callee, {
+ precedence: Precedence.New,
+ allowIn: true,
+ allowCall: false,
+ allowUnparenthesizedNew: allowUnparenthesizedNew && !parentheses && len === 0
+ }));
+ if (!allowUnparenthesizedNew || parentheses || len > 0) {
+ result.push('(');
+ for (i = 0; i < len; ++i) {
+ result.push(generateExpression(expr['arguments'][i], {
+ precedence: Precedence.Assignment,
+ allowIn: true,
+ allowCall: true
+ }));
+ if (i + 1 < len) {
+ result.push(',' + space);
+ }
+ }
+ result.push(')');
+ }
+ result = parenthesize(result, Precedence.New, precedence);
+ break;
+ case Syntax.MemberExpression:
+ result = [generateExpression(expr.object, {
+ precedence: Precedence.Call,
+ allowIn: true,
+ allowCall: allowCall,
+ allowUnparenthesizedNew: false
+ })];
+ if (expr.computed) {
+ result.push('[', generateExpression(expr.property, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: allowCall
+ }), ']');
+ } else {
+ if (expr.object.type === Syntax.Literal && typeof expr.object.value === 'number') {
+ fragment = toSourceNode(result).toString();
+ if (fragment.indexOf('.') < 0 && !/[eExX]/.test(fragment) && esutils.code.isDecimalDigit(fragment.charCodeAt(fragment.length - 1)) && !(fragment.length >= 2 && fragment.charCodeAt(0) === 48)) {
+ result.push('.');
+ }
+ }
+ result.push('.', generateIdentifier(expr.property));
+ }
+ result = parenthesize(result, Precedence.Member, precedence);
+ break;
+ case Syntax.UnaryExpression:
+ fragment = generateExpression(expr.argument, {
+ precedence: Precedence.Unary,
+ allowIn: true,
+ allowCall: true
+ });
+ if (space === '') {
+ result = join(expr.operator, fragment);
+ } else {
+ result = [expr.operator];
+ if (expr.operator.length > 2) {
+ result = join(result, fragment);
+ } else {
+ leftSource = toSourceNode(result).toString();
+ leftCharCode = leftSource.charCodeAt(leftSource.length - 1);
+ rightCharCode = fragment.toString().charCodeAt(0);
+ if ((leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPart(leftCharCode) && esutils.code.isIdentifierPart(rightCharCode)) {
+ result.push(noEmptySpace(), fragment);
+ } else {
+ result.push(fragment);
+ }
+ }
+ }
+ result = parenthesize(result, Precedence.Unary, precedence);
+ break;
+ case Syntax.YieldExpression:
+ if (expr.delegate) {
+ result = 'yield*';
+ } else {
+ result = 'yield';
+ }
+ if (expr.argument) {
+ result = join(result, generateExpression(expr.argument, {
+ precedence: Precedence.Yield,
+ allowIn: true,
+ allowCall: true
+ }));
+ }
+ result = parenthesize(result, Precedence.Yield, precedence);
+ break;
+ case Syntax.UpdateExpression:
+ if (expr.prefix) {
+ result = parenthesize([
+ expr.operator,
+ generateExpression(expr.argument, {
+ precedence: Precedence.Unary,
+ allowIn: true,
+ allowCall: true
+ })
+ ], Precedence.Unary, precedence);
+ } else {
+ result = parenthesize([
+ generateExpression(expr.argument, {
+ precedence: Precedence.Postfix,
+ allowIn: true,
+ allowCall: true
+ }),
+ expr.operator
+ ], Precedence.Postfix, precedence);
+ }
+ break;
+ case Syntax.FunctionExpression:
+ result = 'function';
+ if (expr.id) {
+ result = [
+ result,
+ noEmptySpace(),
+ generateIdentifier(expr.id),
+ generateFunctionBody(expr)
+ ];
+ } else {
+ result = [
+ result + space,
+ generateFunctionBody(expr)
+ ];
+ }
+ break;
+ case Syntax.ArrayPattern:
+ case Syntax.ArrayExpression:
+ if (!expr.elements.length) {
+ result = '[]';
+ break;
+ }
+ multiline = expr.elements.length > 1;
+ result = [
+ '[',
+ multiline ? newline : ''
+ ];
+ withIndent(function (indent) {
+ for (i = 0, len = expr.elements.length; i < len; ++i) {
+ if (!expr.elements[i]) {
+ if (multiline) {
+ result.push(indent);
+ }
+ if (i + 1 === len) {
+ result.push(',');
+ }
+ } else {
+ result.push(multiline ? indent : '', generateExpression(expr.elements[i], {
+ precedence: Precedence.Assignment,
+ allowIn: true,
+ allowCall: true
+ }));
+ }
+ if (i + 1 < len) {
+ result.push(',' + (multiline ? newline : space));
+ }
+ }
+ });
+ if (multiline && !endsWithLineTerminator(toSourceNode(result).toString())) {
+ result.push(newline);
+ }
+ result.push(multiline ? base : '', ']');
+ break;
+ case Syntax.Property:
+ if (expr.kind === 'get' || expr.kind === 'set') {
+ result = [
+ expr.kind,
+ noEmptySpace(),
+ generateExpression(expr.key, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }),
+ generateFunctionBody(expr.value)
+ ];
+ } else {
+ if (expr.shorthand) {
+ result = generateExpression(expr.key, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ });
+ } else if (expr.method) {
+ result = [];
+ if (expr.value.generator) {
+ result.push('*');
+ }
+ result.push(generateExpression(expr.key, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }), generateFunctionBody(expr.value));
+ } else {
+ result = [
+ generateExpression(expr.key, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }),
+ ':' + space,
+ generateExpression(expr.value, {
+ precedence: Precedence.Assignment,
+ allowIn: true,
+ allowCall: true
+ })
+ ];
+ }
+ }
+ break;
+ case Syntax.ObjectExpression:
+ if (!expr.properties.length) {
+ result = '{}';
+ break;
+ }
+ multiline = expr.properties.length > 1;
+ withIndent(function () {
+ fragment = generateExpression(expr.properties[0], {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true,
+ type: Syntax.Property
+ });
+ });
+ if (!multiline) {
+ if (!hasLineTerminator(toSourceNode(fragment).toString())) {
+ result = [
+ '{',
+ space,
+ fragment,
+ space,
+ '}'
+ ];
+ break;
+ }
+ }
+ withIndent(function (indent) {
+ result = [
+ '{',
+ newline,
+ indent,
+ fragment
+ ];
+ if (multiline) {
+ result.push(',' + newline);
+ for (i = 1, len = expr.properties.length; i < len; ++i) {
+ result.push(indent, generateExpression(expr.properties[i], {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true,
+ type: Syntax.Property
+ }));
+ if (i + 1 < len) {
+ result.push(',' + newline);
+ }
+ }
+ }
+ });
+ if (!endsWithLineTerminator(toSourceNode(result).toString())) {
+ result.push(newline);
+ }
+ result.push(base, '}');
+ break;
+ case Syntax.ObjectPattern:
+ if (!expr.properties.length) {
+ result = '{}';
+ break;
+ }
+ multiline = false;
+ if (expr.properties.length === 1) {
+ property = expr.properties[0];
+ if (property.value.type !== Syntax.Identifier) {
+ multiline = true;
+ }
+ } else {
+ for (i = 0, len = expr.properties.length; i < len; ++i) {
+ property = expr.properties[i];
+ if (!property.shorthand) {
+ multiline = true;
+ break;
+ }
+ }
+ }
+ result = [
+ '{',
+ multiline ? newline : ''
+ ];
+ withIndent(function (indent) {
+ for (i = 0, len = expr.properties.length; i < len; ++i) {
+ result.push(multiline ? indent : '', generateExpression(expr.properties[i], {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }));
+ if (i + 1 < len) {
+ result.push(',' + (multiline ? newline : space));
+ }
+ }
+ });
+ if (multiline && !endsWithLineTerminator(toSourceNode(result).toString())) {
+ result.push(newline);
+ }
+ result.push(multiline ? base : '', '}');
+ break;
+ case Syntax.ThisExpression:
+ result = 'this';
+ break;
+ case Syntax.Identifier:
+ result = generateIdentifier(expr);
+ break;
+ case Syntax.Literal:
+ if (expr.hasOwnProperty('raw') && parse) {
+ try {
+ raw = parse(expr.raw).body[0].expression;
+ if (raw.type === Syntax.Literal) {
+ if (raw.value === expr.value) {
+ result = expr.raw;
+ break;
+ }
+ }
+ } catch (e) {
+ }
+ }
+ if (expr.value === null) {
+ result = 'null';
+ break;
+ }
+ if (typeof expr.value === 'string') {
+ result = escapeString(expr.value);
+ break;
+ }
+ if (typeof expr.value === 'number') {
+ result = generateNumber(expr.value);
+ break;
+ }
+ if (typeof expr.value === 'boolean') {
+ result = expr.value ? 'true' : 'false';
+ break;
+ }
+ result = generateRegExp(expr.value);
+ break;
+ case Syntax.ComprehensionExpression:
+ result = [
+ '[',
+ generateExpression(expr.body, {
+ precedence: Precedence.Assignment,
+ allowIn: true,
+ allowCall: true
+ })
+ ];
+ if (expr.blocks) {
+ for (i = 0, len = expr.blocks.length; i < len; ++i) {
+ fragment = generateExpression(expr.blocks[i], {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ });
+ result = join(result, fragment);
+ }
+ }
+ if (expr.filter) {
+ result = join(result, 'if' + space);
+ fragment = generateExpression(expr.filter, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ });
+ if (extra.moz.parenthesizedComprehensionBlock) {
+ result = join(result, [
+ '(',
+ fragment,
+ ')'
+ ]);
+ } else {
+ result = join(result, fragment);
+ }
+ }
+ result.push(']');
+ break;
+ case Syntax.ComprehensionBlock:
+ if (expr.left.type === Syntax.VariableDeclaration) {
+ fragment = [
+ expr.left.kind,
+ noEmptySpace(),
+ generateStatement(expr.left.declarations[0], { allowIn: false })
+ ];
+ } else {
+ fragment = generateExpression(expr.left, {
+ precedence: Precedence.Call,
+ allowIn: true,
+ allowCall: true
+ });
+ }
+ fragment = join(fragment, expr.of ? 'of' : 'in');
+ fragment = join(fragment, generateExpression(expr.right, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }));
+ if (extra.moz.parenthesizedComprehensionBlock) {
+ result = [
+ 'for' + space + '(',
+ fragment,
+ ')'
+ ];
+ } else {
+ result = join('for' + space, fragment);
+ }
+ break;
+ default:
+ throw new Error('Unknown expression type: ' + expr.type);
+ }
+ return toSourceNode(result, expr);
+ }
+ function generateStatement(stmt, option) {
+ var i, len, result, node, allowIn, functionBody, directiveContext, fragment, semicolon;
+ allowIn = true;
+ semicolon = ';';
+ functionBody = false;
+ directiveContext = false;
+ if (option) {
+ allowIn = option.allowIn === undefined || option.allowIn;
+ if (!semicolons && option.semicolonOptional === true) {
+ semicolon = '';
+ }
+ functionBody = option.functionBody;
+ directiveContext = option.directiveContext;
+ }
+ switch (stmt.type) {
+ case Syntax.BlockStatement:
+ result = [
+ '{',
+ newline
+ ];
+ withIndent(function () {
+ for (i = 0, len = stmt.body.length; i < len; ++i) {
+ fragment = addIndent(generateStatement(stmt.body[i], {
+ semicolonOptional: i === len - 1,
+ directiveContext: functionBody
+ }));
+ result.push(fragment);
+ if (!endsWithLineTerminator(toSourceNode(fragment).toString())) {
+ result.push(newline);
+ }
+ }
+ });
+ result.push(addIndent('}'));
+ break;
+ case Syntax.BreakStatement:
+ if (stmt.label) {
+ result = 'break ' + stmt.label.name + semicolon;
+ } else {
+ result = 'break' + semicolon;
+ }
+ break;
+ case Syntax.ContinueStatement:
+ if (stmt.label) {
+ result = 'continue ' + stmt.label.name + semicolon;
+ } else {
+ result = 'continue' + semicolon;
+ }
+ break;
+ case Syntax.DirectiveStatement:
+ if (stmt.raw) {
+ result = stmt.raw + semicolon;
+ } else {
+ result = escapeDirective(stmt.directive) + semicolon;
+ }
+ break;
+ case Syntax.DoWhileStatement:
+ result = join('do', maybeBlock(stmt.body));
+ result = maybeBlockSuffix(stmt.body, result);
+ result = join(result, [
+ 'while' + space + '(',
+ generateExpression(stmt.test, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }),
+ ')' + semicolon
+ ]);
+ break;
+ case Syntax.CatchClause:
+ withIndent(function () {
+ result = [
+ 'catch' + space + '(',
+ generateExpression(stmt.param, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }),
+ ')'
+ ];
+ });
+ result.push(maybeBlock(stmt.body));
+ break;
+ case Syntax.DebuggerStatement:
+ result = 'debugger' + semicolon;
+ break;
+ case Syntax.EmptyStatement:
+ result = ';';
+ break;
+ case Syntax.ExpressionStatement:
+ result = [generateExpression(stmt.expression, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ })];
+ fragment = toSourceNode(result).toString();
+ if (fragment.charAt(0) === '{' || fragment.slice(0, 8) === 'function' && ' ('.indexOf(fragment.charAt(8)) >= 0 || directive && directiveContext && stmt.expression.type === Syntax.Literal && typeof stmt.expression.value === 'string') {
+ result = [
+ '(',
+ result,
+ ')' + semicolon
+ ];
+ } else {
+ result.push(semicolon);
+ }
+ break;
+ case Syntax.VariableDeclarator:
+ if (stmt.init) {
+ result = [
+ generateExpression(stmt.id, {
+ precedence: Precedence.Assignment,
+ allowIn: allowIn,
+ allowCall: true
+ }),
+ space,
+ '=',
+ space,
+ generateExpression(stmt.init, {
+ precedence: Precedence.Assignment,
+ allowIn: allowIn,
+ allowCall: true
+ })
+ ];
+ } else {
+ result = generateIdentifier(stmt.id);
+ }
+ break;
+ case Syntax.VariableDeclaration:
+ result = [stmt.kind];
+ if (stmt.declarations.length === 1 && stmt.declarations[0].init && stmt.declarations[0].init.type === Syntax.FunctionExpression) {
+ result.push(noEmptySpace(), generateStatement(stmt.declarations[0], { allowIn: allowIn }));
+ } else {
+ withIndent(function () {
+ node = stmt.declarations[0];
+ if (extra.comment && node.leadingComments) {
+ result.push('\n', addIndent(generateStatement(node, { allowIn: allowIn })));
+ } else {
+ result.push(noEmptySpace(), generateStatement(node, { allowIn: allowIn }));
+ }
+ for (i = 1, len = stmt.declarations.length; i < len; ++i) {
+ node = stmt.declarations[i];
+ if (extra.comment && node.leadingComments) {
+ result.push(',' + newline, addIndent(generateStatement(node, { allowIn: allowIn })));
+ } else {
+ result.push(',' + space, generateStatement(node, { allowIn: allowIn }));
+ }
+ }
+ });
+ }
+ result.push(semicolon);
+ break;
+ case Syntax.ThrowStatement:
+ result = [
+ join('throw', generateExpression(stmt.argument, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ })),
+ semicolon
+ ];
+ break;
+ case Syntax.TryStatement:
+ result = [
+ 'try',
+ maybeBlock(stmt.block)
+ ];
+ result = maybeBlockSuffix(stmt.block, result);
+ if (stmt.handlers) {
+ for (i = 0, len = stmt.handlers.length; i < len; ++i) {
+ result = join(result, generateStatement(stmt.handlers[i]));
+ if (stmt.finalizer || i + 1 !== len) {
+ result = maybeBlockSuffix(stmt.handlers[i].body, result);
+ }
+ }
+ } else {
+ if (stmt.handler) {
+ result = join(result, generateStatement(stmt.handler));
+ if (stmt.finalizer || stmt.guardedHandlers.length > 0) {
+ result = maybeBlockSuffix(stmt.handler.body, result);
+ }
+ }
+ for (i = 0, len = stmt.guardedHandlers.length; i < len; ++i) {
+ result = join(result, generateStatement(stmt.guardedHandlers[i]));
+ if (stmt.finalizer || i + 1 !== len) {
+ result = maybeBlockSuffix(stmt.guardedHandlers[i].body, result);
+ }
+ }
+ }
+ if (stmt.finalizer) {
+ result = join(result, [
+ 'finally',
+ maybeBlock(stmt.finalizer)
+ ]);
+ }
+ break;
+ case Syntax.SwitchStatement:
+ withIndent(function () {
+ result = [
+ 'switch' + space + '(',
+ generateExpression(stmt.discriminant, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }),
+ ')' + space + '{' + newline
+ ];
+ });
+ if (stmt.cases) {
+ for (i = 0, len = stmt.cases.length; i < len; ++i) {
+ fragment = addIndent(generateStatement(stmt.cases[i], { semicolonOptional: i === len - 1 }));
+ result.push(fragment);
+ if (!endsWithLineTerminator(toSourceNode(fragment).toString())) {
+ result.push(newline);
+ }
+ }
+ }
+ result.push(addIndent('}'));
+ break;
+ case Syntax.SwitchCase:
+ withIndent(function () {
+ if (stmt.test) {
+ result = [
+ join('case', generateExpression(stmt.test, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ })),
+ ':'
+ ];
+ } else {
+ result = ['default:'];
+ }
+ i = 0;
+ len = stmt.consequent.length;
+ if (len && stmt.consequent[0].type === Syntax.BlockStatement) {
+ fragment = maybeBlock(stmt.consequent[0]);
+ result.push(fragment);
+ i = 1;
+ }
+ if (i !== len && !endsWithLineTerminator(toSourceNode(result).toString())) {
+ result.push(newline);
+ }
+ for (; i < len; ++i) {
+ fragment = addIndent(generateStatement(stmt.consequent[i], { semicolonOptional: i === len - 1 && semicolon === '' }));
+ result.push(fragment);
+ if (i + 1 !== len && !endsWithLineTerminator(toSourceNode(fragment).toString())) {
+ result.push(newline);
+ }
+ }
+ });
+ break;
+ case Syntax.IfStatement:
+ withIndent(function () {
+ result = [
+ 'if' + space + '(',
+ generateExpression(stmt.test, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }),
+ ')'
+ ];
+ });
+ if (stmt.alternate) {
+ result.push(maybeBlock(stmt.consequent));
+ result = maybeBlockSuffix(stmt.consequent, result);
+ if (stmt.alternate.type === Syntax.IfStatement) {
+ result = join(result, [
+ 'else ',
+ generateStatement(stmt.alternate, { semicolonOptional: semicolon === '' })
+ ]);
+ } else {
+ result = join(result, join('else', maybeBlock(stmt.alternate, semicolon === '')));
+ }
+ } else {
+ result.push(maybeBlock(stmt.consequent, semicolon === ''));
+ }
+ break;
+ case Syntax.ForStatement:
+ withIndent(function () {
+ result = ['for' + space + '('];
+ if (stmt.init) {
+ if (stmt.init.type === Syntax.VariableDeclaration) {
+ result.push(generateStatement(stmt.init, { allowIn: false }));
+ } else {
+ result.push(generateExpression(stmt.init, {
+ precedence: Precedence.Sequence,
+ allowIn: false,
+ allowCall: true
+ }), ';');
+ }
+ } else {
+ result.push(';');
+ }
+ if (stmt.test) {
+ result.push(space, generateExpression(stmt.test, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }), ';');
+ } else {
+ result.push(';');
+ }
+ if (stmt.update) {
+ result.push(space, generateExpression(stmt.update, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }), ')');
+ } else {
+ result.push(')');
+ }
+ });
+ result.push(maybeBlock(stmt.body, semicolon === ''));
+ break;
+ case Syntax.ForInStatement:
+ result = ['for' + space + '('];
+ withIndent(function () {
+ if (stmt.left.type === Syntax.VariableDeclaration) {
+ withIndent(function () {
+ result.push(stmt.left.kind + noEmptySpace(), generateStatement(stmt.left.declarations[0], { allowIn: false }));
+ });
+ } else {
+ result.push(generateExpression(stmt.left, {
+ precedence: Precedence.Call,
+ allowIn: true,
+ allowCall: true
+ }));
+ }
+ result = join(result, 'in');
+ result = [
+ join(result, generateExpression(stmt.right, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ })),
+ ')'
+ ];
+ });
+ result.push(maybeBlock(stmt.body, semicolon === ''));
+ break;
+ case Syntax.LabeledStatement:
+ result = [
+ stmt.label.name + ':',
+ maybeBlock(stmt.body, semicolon === '')
+ ];
+ break;
+ case Syntax.Program:
+ len = stmt.body.length;
+ result = [safeConcatenation && len > 0 ? '\n' : ''];
+ for (i = 0; i < len; ++i) {
+ fragment = addIndent(generateStatement(stmt.body[i], {
+ semicolonOptional: !safeConcatenation && i === len - 1,
+ directiveContext: true
+ }));
+ result.push(fragment);
+ if (i + 1 < len && !endsWithLineTerminator(toSourceNode(fragment).toString())) {
+ result.push(newline);
+ }
+ }
+ break;
+ case Syntax.FunctionDeclaration:
+ result = [
+ stmt.generator && !extra.moz.starlessGenerator ? 'function* ' : 'function ',
+ generateIdentifier(stmt.id),
+ generateFunctionBody(stmt)
+ ];
+ break;
+ case Syntax.ReturnStatement:
+ if (stmt.argument) {
+ result = [
+ join('return', generateExpression(stmt.argument, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ })),
+ semicolon
+ ];
+ } else {
+ result = ['return' + semicolon];
+ }
+ break;
+ case Syntax.WhileStatement:
+ withIndent(function () {
+ result = [
+ 'while' + space + '(',
+ generateExpression(stmt.test, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }),
+ ')'
+ ];
+ });
+ result.push(maybeBlock(stmt.body, semicolon === ''));
+ break;
+ case Syntax.WithStatement:
+ withIndent(function () {
+ result = [
+ 'with' + space + '(',
+ generateExpression(stmt.object, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }),
+ ')'
+ ];
+ });
+ result.push(maybeBlock(stmt.body, semicolon === ''));
+ break;
+ default:
+ throw new Error('Unknown statement type: ' + stmt.type);
+ }
+ if (extra.comment) {
+ result = addCommentsToStatement(stmt, result);
+ }
+ fragment = toSourceNode(result).toString();
+ if (stmt.type === Syntax.Program && !safeConcatenation && newline === '' && fragment.charAt(fragment.length - 1) === '\n') {
+ result = toSourceNode(result).replaceRight(/\s+$/, '');
+ }
+ return toSourceNode(result, stmt);
+ }
+ function generate(node, options) {
+ var defaultOptions = getDefaultOptions(), result, pair;
+ if (options != null) {
+ if (typeof options.indent === 'string') {
+ defaultOptions.format.indent.style = options.indent;
+ }
+ if (typeof options.base === 'number') {
+ defaultOptions.format.indent.base = options.base;
+ }
+ options = updateDeeply(defaultOptions, options);
+ indent = options.format.indent.style;
+ if (typeof options.base === 'string') {
+ base = options.base;
+ } else {
+ base = stringRepeat(indent, options.format.indent.base);
+ }
+ } else {
+ options = defaultOptions;
+ indent = options.format.indent.style;
+ base = stringRepeat(indent, options.format.indent.base);
+ }
+ json = options.format.json;
+ renumber = options.format.renumber;
+ hexadecimal = json ? false : options.format.hexadecimal;
+ quotes = json ? 'double' : options.format.quotes;
+ escapeless = options.format.escapeless;
+ newline = options.format.newline;
+ space = options.format.space;
+ if (options.format.compact) {
+ newline = space = indent = base = '';
+ }
+ parentheses = options.format.parentheses;
+ semicolons = options.format.semicolons;
+ safeConcatenation = options.format.safeConcatenation;
+ directive = options.directive;
+ parse = json ? null : options.parse;
+ sourceMap = options.sourceMap;
+ extra = options;
+ if (sourceMap) {
+ if (!exports.browser) {
+ SourceNode = require('/node_modules/source-map/lib/source-map.js', module).SourceNode;
+ } else {
+ SourceNode = global.sourceMap.SourceNode;
+ }
+ } else {
+ SourceNode = SourceNodeMock;
+ }
+ switch (node.type) {
+ case Syntax.BlockStatement:
+ case Syntax.BreakStatement:
+ case Syntax.CatchClause:
+ case Syntax.ContinueStatement:
+ case Syntax.DirectiveStatement:
+ case Syntax.DoWhileStatement:
+ case Syntax.DebuggerStatement:
+ case Syntax.EmptyStatement:
+ case Syntax.ExpressionStatement:
+ case Syntax.ForStatement:
+ case Syntax.ForInStatement:
+ case Syntax.FunctionDeclaration:
+ case Syntax.IfStatement:
+ case Syntax.LabeledStatement:
+ case Syntax.Program:
+ case Syntax.ReturnStatement:
+ case Syntax.SwitchStatement:
+ case Syntax.SwitchCase:
+ case Syntax.ThrowStatement:
+ case Syntax.TryStatement:
+ case Syntax.VariableDeclaration:
+ case Syntax.VariableDeclarator:
+ case Syntax.WhileStatement:
+ case Syntax.WithStatement:
+ result = generateStatement(node);
+ break;
+ case Syntax.AssignmentExpression:
+ case Syntax.ArrayExpression:
+ case Syntax.ArrayPattern:
+ case Syntax.BinaryExpression:
+ case Syntax.CallExpression:
+ case Syntax.ConditionalExpression:
+ case Syntax.FunctionExpression:
+ case Syntax.Identifier:
+ case Syntax.Literal:
+ case Syntax.LogicalExpression:
+ case Syntax.MemberExpression:
+ case Syntax.NewExpression:
+ case Syntax.ObjectExpression:
+ case Syntax.ObjectPattern:
+ case Syntax.Property:
+ case Syntax.SequenceExpression:
+ case Syntax.ThisExpression:
+ case Syntax.UnaryExpression:
+ case Syntax.UpdateExpression:
+ case Syntax.YieldExpression:
+ result = generateExpression(node, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ });
+ break;
+ default:
+ throw new Error('Unknown node type: ' + node.type);
+ }
+ if (!sourceMap) {
+ return result.toString();
+ }
+ pair = result.toStringWithSourceMap({
+ file: options.file,
+ sourceRoot: options.sourceMapRoot
+ });
+ if (options.sourceContent) {
+ pair.map.setSourceContent(options.sourceMap, options.sourceContent);
+ }
+ if (options.sourceMapWithCode) {
+ return pair;
+ }
+ return pair.map.toString();
+ }
+ FORMAT_MINIFY = {
+ indent: {
+ style: '',
+ base: 0
+ },
+ renumber: true,
+ hexadecimal: true,
+ quotes: 'auto',
+ escapeless: true,
+ compact: true,
+ parentheses: false,
+ semicolons: false
+ };
+ FORMAT_DEFAULTS = getDefaultOptions().format;
+ exports.version = require('/package.json', module).version;
+ exports.generate = generate;
+ exports.attachComments = estraverse.attachComments;
+ exports.browser = false;
+ exports.FORMAT_MINIFY = FORMAT_MINIFY;
+ exports.FORMAT_DEFAULTS = FORMAT_DEFAULTS;
+ }());
+ });
+ require.define('/package.json', function (module, exports, __dirname, __filename) {
+ module.exports = {
+ 'name': 'escodegen',
+ 'description': 'ECMAScript code generator',
+ 'homepage': 'http://github.com/Constellation/escodegen',
+ 'main': 'escodegen.js',
+ 'bin': {
+ 'esgenerate': './bin/esgenerate.js',
+ 'escodegen': './bin/escodegen.js'
+ },
+ 'version': '1.0.1-dev',
+ 'engines': { 'node': '>=0.4.0' },
+ 'maintainers': [{
+ 'name': 'Yusuke Suzuki',
+ 'email': 'utatane.tea@gmail.com',
+ 'web': 'http://github.com/Constellation'
+ }],
+ 'repository': {
+ 'type': 'git',
+ 'url': 'http://github.com/Constellation/escodegen.git'
+ },
+ 'dependencies': {
+ 'esprima': '~1.0.4',
+ 'estraverse': '~1.5.0',
+ 'esutils': '~1.0.0'
+ },
+ 'optionalDependencies': { 'source-map': '~0.1.30' },
+ 'devDependencies': {
+ 'esprima-moz': '*',
+ 'commonjs-everywhere': '~0.8.0',
+ 'q': '*',
+ 'bower': '*',
+ 'semver': '*',
+ 'chai': '~1.7.2',
+ 'grunt-contrib-jshint': '~0.5.0',
+ 'grunt-cli': '~0.1.9',
+ 'grunt': '~0.4.1',
+ 'grunt-mocha-test': '~0.6.2'
+ },
+ 'licenses': [{
+ 'type': 'BSD',
+ 'url': 'http://github.com/Constellation/escodegen/raw/master/LICENSE.BSD'
+ }],
+ 'scripts': {
+ 'test': 'grunt travis',
+ 'unit-test': 'grunt test',
+ 'lint': 'grunt lint',
+ 'release': 'node tools/release.js',
+ 'build-min': './node_modules/.bin/cjsify -ma path: tools/entry-point.js > escodegen.browser.min.js',
+ 'build': './node_modules/.bin/cjsify -a path: tools/entry-point.js > escodegen.browser.js'
+ }
+ };
+ });
+ require.define('/node_modules/source-map/lib/source-map.js', function (module, exports, __dirname, __filename) {
+ exports.SourceMapGenerator = require('/node_modules/source-map/lib/source-map/source-map-generator.js', module).SourceMapGenerator;
+ exports.SourceMapConsumer = require('/node_modules/source-map/lib/source-map/source-map-consumer.js', module).SourceMapConsumer;
+ exports.SourceNode = require('/node_modules/source-map/lib/source-map/source-node.js', module).SourceNode;
+ });
+ require.define('/node_modules/source-map/lib/source-map/source-node.js', function (module, exports, __dirname, __filename) {
+ if (typeof define !== 'function') {
+ var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);
+ }
+ define(function (require, exports, module) {
+ var SourceMapGenerator = require('/node_modules/source-map/lib/source-map/source-map-generator.js', module).SourceMapGenerator;
+ var util = require('/node_modules/source-map/lib/source-map/util.js', module);
+ function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
+ this.children = [];
+ this.sourceContents = {};
+ this.line = aLine === undefined ? null : aLine;
+ this.column = aColumn === undefined ? null : aColumn;
+ this.source = aSource === undefined ? null : aSource;
+ this.name = aName === undefined ? null : aName;
+ if (aChunks != null)
+ this.add(aChunks);
+ }
+ SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) {
+ var node = new SourceNode;
+ var remainingLines = aGeneratedCode.split('\n');
+ var lastGeneratedLine = 1, lastGeneratedColumn = 0;
+ var lastMapping = null;
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ if (lastMapping === null) {
+ while (lastGeneratedLine < mapping.generatedLine) {
+ node.add(remainingLines.shift() + '\n');
+ lastGeneratedLine++;
+ }
+ if (lastGeneratedColumn < mapping.generatedColumn) {
+ var nextLine = remainingLines[0];
+ node.add(nextLine.substr(0, mapping.generatedColumn));
+ remainingLines[0] = nextLine.substr(mapping.generatedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ }
+ } else {
+ if (lastGeneratedLine < mapping.generatedLine) {
+ var code = '';
+ do {
+ code += remainingLines.shift() + '\n';
+ lastGeneratedLine++;
+ lastGeneratedColumn = 0;
+ } while (lastGeneratedLine < mapping.generatedLine);
+ if (lastGeneratedColumn < mapping.generatedColumn) {
+ var nextLine = remainingLines[0];
+ code += nextLine.substr(0, mapping.generatedColumn);
+ remainingLines[0] = nextLine.substr(mapping.generatedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ }
+ addMappingWithCode(lastMapping, code);
+ } else {
+ var nextLine = remainingLines[0];
+ var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
+ remainingLines[0] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ addMappingWithCode(lastMapping, code);
+ }
+ }
+ lastMapping = mapping;
+ }, this);
+ addMappingWithCode(lastMapping, remainingLines.join('\n'));
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content) {
+ node.setSourceContent(sourceFile, content);
+ }
+ });
+ return node;
+ function addMappingWithCode(mapping, code) {
+ if (mapping === null || mapping.source === undefined) {
+ node.add(code);
+ } else {
+ node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, mapping.source, code, mapping.name));
+ }
+ }
+ };
+ SourceNode.prototype.add = function SourceNode_add(aChunk) {
+ if (Array.isArray(aChunk)) {
+ aChunk.forEach(function (chunk) {
+ this.add(chunk);
+ }, this);
+ } else if (aChunk instanceof SourceNode || typeof aChunk === 'string') {
+ if (aChunk) {
+ this.children.push(aChunk);
+ }
+ } else {
+ throw new TypeError('Expected a SourceNode, string, or an array of SourceNodes and strings. Got ' + aChunk);
+ }
+ return this;
+ };
+ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
+ if (Array.isArray(aChunk)) {
+ for (var i = aChunk.length - 1; i >= 0; i--) {
+ this.prepend(aChunk[i]);
+ }
+ } else if (aChunk instanceof SourceNode || typeof aChunk === 'string') {
+ this.children.unshift(aChunk);
+ } else {
+ throw new TypeError('Expected a SourceNode, string, or an array of SourceNodes and strings. Got ' + aChunk);
+ }
+ return this;
+ };
+ SourceNode.prototype.walk = function SourceNode_walk(aFn) {
+ var chunk;
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ chunk = this.children[i];
+ if (chunk instanceof SourceNode) {
+ chunk.walk(aFn);
+ } else {
+ if (chunk !== '') {
+ aFn(chunk, {
+ source: this.source,
+ line: this.line,
+ column: this.column,
+ name: this.name
+ });
+ }
+ }
+ }
+ };
+ SourceNode.prototype.join = function SourceNode_join(aSep) {
+ var newChildren;
+ var i;
+ var len = this.children.length;
+ if (len > 0) {
+ newChildren = [];
+ for (i = 0; i < len - 1; i++) {
+ newChildren.push(this.children[i]);
+ newChildren.push(aSep);
+ }
+ newChildren.push(this.children[i]);
+ this.children = newChildren;
+ }
+ return this;
+ };
+ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
+ var lastChild = this.children[this.children.length - 1];
+ if (lastChild instanceof SourceNode) {
+ lastChild.replaceRight(aPattern, aReplacement);
+ } else if (typeof lastChild === 'string') {
+ this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
+ } else {
+ this.children.push(''.replace(aPattern, aReplacement));
+ }
+ return this;
+ };
+ SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
+ };
+ SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ if (this.children[i] instanceof SourceNode) {
+ this.children[i].walkSourceContents(aFn);
+ }
+ }
+ var sources = Object.keys(this.sourceContents);
+ for (var i = 0, len = sources.length; i < len; i++) {
+ aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
+ }
+ };
+ SourceNode.prototype.toString = function SourceNode_toString() {
+ var str = '';
+ this.walk(function (chunk) {
+ str += chunk;
+ });
+ return str;
+ };
+ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
+ var generated = {
+ code: '',
+ line: 1,
+ column: 0
+ };
+ var map = new SourceMapGenerator(aArgs);
+ var sourceMappingActive = false;
+ var lastOriginalSource = null;
+ var lastOriginalLine = null;
+ var lastOriginalColumn = null;
+ var lastOriginalName = null;
+ this.walk(function (chunk, original) {
+ generated.code += chunk;
+ if (original.source !== null && original.line !== null && original.column !== null) {
+ if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ lastOriginalSource = original.source;
+ lastOriginalLine = original.line;
+ lastOriginalColumn = original.column;
+ lastOriginalName = original.name;
+ sourceMappingActive = true;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ generated: {
+ line: generated.line,
+ column: generated.column
+ }
+ });
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ }
+ chunk.split('').forEach(function (ch) {
+ if (ch === '\n') {
+ generated.line++;
+ generated.column = 0;
+ } else {
+ generated.column++;
+ }
+ });
+ });
+ this.walkSourceContents(function (sourceFile, sourceContent) {
+ map.setSourceContent(sourceFile, sourceContent);
+ });
+ return {
+ code: generated.code,
+ map: map
+ };
+ };
+ exports.SourceNode = SourceNode;
+ });
+ });
+ require.define('/node_modules/source-map/lib/source-map/util.js', function (module, exports, __dirname, __filename) {
+ if (typeof define !== 'function') {
+ var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);
+ }
+ define(function (require, exports, module) {
+ function getArg(aArgs, aName, aDefaultValue) {
+ if (aName in aArgs) {
+ return aArgs[aName];
+ } else if (arguments.length === 3) {
+ return aDefaultValue;
+ } else {
+ throw new Error('"' + aName + '" is a required argument.');
+ }
+ }
+ exports.getArg = getArg;
+ var urlRegexp = /([\w+\-.]+):\/\/((\w+:\w+)@)?([\w.]+)?(:(\d+))?(\S+)?/;
+ var dataUrlRegexp = /^data:.+\,.+/;
+ function urlParse(aUrl) {
+ var match = aUrl.match(urlRegexp);
+ if (!match) {
+ return null;
+ }
+ return {
+ scheme: match[1],
+ auth: match[3],
+ host: match[4],
+ port: match[6],
+ path: match[7]
+ };
+ }
+ exports.urlParse = urlParse;
+ function urlGenerate(aParsedUrl) {
+ var url = aParsedUrl.scheme + '://';
+ if (aParsedUrl.auth) {
+ url += aParsedUrl.auth + '@';
+ }
+ if (aParsedUrl.host) {
+ url += aParsedUrl.host;
+ }
+ if (aParsedUrl.port) {
+ url += ':' + aParsedUrl.port;
+ }
+ if (aParsedUrl.path) {
+ url += aParsedUrl.path;
+ }
+ return url;
+ }
+ exports.urlGenerate = urlGenerate;
+ function join(aRoot, aPath) {
+ var url;
+ if (aPath.match(urlRegexp) || aPath.match(dataUrlRegexp)) {
+ return aPath;
+ }
+ if (aPath.charAt(0) === '/' && (url = urlParse(aRoot))) {
+ url.path = aPath;
+ return urlGenerate(url);
+ }
+ return aRoot.replace(/\/$/, '') + '/' + aPath;
+ }
+ exports.join = join;
+ function toSetString(aStr) {
+ return '$' + aStr;
+ }
+ exports.toSetString = toSetString;
+ function fromSetString(aStr) {
+ return aStr.substr(1);
+ }
+ exports.fromSetString = fromSetString;
+ function relative(aRoot, aPath) {
+ aRoot = aRoot.replace(/\/$/, '');
+ var url = urlParse(aRoot);
+ if (aPath.charAt(0) == '/' && url && url.path == '/') {
+ return aPath.slice(1);
+ }
+ return aPath.indexOf(aRoot + '/') === 0 ? aPath.substr(aRoot.length + 1) : aPath;
+ }
+ exports.relative = relative;
+ function strcmp(aStr1, aStr2) {
+ var s1 = aStr1 || '';
+ var s2 = aStr2 || '';
+ return (s1 > s2) - (s1 < s2);
+ }
+ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
+ var cmp;
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp) {
+ return cmp;
+ }
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp) {
+ return cmp;
+ }
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp || onlyCompareOriginal) {
+ return cmp;
+ }
+ cmp = strcmp(mappingA.name, mappingB.name);
+ if (cmp) {
+ return cmp;
+ }
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp) {
+ return cmp;
+ }
+ return mappingA.generatedColumn - mappingB.generatedColumn;
+ }
+ ;
+ exports.compareByOriginalPositions = compareByOriginalPositions;
+ function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) {
+ var cmp;
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp) {
+ return cmp;
+ }
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp || onlyCompareGenerated) {
+ return cmp;
+ }
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp) {
+ return cmp;
+ }
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp) {
+ return cmp;
+ }
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp) {
+ return cmp;
+ }
+ return strcmp(mappingA.name, mappingB.name);
+ }
+ ;
+ exports.compareByGeneratedPositions = compareByGeneratedPositions;
+ });
+ });
+ require.define('/node_modules/source-map/node_modules/amdefine/amdefine.js', function (module, exports, __dirname, __filename) {
+ 'use strict';
+ function amdefine(module, requireFn) {
+ 'use strict';
+ var defineCache = {}, loaderCache = {}, alreadyCalled = false, path = require('path', module), makeRequire, stringRequire;
+ function trimDots(ary) {
+ var i, part;
+ for (i = 0; ary[i]; i += 1) {
+ part = ary[i];
+ if (part === '.') {
+ ary.splice(i, 1);
+ i -= 1;
+ } else if (part === '..') {
+ if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {
+ break;
+ } else if (i > 0) {
+ ary.splice(i - 1, 2);
+ i -= 2;
+ }
+ }
+ }
+ }
+ function normalize(name, baseName) {
+ var baseParts;
+ if (name && name.charAt(0) === '.') {
+ if (baseName) {
+ baseParts = baseName.split('/');
+ baseParts = baseParts.slice(0, baseParts.length - 1);
+ baseParts = baseParts.concat(name.split('/'));
+ trimDots(baseParts);
+ name = baseParts.join('/');
+ }
+ }
+ return name;
+ }
+ function makeNormalize(relName) {
+ return function (name) {
+ return normalize(name, relName);
+ };
+ }
+ function makeLoad(id) {
+ function load(value) {
+ loaderCache[id] = value;
+ }
+ load.fromText = function (id, text) {
+ throw new Error('amdefine does not implement load.fromText');
+ };
+ return load;
+ }
+ makeRequire = function (systemRequire, exports, module, relId) {
+ function amdRequire(deps, callback) {
+ if (typeof deps === 'string') {
+ return stringRequire(systemRequire, exports, module, deps, relId);
+ } else {
+ deps = deps.map(function (depName) {
+ return stringRequire(systemRequire, exports, module, depName, relId);
+ });
+ process.nextTick(function () {
+ callback.apply(null, deps);
+ });
+ }
+ }
+ amdRequire.toUrl = function (filePath) {
+ if (filePath.indexOf('.') === 0) {
+ return normalize(filePath, path.dirname(module.filename));
+ } else {
+ return filePath;
+ }
+ };
+ return amdRequire;
+ };
+ requireFn = requireFn || function req() {
+ return module.require.apply(module, arguments);
+ };
+ function runFactory(id, deps, factory) {
+ var r, e, m, result;
+ if (id) {
+ e = loaderCache[id] = {};
+ m = {
+ id: id,
+ uri: __filename,
+ exports: e
+ };
+ r = makeRequire(requireFn, e, m, id);
+ } else {
+ if (alreadyCalled) {
+ throw new Error('amdefine with no module ID cannot be called more than once per file.');
+ }
+ alreadyCalled = true;
+ e = module.exports;
+ m = module;
+ r = makeRequire(requireFn, e, m, module.id);
+ }
+ if (deps) {
+ deps = deps.map(function (depName) {
+ return r(depName);
+ });
+ }
+ if (typeof factory === 'function') {
+ result = factory.apply(m.exports, deps);
+ } else {
+ result = factory;
+ }
+ if (result !== undefined) {
+ m.exports = result;
+ if (id) {
+ loaderCache[id] = m.exports;
+ }
+ }
+ }
+ stringRequire = function (systemRequire, exports, module, id, relId) {
+ var index = id.indexOf('!'), originalId = id, prefix, plugin;
+ if (index === -1) {
+ id = normalize(id, relId);
+ if (id === 'require') {
+ return makeRequire(systemRequire, exports, module, relId);
+ } else if (id === 'exports') {
+ return exports;
+ } else if (id === 'module') {
+ return module;
+ } else if (loaderCache.hasOwnProperty(id)) {
+ return loaderCache[id];
+ } else if (defineCache[id]) {
+ runFactory.apply(null, defineCache[id]);
+ return loaderCache[id];
+ } else {
+ if (systemRequire) {
+ return systemRequire(originalId);
+ } else {
+ throw new Error('No module with ID: ' + id);
+ }
+ }
+ } else {
+ prefix = id.substring(0, index);
+ id = id.substring(index + 1, id.length);
+ plugin = stringRequire(systemRequire, exports, module, prefix, relId);
+ if (plugin.normalize) {
+ id = plugin.normalize(id, makeNormalize(relId));
+ } else {
+ id = normalize(id, relId);
+ }
+ if (loaderCache[id]) {
+ return loaderCache[id];
+ } else {
+ plugin.load(id, makeRequire(systemRequire, exports, module, relId), makeLoad(id), {});
+ return loaderCache[id];
+ }
+ }
+ };
+ function define(id, deps, factory) {
+ if (Array.isArray(id)) {
+ factory = deps;
+ deps = id;
+ id = undefined;
+ } else if (typeof id !== 'string') {
+ factory = id;
+ id = deps = undefined;
+ }
+ if (deps && !Array.isArray(deps)) {
+ factory = deps;
+ deps = undefined;
+ }
+ if (!deps) {
+ deps = [
+ 'require',
+ 'exports',
+ 'module'
+ ];
+ }
+ if (id) {
+ defineCache[id] = [
+ id,
+ deps,
+ factory
+ ];
+ } else {
+ runFactory(id, deps, factory);
+ }
+ }
+ define.require = function (id) {
+ if (loaderCache[id]) {
+ return loaderCache[id];
+ }
+ if (defineCache[id]) {
+ runFactory.apply(null, defineCache[id]);
+ return loaderCache[id];
+ }
+ };
+ define.amd = {};
+ return define;
+ }
+ module.exports = amdefine;
+ });
+ require.define('/node_modules/source-map/lib/source-map/source-map-generator.js', function (module, exports, __dirname, __filename) {
+ if (typeof define !== 'function') {
+ var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);
+ }
+ define(function (require, exports, module) {
+ var base64VLQ = require('/node_modules/source-map/lib/source-map/base64-vlq.js', module);
+ var util = require('/node_modules/source-map/lib/source-map/util.js', module);
+ var ArraySet = require('/node_modules/source-map/lib/source-map/array-set.js', module).ArraySet;
+ function SourceMapGenerator(aArgs) {
+ this._file = util.getArg(aArgs, 'file');
+ this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
+ this._sources = new ArraySet;
+ this._names = new ArraySet;
+ this._mappings = [];
+ this._sourcesContents = null;
+ }
+ SourceMapGenerator.prototype._version = 3;
+ SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
+ var sourceRoot = aSourceMapConsumer.sourceRoot;
+ var generator = new SourceMapGenerator({
+ file: aSourceMapConsumer.file,
+ sourceRoot: sourceRoot
+ });
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ var newMapping = {
+ generated: {
+ line: mapping.generatedLine,
+ column: mapping.generatedColumn
+ }
+ };
+ if (mapping.source) {
+ newMapping.source = mapping.source;
+ if (sourceRoot) {
+ newMapping.source = util.relative(sourceRoot, newMapping.source);
+ }
+ newMapping.original = {
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ };
+ if (mapping.name) {
+ newMapping.name = mapping.name;
+ }
+ }
+ generator.addMapping(newMapping);
+ });
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content) {
+ generator.setSourceContent(sourceFile, content);
+ }
+ });
+ return generator;
+ };
+ SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
+ var generated = util.getArg(aArgs, 'generated');
+ var original = util.getArg(aArgs, 'original', null);
+ var source = util.getArg(aArgs, 'source', null);
+ var name = util.getArg(aArgs, 'name', null);
+ this._validateMapping(generated, original, source, name);
+ if (source && !this._sources.has(source)) {
+ this._sources.add(source);
+ }
+ if (name && !this._names.has(name)) {
+ this._names.add(name);
+ }
+ this._mappings.push({
+ generatedLine: generated.line,
+ generatedColumn: generated.column,
+ originalLine: original != null && original.line,
+ originalColumn: original != null && original.column,
+ source: source,
+ name: name
+ });
+ };
+ SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
+ var source = aSourceFile;
+ if (this._sourceRoot) {
+ source = util.relative(this._sourceRoot, source);
+ }
+ if (aSourceContent !== null) {
+ if (!this._sourcesContents) {
+ this._sourcesContents = {};
+ }
+ this._sourcesContents[util.toSetString(source)] = aSourceContent;
+ } else {
+ delete this._sourcesContents[util.toSetString(source)];
+ if (Object.keys(this._sourcesContents).length === 0) {
+ this._sourcesContents = null;
+ }
+ }
+ };
+ SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile) {
+ if (!aSourceFile) {
+ aSourceFile = aSourceMapConsumer.file;
+ }
+ var sourceRoot = this._sourceRoot;
+ if (sourceRoot) {
+ aSourceFile = util.relative(sourceRoot, aSourceFile);
+ }
+ var newSources = new ArraySet;
+ var newNames = new ArraySet;
+ this._mappings.forEach(function (mapping) {
+ if (mapping.source === aSourceFile && mapping.originalLine) {
+ var original = aSourceMapConsumer.originalPositionFor({
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ });
+ if (original.source !== null) {
+ if (sourceRoot) {
+ mapping.source = util.relative(sourceRoot, original.source);
+ } else {
+ mapping.source = original.source;
+ }
+ mapping.originalLine = original.line;
+ mapping.originalColumn = original.column;
+ if (original.name !== null && mapping.name !== null) {
+ mapping.name = original.name;
+ }
+ }
+ }
+ var source = mapping.source;
+ if (source && !newSources.has(source)) {
+ newSources.add(source);
+ }
+ var name = mapping.name;
+ if (name && !newNames.has(name)) {
+ newNames.add(name);
+ }
+ }, this);
+ this._sources = newSources;
+ this._names = newNames;
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content) {
+ if (sourceRoot) {
+ sourceFile = util.relative(sourceRoot, sourceFile);
+ }
+ this.setSourceContent(sourceFile, content);
+ }
+ }, this);
+ };
+ SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
+ if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
+ return;
+ } else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
+ return;
+ } else {
+ throw new Error('Invalid mapping: ' + JSON.stringify({
+ generated: aGenerated,
+ source: aSource,
+ orginal: aOriginal,
+ name: aName
+ }));
+ }
+ };
+ SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
+ var previousGeneratedColumn = 0;
+ var previousGeneratedLine = 1;
+ var previousOriginalColumn = 0;
+ var previousOriginalLine = 0;
+ var previousName = 0;
+ var previousSource = 0;
+ var result = '';
+ var mapping;
+ this._mappings.sort(util.compareByGeneratedPositions);
+ for (var i = 0, len = this._mappings.length; i < len; i++) {
+ mapping = this._mappings[i];
+ if (mapping.generatedLine !== previousGeneratedLine) {
+ previousGeneratedColumn = 0;
+ while (mapping.generatedLine !== previousGeneratedLine) {
+ result += ';';
+ previousGeneratedLine++;
+ }
+ } else {
+ if (i > 0) {
+ if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) {
+ continue;
+ }
+ result += ',';
+ }
+ }
+ result += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
+ previousGeneratedColumn = mapping.generatedColumn;
+ if (mapping.source) {
+ result += base64VLQ.encode(this._sources.indexOf(mapping.source) - previousSource);
+ previousSource = this._sources.indexOf(mapping.source);
+ result += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
+ previousOriginalLine = mapping.originalLine - 1;
+ result += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
+ previousOriginalColumn = mapping.originalColumn;
+ if (mapping.name) {
+ result += base64VLQ.encode(this._names.indexOf(mapping.name) - previousName);
+ previousName = this._names.indexOf(mapping.name);
+ }
+ }
+ }
+ return result;
+ };
+ SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
+ return aSources.map(function (source) {
+ if (!this._sourcesContents) {
+ return null;
+ }
+ if (aSourceRoot) {
+ source = util.relative(aSourceRoot, source);
+ }
+ var key = util.toSetString(source);
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
+ }, this);
+ };
+ SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
+ var map = {
+ version: this._version,
+ file: this._file,
+ sources: this._sources.toArray(),
+ names: this._names.toArray(),
+ mappings: this._serializeMappings()
+ };
+ if (this._sourceRoot) {
+ map.sourceRoot = this._sourceRoot;
+ }
+ if (this._sourcesContents) {
+ map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
+ }
+ return map;
+ };
+ SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
+ return JSON.stringify(this);
+ };
+ exports.SourceMapGenerator = SourceMapGenerator;
+ });
+ });
+ require.define('/node_modules/source-map/lib/source-map/array-set.js', function (module, exports, __dirname, __filename) {
+ if (typeof define !== 'function') {
+ var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);
+ }
+ define(function (require, exports, module) {
+ var util = require('/node_modules/source-map/lib/source-map/util.js', module);
+ function ArraySet() {
+ this._array = [];
+ this._set = {};
+ }
+ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
+ var set = new ArraySet;
+ for (var i = 0, len = aArray.length; i < len; i++) {
+ set.add(aArray[i], aAllowDuplicates);
+ }
+ return set;
+ };
+ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
+ var isDuplicate = this.has(aStr);
+ var idx = this._array.length;
+ if (!isDuplicate || aAllowDuplicates) {
+ this._array.push(aStr);
+ }
+ if (!isDuplicate) {
+ this._set[util.toSetString(aStr)] = idx;
+ }
+ };
+ ArraySet.prototype.has = function ArraySet_has(aStr) {
+ return Object.prototype.hasOwnProperty.call(this._set, util.toSetString(aStr));
+ };
+ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
+ if (this.has(aStr)) {
+ return this._set[util.toSetString(aStr)];
+ }
+ throw new Error('"' + aStr + '" is not in the set.');
+ };
+ ArraySet.prototype.at = function ArraySet_at(aIdx) {
+ if (aIdx >= 0 && aIdx < this._array.length) {
+ return this._array[aIdx];
+ }
+ throw new Error('No element indexed by ' + aIdx);
+ };
+ ArraySet.prototype.toArray = function ArraySet_toArray() {
+ return this._array.slice();
+ };
+ exports.ArraySet = ArraySet;
+ });
+ });
+ require.define('/node_modules/source-map/lib/source-map/base64-vlq.js', function (module, exports, __dirname, __filename) {
+ if (typeof define !== 'function') {
+ var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);
+ }
+ define(function (require, exports, module) {
+ var base64 = require('/node_modules/source-map/lib/source-map/base64.js', module);
+ var VLQ_BASE_SHIFT = 5;
+ var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
+ var VLQ_BASE_MASK = VLQ_BASE - 1;
+ var VLQ_CONTINUATION_BIT = VLQ_BASE;
+ function toVLQSigned(aValue) {
+ return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
+ }
+ function fromVLQSigned(aValue) {
+ var isNegative = (aValue & 1) === 1;
+ var shifted = aValue >> 1;
+ return isNegative ? -shifted : shifted;
+ }
+ exports.encode = function base64VLQ_encode(aValue) {
+ var encoded = '';
+ var digit;
+ var vlq = toVLQSigned(aValue);
+ do {
+ digit = vlq & VLQ_BASE_MASK;
+ vlq >>>= VLQ_BASE_SHIFT;
+ if (vlq > 0) {
+ digit |= VLQ_CONTINUATION_BIT;
+ }
+ encoded += base64.encode(digit);
+ } while (vlq > 0);
+ return encoded;
+ };
+ exports.decode = function base64VLQ_decode(aStr) {
+ var i = 0;
+ var strLen = aStr.length;
+ var result = 0;
+ var shift = 0;
+ var continuation, digit;
+ do {
+ if (i >= strLen) {
+ throw new Error('Expected more digits in base 64 VLQ value.');
+ }
+ digit = base64.decode(aStr.charAt(i++));
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
+ digit &= VLQ_BASE_MASK;
+ result = result + (digit << shift);
+ shift += VLQ_BASE_SHIFT;
+ } while (continuation);
+ return {
+ value: fromVLQSigned(result),
+ rest: aStr.slice(i)
+ };
+ };
+ });
+ });
+ require.define('/node_modules/source-map/lib/source-map/base64.js', function (module, exports, __dirname, __filename) {
+ if (typeof define !== 'function') {
+ var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);
+ }
+ define(function (require, exports, module) {
+ var charToIntMap = {};
+ var intToCharMap = {};
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('').forEach(function (ch, index) {
+ charToIntMap[ch] = index;
+ intToCharMap[index] = ch;
+ });
+ exports.encode = function base64_encode(aNumber) {
+ if (aNumber in intToCharMap) {
+ return intToCharMap[aNumber];
+ }
+ throw new TypeError('Must be between 0 and 63: ' + aNumber);
+ };
+ exports.decode = function base64_decode(aChar) {
+ if (aChar in charToIntMap) {
+ return charToIntMap[aChar];
+ }
+ throw new TypeError('Not a valid base 64 digit: ' + aChar);
+ };
+ });
+ });
+ require.define('/node_modules/source-map/lib/source-map/source-map-consumer.js', function (module, exports, __dirname, __filename) {
+ if (typeof define !== 'function') {
+ var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);
+ }
+ define(function (require, exports, module) {
+ var util = require('/node_modules/source-map/lib/source-map/util.js', module);
+ var binarySearch = require('/node_modules/source-map/lib/source-map/binary-search.js', module);
+ var ArraySet = require('/node_modules/source-map/lib/source-map/array-set.js', module).ArraySet;
+ var base64VLQ = require('/node_modules/source-map/lib/source-map/base64-vlq.js', module);
+ function SourceMapConsumer(aSourceMap) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
+ }
+ var version = util.getArg(sourceMap, 'version');
+ var sources = util.getArg(sourceMap, 'sources');
+ var names = util.getArg(sourceMap, 'names', []);
+ var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
+ var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
+ var mappings = util.getArg(sourceMap, 'mappings');
+ var file = util.getArg(sourceMap, 'file', null);
+ if (version != this._version) {
+ throw new Error('Unsupported version: ' + version);
+ }
+ this._names = ArraySet.fromArray(names, true);
+ this._sources = ArraySet.fromArray(sources, true);
+ this.sourceRoot = sourceRoot;
+ this.sourcesContent = sourcesContent;
+ this._mappings = mappings;
+ this.file = file;
+ }
+ SourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap) {
+ var smc = Object.create(SourceMapConsumer.prototype);
+ smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
+ smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
+ smc.sourceRoot = aSourceMap._sourceRoot;
+ smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot);
+ smc.file = aSourceMap._file;
+ smc.__generatedMappings = aSourceMap._mappings.slice().sort(util.compareByGeneratedPositions);
+ smc.__originalMappings = aSourceMap._mappings.slice().sort(util.compareByOriginalPositions);
+ return smc;
+ };
+ SourceMapConsumer.prototype._version = 3;
+ Object.defineProperty(SourceMapConsumer.prototype, 'sources', {
+ get: function () {
+ return this._sources.toArray().map(function (s) {
+ return this.sourceRoot ? util.join(this.sourceRoot, s) : s;
+ }, this);
+ }
+ });
+ SourceMapConsumer.prototype.__generatedMappings = null;
+ Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
+ get: function () {
+ if (!this.__generatedMappings) {
+ this.__generatedMappings = [];
+ this.__originalMappings = [];
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+ return this.__generatedMappings;
+ }
+ });
+ SourceMapConsumer.prototype.__originalMappings = null;
+ Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
+ get: function () {
+ if (!this.__originalMappings) {
+ this.__generatedMappings = [];
+ this.__originalMappings = [];
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+ return this.__originalMappings;
+ }
+ });
+ SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ var generatedLine = 1;
+ var previousGeneratedColumn = 0;
+ var previousOriginalLine = 0;
+ var previousOriginalColumn = 0;
+ var previousSource = 0;
+ var previousName = 0;
+ var mappingSeparator = /^[,;]/;
+ var str = aStr;
+ var mapping;
+ var temp;
+ while (str.length > 0) {
+ if (str.charAt(0) === ';') {
+ generatedLine++;
+ str = str.slice(1);
+ previousGeneratedColumn = 0;
+ } else if (str.charAt(0) === ',') {
+ str = str.slice(1);
+ } else {
+ mapping = {};
+ mapping.generatedLine = generatedLine;
+ temp = base64VLQ.decode(str);
+ mapping.generatedColumn = previousGeneratedColumn + temp.value;
+ previousGeneratedColumn = mapping.generatedColumn;
+ str = temp.rest;
+ if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {
+ temp = base64VLQ.decode(str);
+ mapping.source = this._sources.at(previousSource + temp.value);
+ previousSource += temp.value;
+ str = temp.rest;
+ if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {
+ throw new Error('Found a source, but no line and column');
+ }
+ temp = base64VLQ.decode(str);
+ mapping.originalLine = previousOriginalLine + temp.value;
+ previousOriginalLine = mapping.originalLine;
+ mapping.originalLine += 1;
+ str = temp.rest;
+ if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {
+ throw new Error('Found a source and line, but no column');
+ }
+ temp = base64VLQ.decode(str);
+ mapping.originalColumn = previousOriginalColumn + temp.value;
+ previousOriginalColumn = mapping.originalColumn;
+ str = temp.rest;
+ if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {
+ temp = base64VLQ.decode(str);
+ mapping.name = this._names.at(previousName + temp.value);
+ previousName += temp.value;
+ str = temp.rest;
+ }
+ }
+ this.__generatedMappings.push(mapping);
+ if (typeof mapping.originalLine === 'number') {
+ this.__originalMappings.push(mapping);
+ }
+ }
+ }
+ this.__originalMappings.sort(util.compareByOriginalPositions);
+ };
+ SourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator) {
+ if (aNeedle[aLineName] <= 0) {
+ throw new TypeError('Line must be greater than or equal to 1, got ' + aNeedle[aLineName]);
+ }
+ if (aNeedle[aColumnName] < 0) {
+ throw new TypeError('Column must be greater than or equal to 0, got ' + aNeedle[aColumnName]);
+ }
+ return binarySearch.search(aNeedle, aMappings, aComparator);
+ };
+ SourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
+ var needle = {
+ generatedLine: util.getArg(aArgs, 'line'),
+ generatedColumn: util.getArg(aArgs, 'column')
+ };
+ var mapping = this._findMapping(needle, this._generatedMappings, 'generatedLine', 'generatedColumn', util.compareByGeneratedPositions);
+ if (mapping) {
+ var source = util.getArg(mapping, 'source', null);
+ if (source && this.sourceRoot) {
+ source = util.join(this.sourceRoot, source);
+ }
+ return {
+ source: source,
+ line: util.getArg(mapping, 'originalLine', null),
+ column: util.getArg(mapping, 'originalColumn', null),
+ name: util.getArg(mapping, 'name', null)
+ };
+ }
+ return {
+ source: null,
+ line: null,
+ column: null,
+ name: null
+ };
+ };
+ SourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource) {
+ if (!this.sourcesContent) {
+ return null;
+ }
+ if (this.sourceRoot) {
+ aSource = util.relative(this.sourceRoot, aSource);
+ }
+ if (this._sources.has(aSource)) {
+ return this.sourcesContent[this._sources.indexOf(aSource)];
+ }
+ var url;
+ if (this.sourceRoot && (url = util.urlParse(this.sourceRoot))) {
+ var fileUriAbsPath = aSource.replace(/^file:\/\//, '');
+ if (url.scheme == 'file' && this._sources.has(fileUriAbsPath)) {
+ return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
+ }
+ if ((!url.path || url.path == '/') && this._sources.has('/' + aSource)) {
+ return this.sourcesContent[this._sources.indexOf('/' + aSource)];
+ }
+ }
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
+ };
+ SourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
+ var needle = {
+ source: util.getArg(aArgs, 'source'),
+ originalLine: util.getArg(aArgs, 'line'),
+ originalColumn: util.getArg(aArgs, 'column')
+ };
+ if (this.sourceRoot) {
+ needle.source = util.relative(this.sourceRoot, needle.source);
+ }
+ var mapping = this._findMapping(needle, this._originalMappings, 'originalLine', 'originalColumn', util.compareByOriginalPositions);
+ if (mapping) {
+ return {
+ line: util.getArg(mapping, 'generatedLine', null),
+ column: util.getArg(mapping, 'generatedColumn', null)
+ };
+ }
+ return {
+ line: null,
+ column: null
+ };
+ };
+ SourceMapConsumer.GENERATED_ORDER = 1;
+ SourceMapConsumer.ORIGINAL_ORDER = 2;
+ SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
+ var context = aContext || null;
+ var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
+ var mappings;
+ switch (order) {
+ case SourceMapConsumer.GENERATED_ORDER:
+ mappings = this._generatedMappings;
+ break;
+ case SourceMapConsumer.ORIGINAL_ORDER:
+ mappings = this._originalMappings;
+ break;
+ default:
+ throw new Error('Unknown order of iteration.');
+ }
+ var sourceRoot = this.sourceRoot;
+ mappings.map(function (mapping) {
+ var source = mapping.source;
+ if (source && sourceRoot) {
+ source = util.join(sourceRoot, source);
+ }
+ return {
+ source: source,
+ generatedLine: mapping.generatedLine,
+ generatedColumn: mapping.generatedColumn,
+ originalLine: mapping.originalLine,
+ originalColumn: mapping.originalColumn,
+ name: mapping.name
+ };
+ }).forEach(aCallback, context);
+ };
+ exports.SourceMapConsumer = SourceMapConsumer;
+ });
+ });
+ require.define('/node_modules/source-map/lib/source-map/binary-search.js', function (module, exports, __dirname, __filename) {
+ if (typeof define !== 'function') {
+ var define = require('/node_modules/source-map/node_modules/amdefine/amdefine.js', module)(module, require);
+ }
+ define(function (require, exports, module) {
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) {
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
+ if (cmp === 0) {
+ return aHaystack[mid];
+ } else if (cmp > 0) {
+ if (aHigh - mid > 1) {
+ return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare);
+ }
+ return aHaystack[mid];
+ } else {
+ if (mid - aLow > 1) {
+ return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare);
+ }
+ return aLow < 0 ? null : aHaystack[aLow];
+ }
+ }
+ exports.search = function search(aNeedle, aHaystack, aCompare) {
+ return aHaystack.length > 0 ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) : null;
+ };
+ });
+ });
+ require.define('/node_modules/esutils/lib/utils.js', function (module, exports, __dirname, __filename) {
+ (function () {
+ 'use strict';
+ exports.code = require('/node_modules/esutils/lib/code.js', module);
+ exports.keyword = require('/node_modules/esutils/lib/keyword.js', module);
+ }());
+ });
+ require.define('/node_modules/esutils/lib/keyword.js', function (module, exports, __dirname, __filename) {
+ (function () {
+ 'use strict';
+ var code = require('/node_modules/esutils/lib/code.js', module);
+ function isStrictModeReservedWordES6(id) {
+ switch (id) {
+ case 'implements':
+ case 'interface':
+ case 'package':
+ case 'private':
+ case 'protected':
+ case 'public':
+ case 'static':
+ case 'let':
+ return true;
+ default:
+ return false;
+ }
+ }
+ function isKeywordES5(id, strict) {
+ if (!strict && id === 'yield') {
+ return false;
+ }
+ return isKeywordES6(id, strict);
+ }
+ function isKeywordES6(id, strict) {
+ if (strict && isStrictModeReservedWordES6(id)) {
+ return true;
+ }
+ switch (id.length) {
+ case 2:
+ return id === 'if' || id === 'in' || id === 'do';
+ case 3:
+ return id === 'var' || id === 'for' || id === 'new' || id === 'try';
+ case 4:
+ return id === 'this' || id === 'else' || id === 'case' || id === 'void' || id === 'with' || id === 'enum';
+ case 5:
+ return id === 'while' || id === 'break' || id === 'catch' || id === 'throw' || id === 'const' || id === 'yield' || id === 'class' || id === 'super';
+ case 6:
+ return id === 'return' || id === 'typeof' || id === 'delete' || id === 'switch' || id === 'export' || id === 'import';
+ case 7:
+ return id === 'default' || id === 'finally' || id === 'extends';
+ case 8:
+ return id === 'function' || id === 'continue' || id === 'debugger';
+ case 10:
+ return id === 'instanceof';
+ default:
+ return false;
+ }
+ }
+ function isRestrictedWord(id) {
+ return id === 'eval' || id === 'arguments';
+ }
+ function isIdentifierName(id) {
+ var i, iz, ch;
+ if (id.length === 0) {
+ return false;
+ }
+ ch = id.charCodeAt(0);
+ if (!code.isIdentifierStart(ch) || ch === 92) {
+ return false;
+ }
+ for (i = 1, iz = id.length; i < iz; ++i) {
+ ch = id.charCodeAt(i);
+ if (!code.isIdentifierPart(ch) || ch === 92) {
+ return false;
+ }
+ }
+ return true;
+ }
+ module.exports = {
+ isKeywordES5: isKeywordES5,
+ isKeywordES6: isKeywordES6,
+ isRestrictedWord: isRestrictedWord,
+ isIdentifierName: isIdentifierName
+ };
+ }());
+ });
+ require.define('/node_modules/esutils/lib/code.js', function (module, exports, __dirname, __filename) {
+ (function () {
+ 'use strict';
+ var Regex;
+ Regex = {
+ NonAsciiIdentifierStart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]'),
+ NonAsciiIdentifierPart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]')
+ };
+ function isDecimalDigit(ch) {
+ return ch >= 48 && ch <= 57;
+ }
+ function isHexDigit(ch) {
+ return isDecimalDigit(ch) || 97 <= ch && ch <= 102 || 65 <= ch && ch <= 70;
+ }
+ function isOctalDigit(ch) {
+ return ch >= 48 && ch <= 55;
+ }
+ function isWhiteSpace(ch) {
+ return ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch >= 5760 && [
+ 5760,
+ 6158,
+ 8192,
+ 8193,
+ 8194,
+ 8195,
+ 8196,
+ 8197,
+ 8198,
+ 8199,
+ 8200,
+ 8201,
+ 8202,
+ 8239,
+ 8287,
+ 12288,
+ 65279
+ ].indexOf(ch) >= 0;
+ }
+ function isLineTerminator(ch) {
+ return ch === 10 || ch === 13 || ch === 8232 || ch === 8233;
+ }
+ function isIdentifierStart(ch) {
+ return ch === 36 || ch === 95 || ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 92 || ch >= 128 && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch));
+ }
+ function isIdentifierPart(ch) {
+ return ch === 36 || ch === 95 || ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 92 || ch >= 128 && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch));
+ }
+ module.exports = {
+ isDecimalDigit: isDecimalDigit,
+ isHexDigit: isHexDigit,
+ isOctalDigit: isOctalDigit,
+ isWhiteSpace: isWhiteSpace,
+ isLineTerminator: isLineTerminator,
+ isIdentifierStart: isIdentifierStart,
+ isIdentifierPart: isIdentifierPart
+ };
+ }());
+ });
+ require.define('/node_modules/estraverse/estraverse.js', function (module, exports, __dirname, __filename) {
+ (function (root, factory) {
+ 'use strict';
+ if (typeof define === 'function' && define.amd) {
+ define(['exports'], factory);
+ } else if (typeof exports !== 'undefined') {
+ factory(exports);
+ } else {
+ factory(root.estraverse = {});
+ }
+ }(this, function (exports) {
+ 'use strict';
+ var Syntax, isArray, VisitorOption, VisitorKeys, BREAK, SKIP;
+ Syntax = {
+ AssignmentExpression: 'AssignmentExpression',
+ ArrayExpression: 'ArrayExpression',
+ ArrayPattern: 'ArrayPattern',
+ ArrowFunctionExpression: 'ArrowFunctionExpression',
+ BlockStatement: 'BlockStatement',
+ BinaryExpression: 'BinaryExpression',
+ BreakStatement: 'BreakStatement',
+ CallExpression: 'CallExpression',
+ CatchClause: 'CatchClause',
+ ClassBody: 'ClassBody',
+ ClassDeclaration: 'ClassDeclaration',
+ ClassExpression: 'ClassExpression',
+ ConditionalExpression: 'ConditionalExpression',
+ ContinueStatement: 'ContinueStatement',
+ DebuggerStatement: 'DebuggerStatement',
+ DirectiveStatement: 'DirectiveStatement',
+ DoWhileStatement: 'DoWhileStatement',
+ EmptyStatement: 'EmptyStatement',
+ ExpressionStatement: 'ExpressionStatement',
+ ForStatement: 'ForStatement',
+ ForInStatement: 'ForInStatement',
+ FunctionDeclaration: 'FunctionDeclaration',
+ FunctionExpression: 'FunctionExpression',
+ Identifier: 'Identifier',
+ IfStatement: 'IfStatement',
+ Literal: 'Literal',
+ LabeledStatement: 'LabeledStatement',
+ LogicalExpression: 'LogicalExpression',
+ MemberExpression: 'MemberExpression',
+ MethodDefinition: 'MethodDefinition',
+ NewExpression: 'NewExpression',
+ ObjectExpression: 'ObjectExpression',
+ ObjectPattern: 'ObjectPattern',
+ Program: 'Program',
+ Property: 'Property',
+ ReturnStatement: 'ReturnStatement',
+ SequenceExpression: 'SequenceExpression',
+ SwitchStatement: 'SwitchStatement',
+ SwitchCase: 'SwitchCase',
+ ThisExpression: 'ThisExpression',
+ ThrowStatement: 'ThrowStatement',
+ TryStatement: 'TryStatement',
+ UnaryExpression: 'UnaryExpression',
+ UpdateExpression: 'UpdateExpression',
+ VariableDeclaration: 'VariableDeclaration',
+ VariableDeclarator: 'VariableDeclarator',
+ WhileStatement: 'WhileStatement',
+ WithStatement: 'WithStatement',
+ YieldExpression: 'YieldExpression'
+ };
+ function ignoreJSHintError() {
+ }
+ isArray = Array.isArray;
+ if (!isArray) {
+ isArray = function isArray(array) {
+ return Object.prototype.toString.call(array) === '[object Array]';
+ };
+ }
+ function deepCopy(obj) {
+ var ret = {}, key, val;
+ for (key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ val = obj[key];
+ if (typeof val === 'object' && val !== null) {
+ ret[key] = deepCopy(val);
+ } else {
+ ret[key] = val;
+ }
+ }
+ }
+ return ret;
+ }
+ function shallowCopy(obj) {
+ var ret = {}, key;
+ for (key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ ret[key] = obj[key];
+ }
+ }
+ return ret;
+ }
+ ignoreJSHintError(shallowCopy);
+ function upperBound(array, func) {
+ var diff, len, i, current;
+ len = array.length;
+ i = 0;
+ while (len) {
+ diff = len >>> 1;
+ current = i + diff;
+ if (func(array[current])) {
+ len = diff;
+ } else {
+ i = current + 1;
+ len -= diff + 1;
+ }
+ }
+ return i;
+ }
+ function lowerBound(array, func) {
+ var diff, len, i, current;
+ len = array.length;
+ i = 0;
+ while (len) {
+ diff = len >>> 1;
+ current = i + diff;
+ if (func(array[current])) {
+ i = current + 1;
+ len -= diff + 1;
+ } else {
+ len = diff;
+ }
+ }
+ return i;
+ }
+ ignoreJSHintError(lowerBound);
+ VisitorKeys = {
+ AssignmentExpression: [
+ 'left',
+ 'right'
+ ],
+ ArrayExpression: ['elements'],
+ ArrayPattern: ['elements'],
+ ArrowFunctionExpression: [
+ 'params',
+ 'defaults',
+ 'rest',
+ 'body'
+ ],
+ BlockStatement: ['body'],
+ BinaryExpression: [
+ 'left',
+ 'right'
+ ],
+ BreakStatement: ['label'],
+ CallExpression: [
+ 'callee',
+ 'arguments'
+ ],
+ CatchClause: [
+ 'param',
+ 'body'
+ ],
+ ClassBody: ['body'],
+ ClassDeclaration: [
+ 'id',
+ 'body',
+ 'superClass'
+ ],
+ ClassExpression: [
+ 'id',
+ 'body',
+ 'superClass'
+ ],
+ ConditionalExpression: [
+ 'test',
+ 'consequent',
+ 'alternate'
+ ],
+ ContinueStatement: ['label'],
+ DebuggerStatement: [],
+ DirectiveStatement: [],
+ DoWhileStatement: [
+ 'body',
+ 'test'
+ ],
+ EmptyStatement: [],
+ ExpressionStatement: ['expression'],
+ ForStatement: [
+ 'init',
+ 'test',
+ 'update',
+ 'body'
+ ],
+ ForInStatement: [
+ 'left',
+ 'right',
+ 'body'
+ ],
+ FunctionDeclaration: [
+ 'id',
+ 'params',
+ 'defaults',
+ 'rest',
+ 'body'
+ ],
+ FunctionExpression: [
+ 'id',
+ 'params',
+ 'defaults',
+ 'rest',
+ 'body'
+ ],
+ Identifier: [],
+ IfStatement: [
+ 'test',
+ 'consequent',
+ 'alternate'
+ ],
+ Literal: [],
+ LabeledStatement: [
+ 'label',
+ 'body'
+ ],
+ LogicalExpression: [
+ 'left',
+ 'right'
+ ],
+ MemberExpression: [
+ 'object',
+ 'property'
+ ],
+ MethodDefinition: [
+ 'key',
+ 'value'
+ ],
+ NewExpression: [
+ 'callee',
+ 'arguments'
+ ],
+ ObjectExpression: ['properties'],
+ ObjectPattern: ['properties'],
+ Program: ['body'],
+ Property: [
+ 'key',
+ 'value'
+ ],
+ ReturnStatement: ['argument'],
+ SequenceExpression: ['expressions'],
+ SwitchStatement: [
+ 'discriminant',
+ 'cases'
+ ],
+ SwitchCase: [
+ 'test',
+ 'consequent'
+ ],
+ ThisExpression: [],
+ ThrowStatement: ['argument'],
+ TryStatement: [
+ 'block',
+ 'handlers',
+ 'handler',
+ 'guardedHandlers',
+ 'finalizer'
+ ],
+ UnaryExpression: ['argument'],
+ UpdateExpression: ['argument'],
+ VariableDeclaration: ['declarations'],
+ VariableDeclarator: [
+ 'id',
+ 'init'
+ ],
+ WhileStatement: [
+ 'test',
+ 'body'
+ ],
+ WithStatement: [
+ 'object',
+ 'body'
+ ],
+ YieldExpression: ['argument']
+ };
+ BREAK = {};
+ SKIP = {};
+ VisitorOption = {
+ Break: BREAK,
+ Skip: SKIP
+ };
+ function Reference(parent, key) {
+ this.parent = parent;
+ this.key = key;
+ }
+ Reference.prototype.replace = function replace(node) {
+ this.parent[this.key] = node;
+ };
+ function Element(node, path, wrap, ref) {
+ this.node = node;
+ this.path = path;
+ this.wrap = wrap;
+ this.ref = ref;
+ }
+ function Controller() {
+ }
+ Controller.prototype.path = function path() {
+ var i, iz, j, jz, result, element;
+ function addToPath(result, path) {
+ if (isArray(path)) {
+ for (j = 0, jz = path.length; j < jz; ++j) {
+ result.push(path[j]);
+ }
+ } else {
+ result.push(path);
+ }
+ }
+ if (!this.__current.path) {
+ return null;
+ }
+ result = [];
+ for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {
+ element = this.__leavelist[i];
+ addToPath(result, element.path);
+ }
+ addToPath(result, this.__current.path);
+ return result;
+ };
+ Controller.prototype.parents = function parents() {
+ var i, iz, result;
+ result = [];
+ for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {
+ result.push(this.__leavelist[i].node);
+ }
+ return result;
+ };
+ Controller.prototype.current = function current() {
+ return this.__current.node;
+ };
+ Controller.prototype.__execute = function __execute(callback, element) {
+ var previous, result;
+ result = undefined;
+ previous = this.__current;
+ this.__current = element;
+ this.__state = null;
+ if (callback) {
+ result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);
+ }
+ this.__current = previous;
+ return result;
+ };
+ Controller.prototype.notify = function notify(flag) {
+ this.__state = flag;
+ };
+ Controller.prototype.skip = function () {
+ this.notify(SKIP);
+ };
+ Controller.prototype['break'] = function () {
+ this.notify(BREAK);
+ };
+ Controller.prototype.__initialize = function (root, visitor) {
+ this.visitor = visitor;
+ this.root = root;
+ this.__worklist = [];
+ this.__leavelist = [];
+ this.__current = null;
+ this.__state = null;
+ };
+ Controller.prototype.traverse = function traverse(root, visitor) {
+ var worklist, leavelist, element, node, nodeType, ret, key, current, current2, candidates, candidate, sentinel;
+ this.__initialize(root, visitor);
+ sentinel = {};
+ worklist = this.__worklist;
+ leavelist = this.__leavelist;
+ worklist.push(new Element(root, null, null, null));
+ leavelist.push(new Element(null, null, null, null));
+ while (worklist.length) {
+ element = worklist.pop();
+ if (element === sentinel) {
+ element = leavelist.pop();
+ ret = this.__execute(visitor.leave, element);
+ if (this.__state === BREAK || ret === BREAK) {
+ return;
+ }
+ continue;
+ }
+ if (element.node) {
+ ret = this.__execute(visitor.enter, element);
+ if (this.__state === BREAK || ret === BREAK) {
+ return;
+ }
+ worklist.push(sentinel);
+ leavelist.push(element);
+ if (this.__state === SKIP || ret === SKIP) {
+ continue;
+ }
+ node = element.node;
+ nodeType = element.wrap || node.type;
+ candidates = VisitorKeys[nodeType];
+ current = candidates.length;
+ while ((current -= 1) >= 0) {
+ key = candidates[current];
+ candidate = node[key];
+ if (!candidate) {
+ continue;
+ }
+ if (!isArray(candidate)) {
+ worklist.push(new Element(candidate, key, null, null));
+ continue;
+ }
+ current2 = candidate.length;
+ while ((current2 -= 1) >= 0) {
+ if (!candidate[current2]) {
+ continue;
+ }
+ if ((nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === candidates[current]) {
+ element = new Element(candidate[current2], [
+ key,
+ current2
+ ], 'Property', null);
+ } else {
+ element = new Element(candidate[current2], [
+ key,
+ current2
+ ], null, null);
+ }
+ worklist.push(element);
+ }
+ }
+ }
+ }
+ };
+ Controller.prototype.replace = function replace(root, visitor) {
+ var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key;
+ this.__initialize(root, visitor);
+ sentinel = {};
+ worklist = this.__worklist;
+ leavelist = this.__leavelist;
+ outer = { root: root };
+ element = new Element(root, null, null, new Reference(outer, 'root'));
+ worklist.push(element);
+ leavelist.push(element);
+ while (worklist.length) {
+ element = worklist.pop();
+ if (element === sentinel) {
+ element = leavelist.pop();
+ target = this.__execute(visitor.leave, element);
+ if (target !== undefined && target !== BREAK && target !== SKIP) {
+ element.ref.replace(target);
+ }
+ if (this.__state === BREAK || target === BREAK) {
+ return outer.root;
+ }
+ continue;
+ }
+ target = this.__execute(visitor.enter, element);
+ if (target !== undefined && target !== BREAK && target !== SKIP) {
+ element.ref.replace(target);
+ element.node = target;
+ }
+ if (this.__state === BREAK || target === BREAK) {
+ return outer.root;
+ }
+ node = element.node;
+ if (!node) {
+ continue;
+ }
+ worklist.push(sentinel);
+ leavelist.push(element);
+ if (this.__state === SKIP || target === SKIP) {
+ continue;
+ }
+ nodeType = element.wrap || node.type;
+ candidates = VisitorKeys[nodeType];
+ current = candidates.length;
+ while ((current -= 1) >= 0) {
+ key = candidates[current];
+ candidate = node[key];
+ if (!candidate) {
+ continue;
+ }
+ if (!isArray(candidate)) {
+ worklist.push(new Element(candidate, key, null, new Reference(node, key)));
+ continue;
+ }
+ current2 = candidate.length;
+ while ((current2 -= 1) >= 0) {
+ if (!candidate[current2]) {
+ continue;
+ }
+ if (nodeType === Syntax.ObjectExpression && 'properties' === candidates[current]) {
+ element = new Element(candidate[current2], [
+ key,
+ current2
+ ], 'Property', new Reference(candidate, current2));
+ } else {
+ element = new Element(candidate[current2], [
+ key,
+ current2
+ ], null, new Reference(candidate, current2));
+ }
+ worklist.push(element);
+ }
+ }
+ }
+ return outer.root;
+ };
+ function traverse(root, visitor) {
+ var controller = new Controller;
+ return controller.traverse(root, visitor);
+ }
+ function replace(root, visitor) {
+ var controller = new Controller;
+ return controller.replace(root, visitor);
+ }
+ function extendCommentRange(comment, tokens) {
+ var target;
+ target = upperBound(tokens, function search(token) {
+ return token.range[0] > comment.range[0];
+ });
+ comment.extendedRange = [
+ comment.range[0],
+ comment.range[1]
+ ];
+ if (target !== tokens.length) {
+ comment.extendedRange[1] = tokens[target].range[0];
+ }
+ target -= 1;
+ if (target >= 0) {
+ comment.extendedRange[0] = tokens[target].range[1];
+ }
+ return comment;
+ }
+ function attachComments(tree, providedComments, tokens) {
+ var comments = [], comment, len, i, cursor;
+ if (!tree.range) {
+ throw new Error('attachComments needs range information');
+ }
+ if (!tokens.length) {
+ if (providedComments.length) {
+ for (i = 0, len = providedComments.length; i < len; i += 1) {
+ comment = deepCopy(providedComments[i]);
+ comment.extendedRange = [
+ 0,
+ tree.range[0]
+ ];
+ comments.push(comment);
+ }
+ tree.leadingComments = comments;
+ }
+ return tree;
+ }
+ for (i = 0, len = providedComments.length; i < len; i += 1) {
+ comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));
+ }
+ cursor = 0;
+ traverse(tree, {
+ enter: function (node) {
+ var comment;
+ while (cursor < comments.length) {
+ comment = comments[cursor];
+ if (comment.extendedRange[1] > node.range[0]) {
+ break;
+ }
+ if (comment.extendedRange[1] === node.range[0]) {
+ if (!node.leadingComments) {
+ node.leadingComments = [];
+ }
+ node.leadingComments.push(comment);
+ comments.splice(cursor, 1);
+ } else {
+ cursor += 1;
+ }
+ }
+ if (cursor === comments.length) {
+ return VisitorOption.Break;
+ }
+ if (comments[cursor].extendedRange[0] > node.range[1]) {
+ return VisitorOption.Skip;
+ }
+ }
+ });
+ cursor = 0;
+ traverse(tree, {
+ leave: function (node) {
+ var comment;
+ while (cursor < comments.length) {
+ comment = comments[cursor];
+ if (node.range[1] < comment.extendedRange[0]) {
+ break;
+ }
+ if (node.range[1] === comment.extendedRange[0]) {
+ if (!node.trailingComments) {
+ node.trailingComments = [];
+ }
+ node.trailingComments.push(comment);
+ comments.splice(cursor, 1);
+ } else {
+ cursor += 1;
+ }
+ }
+ if (cursor === comments.length) {
+ return VisitorOption.Break;
+ }
+ if (comments[cursor].extendedRange[0] > node.range[1]) {
+ return VisitorOption.Skip;
+ }
+ }
+ });
+ return tree;
+ }
+ exports.version = '1.3.3-dev';
+ exports.Syntax = Syntax;
+ exports.traverse = traverse;
+ exports.replace = replace;
+ exports.attachComments = attachComments;
+ exports.VisitorKeys = VisitorKeys;
+ exports.VisitorOption = VisitorOption;
+ exports.Controller = Controller;
+ }));
+ });
+ require('/tools/entry-point.js');
+}.call(this, this));
diff --git a/package.json b/package.json
index 5a30567..7243b96 100644
--- a/package.json
+++ b/package.json
@@ -1,59 +1,59 @@
{
- "name": "escodegen",
- "description": "ECMAScript code generator",
- "homepage": "http://github.com/Constellation/escodegen",
- "main": "escodegen.js",
- "bin": {
- "esgenerate": "./bin/esgenerate.js",
- "escodegen": "./bin/escodegen.js"
- },
- "version": "1.0.1-dev",
- "engines": {
- "node": ">=0.4.0"
- },
- "maintainers": [
- {
- "name": "Yusuke Suzuki",
- "email": "utatane.tea@gmail.com",
- "web": "http://github.com/Constellation"
+ "name": "escodegen",
+ "description": "ECMAScript code generator",
+ "homepage": "http://github.com/Constellation/escodegen",
+ "main": "escodegen.js",
+ "bin": {
+ "esgenerate": "./bin/esgenerate.js",
+ "escodegen": "./bin/escodegen.js"
+ },
+ "version": "1.0.1",
+ "engines": {
+ "node": ">=0.4.0"
+ },
+ "maintainers": [
+ {
+ "name": "Yusuke Suzuki",
+ "email": "utatane.tea@gmail.com",
+ "web": "http://github.com/Constellation"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/Constellation/escodegen.git"
+ },
+ "dependencies": {
+ "esprima": "~1.0.4",
+ "estraverse": "~1.5.0",
+ "esutils": "~1.0.0"
+ },
+ "optionalDependencies": {
+ "source-map": "~0.1.30"
+ },
+ "devDependencies": {
+ "esprima-moz": "*",
+ "commonjs-everywhere": "~0.8.0",
+ "q": "*",
+ "bower": "*",
+ "semver": "*",
+ "chai": "~1.7.2",
+ "grunt-contrib-jshint": "~0.5.0",
+ "grunt-cli": "~0.1.9",
+ "grunt": "~0.4.1",
+ "grunt-mocha-test": "~0.6.2"
+ },
+ "licenses": [
+ {
+ "type": "BSD",
+ "url": "http://github.com/Constellation/escodegen/raw/master/LICENSE.BSD"
+ }
+ ],
+ "scripts": {
+ "test": "grunt travis",
+ "unit-test": "grunt test",
+ "lint": "grunt lint",
+ "release": "node tools/release.js",
+ "build-min": "./node_modules/.bin/cjsify -ma path: tools/entry-point.js > escodegen.browser.min.js",
+ "build": "./node_modules/.bin/cjsify -a path: tools/entry-point.js > escodegen.browser.js"
}
- ],
- "repository": {
- "type": "git",
- "url": "http://github.com/Constellation/escodegen.git"
- },
- "dependencies": {
- "esprima": "~1.0.4",
- "estraverse": "~1.5.0",
- "esutils": "~1.0.0"
- },
- "optionalDependencies": {
- "source-map": "~0.1.30"
- },
- "devDependencies": {
- "esprima-moz": "*",
- "commonjs-everywhere": "~0.8.0",
- "q": "*",
- "bower": "*",
- "semver": "*",
- "chai": "~1.7.2",
- "grunt-contrib-jshint": "~0.5.0",
- "grunt-cli": "~0.1.9",
- "grunt": "~0.4.1",
- "grunt-mocha-test": "~0.6.2"
- },
- "licenses": [
- {
- "type": "BSD",
- "url": "http://github.com/Constellation/escodegen/raw/master/LICENSE.BSD"
- }
- ],
- "scripts": {
- "test": "grunt travis",
- "unit-test": "grunt test",
- "lint": "grunt lint",
- "release": "node tools/release.js",
- "build-min": "./node_modules/.bin/cjsify -ma path: tools/entry-point.js > escodegen.browser.min.js",
- "build": "./node_modules/.bin/cjsify -a path: tools/entry-point.js > escodegen.browser.js"
- }
-}
+}
\ No newline at end of file