Bump version 1.3.0
diff --git a/component.json b/component.json
new file mode 100644
index 0000000..8994cd4
--- /dev/null
+++ b/component.json
@@ -0,0 +1,58 @@
+{
+ "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.3.0",
+ "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": {
+ "esutils": "~1.0.0",
+ "estraverse": "~1.5.0",
+ "esprima": "~1.0.4"
+ },
+ "optionalDependencies": {},
+ "devDependencies": {
+ "esprima-moz": "*",
+ "q": "*",
+ "bower": "*",
+ "semver": "*",
+ "chai": "~1.7.2",
+ "gulp": "~3.5.0",
+ "gulp-mocha": "~0.4.1",
+ "gulp-eslint": "~0.1.2",
+ "jshint-stylish": "~0.1.5",
+ "gulp-jshint": "~1.4.0",
+ "commonjs-everywhere": "~0.9.6"
+ },
+ "licenses": [
+ {
+ "type": "BSD",
+ "url": "http://github.com/Constellation/escodegen/raw/master/LICENSE.BSD"
+ }
+ ],
+ "scripts": {
+ "test": "gulp travis",
+ "unit-test": "gulp test",
+ "lint": "gulp 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
diff --git a/escodegen.browser.js b/escodegen.browser.js
new file mode 100644
index 0000000..0834495
--- /dev/null
+++ b/escodegen.browser.js
@@ -0,0 +1,3948 @@
+// Generated by CommonJS Everywhere 0.9.6
+(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.24',
+ 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',
+ ExportDeclaration: 'ExportDeclaration',
+ ExpressionStatement: 'ExpressionStatement',
+ ForStatement: 'ForStatement',
+ ForInStatement: 'ForInStatement',
+ ForOfStatement: 'ForOfStatement',
+ FunctionDeclaration: 'FunctionDeclaration',
+ FunctionExpression: 'FunctionExpression',
+ GeneratorExpression: 'GeneratorExpression',
+ 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: {
+ comprehensionExpressionStartsWithAssignment: false,
+ 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 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).toUpperCase();
+ 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 flattenToString(arr) {
+ var i, iz, elem, result = '';
+ for (i = 0, iz = arr.length; i < iz; ++i) {
+ elem = arr[i];
+ result += isArray(elem) ? flattenToString(elem) : elem;
+ }
+ return result;
+ }
+ function toSourceNodeWhenNeeded(generated, node) {
+ if (!sourceMap) {
+ if (isArray(generated)) {
+ return flattenToString(generated);
+ } else {
+ return generated;
+ }
+ }
+ 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 = toSourceNodeWhenNeeded(left).toString(), rightSource = toSourceNodeWhenNeeded(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, sn;
+ 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) {
+ sn = toSourceNodeWhenNeeded(addIndent(array[i].slice(spaces)));
+ array[i] = sourceMap ? sn.join('') : sn;
+ }
+ 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(toSourceNodeWhenNeeded(result).toString())) {
+ result.push('\n');
+ }
+ for (i = 1, len = stmt.leadingComments.length; i < len; ++i) {
+ comment = stmt.leadingComments[i];
+ fragment = [generateComment(comment)];
+ if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) {
+ fragment.push('\n');
+ }
+ result.push(addIndent(fragment));
+ }
+ result.push(addIndent(save));
+ }
+ if (stmt.trailingComments) {
+ tailingToStatement = !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString());
+ specialBase = stringRepeat(' ', calculateSpaces(toSourceNodeWhenNeeded([
+ 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(toSourceNodeWhenNeeded(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(toSourceNodeWhenNeeded(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 generateVerbatimString(string) {
+ var i, iz, result;
+ result = string.split(/\r\n|\n/);
+ for (i = 1, iz = result.length; i < iz; i++) {
+ result[i] = newline + base + result[i];
+ }
+ return result;
+ }
+ function generateVerbatim(expr, option) {
+ var verbatim, result, prec;
+ verbatim = expr[extra.verbatim];
+ if (typeof verbatim === 'string') {
+ result = parenthesize(generateVerbatimString(verbatim), Precedence.Sequence, option.precedence);
+ } else {
+ result = generateVerbatimString(verbatim.content);
+ prec = verbatim.precedence != null ? verbatim.precedence : Precedence.Sequence;
+ result = parenthesize(result, prec, option.precedence);
+ }
+ return toSourceNodeWhenNeeded(result, expr);
+ }
+ function generateIdentifier(node) {
+ return toSourceNodeWhenNeeded(node.name, node);
+ }
+ function generatePattern(node, options) {
+ var result;
+ if (node.type === Syntax.Identifier) {
+ result = generateIdentifier(node);
+ } else {
+ result = generateExpression(node, {
+ precedence: options.precedence,
+ allowIn: options.allowIn,
+ allowCall: true
+ });
+ }
+ return result;
+ }
+ 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(generatePattern(node.params[i], {
+ precedence: Precedence.Assignment,
+ allowIn: true
+ }));
+ if (i + 1 < len) {
+ result.push(',' + space);
+ }
+ }
+ result.push(')');
+ }
+ if (arrow) {
+ result.push(space);
+ result.push('=>');
+ }
+ 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 generateIterationForStatement(operator, stmt, semicolonIsNotNeeded) {
+ var result = ['for' + space + '('];
+ withIndent(function () {
+ if (stmt.left.type === Syntax.VariableDeclaration) {
+ withIndent(function () {
+ result.push(stmt.left.kind + noEmptySpace());
+ result.push(generateStatement(stmt.left.declarations[0], { allowIn: false }));
+ });
+ } else {
+ result.push(generateExpression(stmt.left, {
+ precedence: Precedence.Call,
+ allowIn: true,
+ allowCall: true
+ }));
+ }
+ result = join(result, operator);
+ result = [
+ join(result, generateExpression(stmt.right, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ })),
+ ')'
+ ];
+ });
+ result.push(maybeBlock(stmt.body, semicolonIsNotNeeded));
+ return result;
+ }
+ function generateExpression(expr, option) {
+ var result, precedence, type, currentPrecedence, i, len, raw, fragment, multiline, leftCharCode, leftSource, rightCharCode, allowIn, allowCall, allowUnparenthesizedNew, property, isGenerator;
+ 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());
+ result.push(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('[');
+ result.push(generateExpression(expr.property, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: allowCall
+ }));
+ result.push(']');
+ } else {
+ if (expr.object.type === Syntax.Literal && typeof expr.object.value === 'number') {
+ fragment = toSourceNodeWhenNeeded(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('.');
+ 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 = toSourceNodeWhenNeeded(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());
+ result.push(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:
+ isGenerator = expr.generator && !extra.moz.starlessGenerator;
+ result = isGenerator ? 'function*' : 'function';
+ if (expr.id) {
+ result = [
+ result,
+ isGenerator ? space : 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 : '');
+ result.push(generateExpression(expr.elements[i], {
+ precedence: Precedence.Assignment,
+ allowIn: true,
+ allowCall: true
+ }));
+ }
+ if (i + 1 < len) {
+ result.push(',' + (multiline ? newline : space));
+ }
+ }
+ });
+ if (multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) {
+ result.push(newline);
+ }
+ result.push(multiline ? base : '');
+ result.push(']');
+ 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
+ }));
+ result.push(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(toSourceNodeWhenNeeded(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);
+ result.push(generateExpression(expr.properties[i], {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true,
+ type: Syntax.Property
+ }));
+ if (i + 1 < len) {
+ result.push(',' + newline);
+ }
+ }
+ }
+ });
+ if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) {
+ result.push(newline);
+ }
+ result.push(base);
+ result.push('}');
+ 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 : '');
+ result.push(generateExpression(expr.properties[i], {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }));
+ if (i + 1 < len) {
+ result.push(',' + (multiline ? newline : space));
+ }
+ }
+ });
+ if (multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) {
+ result.push(newline);
+ }
+ result.push(multiline ? base : '');
+ result.push('}');
+ 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.GeneratorExpression:
+ case Syntax.ComprehensionExpression:
+ result = type === Syntax.GeneratorExpression ? ['('] : ['['];
+ if (extra.moz.comprehensionExpressionStartsWithAssignment) {
+ fragment = generateExpression(expr.body, {
+ precedence: Precedence.Assignment,
+ allowIn: true,
+ allowCall: true
+ });
+ result.push(fragment);
+ }
+ if (expr.blocks) {
+ withIndent(function () {
+ for (i = 0, len = expr.blocks.length; i < len; ++i) {
+ fragment = generateExpression(expr.blocks[i], {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ });
+ if (i > 0 || extra.moz.comprehensionExpressionStartsWithAssignment) {
+ result = join(result, fragment);
+ } else {
+ result.push(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);
+ }
+ }
+ if (!extra.moz.comprehensionExpressionStartsWithAssignment) {
+ fragment = generateExpression(expr.body, {
+ precedence: Precedence.Assignment,
+ allowIn: true,
+ allowCall: true
+ });
+ result = join(result, fragment);
+ }
+ result.push(type === Syntax.GeneratorExpression ? ')' : ']');
+ 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 toSourceNodeWhenNeeded(result, expr);
+ }
+ function generateStatement(stmt, option) {
+ var i, len, result, node, allowIn, functionBody, directiveContext, fragment, semicolon, isGenerator;
+ 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(toSourceNodeWhenNeeded(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 () {
+ var guard;
+ result = [
+ 'catch' + space + '(',
+ generateExpression(stmt.param, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }),
+ ')'
+ ];
+ if (stmt.guard) {
+ guard = generateExpression(stmt.guard, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ });
+ result.splice(2, 0, ' if ', guard);
+ }
+ });
+ result.push(maybeBlock(stmt.body));
+ break;
+ case Syntax.DebuggerStatement:
+ result = 'debugger' + semicolon;
+ break;
+ case Syntax.EmptyStatement:
+ result = ';';
+ break;
+ case Syntax.ExportDeclaration:
+ result = 'export ';
+ if (stmt.declaration) {
+ result = [
+ result,
+ generateStatement(stmt.declaration, { semicolonOptional: semicolon === '' })
+ ];
+ break;
+ }
+ break;
+ case Syntax.ExpressionStatement:
+ result = [generateExpression(stmt.expression, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ })];
+ fragment = toSourceNodeWhenNeeded(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 = generatePattern(stmt.id, {
+ precedence: Precedence.Assignment,
+ allowIn: allowIn
+ });
+ }
+ 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());
+ result.push(generateStatement(stmt.declarations[0], { allowIn: allowIn }));
+ } else {
+ withIndent(function () {
+ node = stmt.declarations[0];
+ if (extra.comment && node.leadingComments) {
+ result.push('\n');
+ result.push(addIndent(generateStatement(node, { allowIn: allowIn })));
+ } else {
+ result.push(noEmptySpace());
+ result.push(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);
+ result.push(addIndent(generateStatement(node, { allowIn: allowIn })));
+ } else {
+ result.push(',' + space);
+ result.push(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 {
+ stmt.guardedHandlers = stmt.guardedHandlers || [];
+ 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.handler) {
+ if (isArray(stmt.handler)) {
+ for (i = 0, len = stmt.handler.length; i < len; ++i) {
+ result = join(result, generateStatement(stmt.handler[i]));
+ if (stmt.finalizer || i + 1 !== len) {
+ result = maybeBlockSuffix(stmt.handler[i].body, result);
+ }
+ }
+ } else {
+ result = join(result, generateStatement(stmt.handler));
+ if (stmt.finalizer) {
+ result = maybeBlockSuffix(stmt.handler.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(toSourceNodeWhenNeeded(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(toSourceNodeWhenNeeded(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(toSourceNodeWhenNeeded(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
+ }));
+ result.push(';');
+ }
+ } else {
+ result.push(';');
+ }
+ if (stmt.test) {
+ result.push(space);
+ result.push(generateExpression(stmt.test, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }));
+ result.push(';');
+ } else {
+ result.push(';');
+ }
+ if (stmt.update) {
+ result.push(space);
+ result.push(generateExpression(stmt.update, {
+ precedence: Precedence.Sequence,
+ allowIn: true,
+ allowCall: true
+ }));
+ result.push(')');
+ } else {
+ result.push(')');
+ }
+ });
+ result.push(maybeBlock(stmt.body, semicolon === ''));
+ break;
+ case Syntax.ForInStatement:
+ result = generateIterationForStatement('in', stmt, semicolon === '');
+ break;
+ case Syntax.ForOfStatement:
+ result = generateIterationForStatement('of', stmt, 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(toSourceNodeWhenNeeded(fragment).toString())) {
+ result.push(newline);
+ }
+ }
+ break;
+ case Syntax.FunctionDeclaration:
+ isGenerator = stmt.generator && !extra.moz.starlessGenerator;
+ result = [
+ isGenerator ? 'function*' : 'function',
+ isGenerator ? space : noEmptySpace(),
+ 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 = toSourceNodeWhenNeeded(result).toString();
+ if (stmt.type === Syntax.Program && !safeConcatenation && newline === '' && fragment.charAt(fragment.length - 1) === '\n') {
+ result = sourceMap ? toSourceNodeWhenNeeded(result).replaceRight(/\s+$/, '') : fragment.replace(/\s+$/, '');
+ }
+ return toSourceNodeWhenNeeded(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;
+ }
+ }
+ 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.ForOfStatement:
+ 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.Precedence = updateDeeply({}, Precedence);
+ 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.3.0',
+ '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': '*',
+ 'q': '*',
+ 'bower': '*',
+ 'semver': '*',
+ 'chai': '~1.7.2',
+ 'gulp': '~3.5.0',
+ 'gulp-mocha': '~0.4.1',
+ 'gulp-eslint': '~0.1.2',
+ 'jshint-stylish': '~0.1.5',
+ 'gulp-jshint': '~1.4.0',
+ 'commonjs-everywhere': '~0.9.6'
+ },
+ 'licenses': [{
+ 'type': 'BSD',
+ 'url': 'http://github.com/Constellation/escodegen/raw/master/LICENSE.BSD'
+ }],
+ 'scripts': {
+ 'test': 'gulp travis',
+ 'unit-test': 'gulp test',
+ 'lint': 'gulp 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/escodegen.browser.min.js b/escodegen.browser.min.js
new file mode 100644
index 0000000..ed4ed1e
--- /dev/null
+++ b/escodegen.browser.min.js
@@ -0,0 +1 @@
+(function(b){function a(b,d){if({}.hasOwnProperty.call(a.cache,b))return a.cache[b];var e=a.resolve(b);if(!e)throw new Error('Failed to resolve module '+b);var c={id:b,require:a,filename:b,exports:{},loaded:!1,parent:d,children:[]};d&&d.children.push(c);var f=b.slice(0,b.lastIndexOf('/')+1);return a.cache[b]=c.exports,e.call(c.exports,c,c.exports,f,b),c.loaded=!0,a.cache[b]=c.exports}a.modules={},a.cache={},a.resolve=function(b){return{}.hasOwnProperty.call(a.modules,b)?a.modules[b]:void 0},a.define=function(b,c){a.modules[b]=c};var c=function(a){return a='/',{title:'browser',version:'v0.10.24',browser:!0,env:{},argv:[],nextTick:b.setImmediate||function(a){setTimeout(a,0)},cwd:function(){return a},chdir:function(b){a=b}}}();a.define('/tools/entry-point.js',function(c,d,e,f){!function(){'use strict';b.escodegen=a('/escodegen.js',c),escodegen.browser=!0}()}),a.define('/escodegen.js',function(d,c,e,f){!function(e,f,X,C,V,p,B,m,x,v,K,R,G,L,k,h,J,O,D,N,n,I,w,Y,T){'use strict';function P(){return{indent:null,base:null,parse:null,comment:!1,format:{indent:{style:' ',base:0,adjustMultilineComment:!1},newline:'\n',space:' ',json:!1,renumber:!1,hexadecimal:!1,quotes:'single',escapeless:!1,compact:!1,parentheses:!0,semicolons:!0,safeConcatenation:!1},moz:{comprehensionExpressionStartsWithAssignment:!1,starlessGenerator:!1,parenthesizedComprehensionBlock:!1},sourceMap:null,sourceMapRoot:null,sourceMapWithCode:!1,directive:!1,verbatim:null}}function H(b,a){var c='';for(a|=0;a>0;a>>>=1,b+=b)a&1&&(c+=b);return c}function $(a){return/[\r\n]/g.test(a)}function s(b){var a=b.length;return a&&p.code.isLineTerminator(b.charCodeAt(a-1))}function F(b,d){function e(a){return typeof a==='object'&&a instanceof Object&&!(a instanceof RegExp)}var a,c;for(a in d)d.hasOwnProperty(a)&&(c=d[a],e(c)?e(b[a])?F(b[a],c):b[a]=F({},c):b[a]=c);return b}function a0(c){var b,e,a,f,d;if(c!==c)throw new Error('Numeric literal whose value is NaN');if(c<0||c===0&&1/c<0)throw new Error('Numeric literal whose value is negative');if(c===1/0)return v?'null':K?'1e400':'1e+400';if(b=''+c,!K||b.length<3)return b;e=b.indexOf('.'),!v&&b.charCodeAt(0)===48&&e===1&&(e=0,b=b.slice(1)),a=b,b=b.replace('e+','e'),f=0,(d=a.indexOf('e'))>0&&(f=+a.slice(d+1),a=a.slice(0,d)),e>=0&&(f-=a.length-e-1,a=+(a.slice(0,e)+a.slice(e+1))+''),d=0;while(a.charCodeAt(a.length+d-1)===48)--d;return d!==0&&(f-=d,a=a.slice(0,d)),f!==0&&(a+='e'+f),(a.length<b.length||R&&c>1e12&&Math.floor(c)===c&&(a='0x'+c.toString(16)).length<b.length)&&+a===c&&(b=a),b}function M(a,b){return(a&-2)===8232?(b?'u':'\\u')+(a===8232?'2028':'2029'):a===10||a===13?(b?'':'\\')+(a===10?'n':'r'):String.fromCharCode(a)}function a3(d){var g,a,h,e,i,b,f,c;if(a=d.toString(),d.source){if(g=a.match(/\/([^/]*)$/),!g)return a;for(h=g[1],a='',f=!1,c=!1,e=0,i=d.source.length;e<i;++e)b=d.source.charCodeAt(e),c?(a+=M(b,c),c=!1):(f?b===93&&(f=!1):b===47?a+='\\':b===91&&(f=!0),a+=M(b,c),c=b===92);return'/'+a+'/'+h}return a}function a4(b,d){var c,a='\\';switch(b){case 8:a+='b';break;case 12:a+='f';break;case 9:a+='t';break;default:c=b.toString(16).toUpperCase();v||b>255?a+='u'+'0000'.slice(c.length)+c:b===0&&!p.code.isDecimalDigit(d)?a+='0':b===11?a+='x0B':a+='x'+'00'.slice(c.length)+c;break}return a}function a5(b){var a='\\';switch(b){case 92:a+='\\';break;case 10:a+='n';break;case 13:a+='r';break;case 8232:a+='u2028';break;case 8233:a+='u2029';break;default:throw new Error('Incorrectly classified character')}return a}function a8(d){var a,e,c,b;for(b=G==='double'?'"':"'",a=0,e=d.length;a<e;++a){if(c=d.charCodeAt(a),c===39){b='"';break}if(c===34){b="'";break}c===92&&++a}return b+d+b}function _(d){var b='',c,g,a,h=0,i=0,e,f;for(c=0,g=d.length;c<g;++c){if(a=d.charCodeAt(c),a===39)++h;else if(a===34)++i;else if(a===47&&v)b+='\\';else if(p.code.isLineTerminator(a)||a===92){b+=a5(a);continue}else if(v&&a<32||!(v||L||a>=32&&a<=126)){b+=a4(a,d.charCodeAt(c+1));continue}b+=String.fromCharCode(a)}if(e=!(G==='double'||G==='auto'&&i<h),f=e?"'":'"',!(e?h:i))return f+b+f;for(d=b,b=f,c=0,g=d.length;c<g;++c)a=d.charCodeAt(c),(a===39&&e||a===34&&!e)&&(b+='\\'),b+=String.fromCharCode(a);return b+f}function Q(d){var a,e,b,c='';for(a=0,e=d.length;a<e;++a)b=d[a],c+=B(b)?Q(b):b;return c}function j(b,a){if(!w)return B(b)?Q(b):b;if(a==null)if(b instanceof C)return b;else a={};return a.loc==null?new C(null,null,w,b,a.name||null):new C(a.loc.start.line,a.loc.start.column,w===!0?a.loc.source||null:w,b,a.name||null)}function u(){return h?h:' '}function i(c,d){var e=j(c).toString(),f=j(d).toString(),a=e.charCodeAt(e.length-1),b=f.charCodeAt(0);return(a===43||a===45)&&a===b||p.code.isIdentifierPart(a)&&p.code.isIdentifierPart(b)||a===47&&b===105?[c,u(),d]:p.code.isWhiteSpace(a)||p.code.isLineTerminator(a)||p.code.isWhiteSpace(b)||p.code.isLineTerminator(b)?[c,d]:[c,h,d]}function t(a){return[m,a]}function o(c){var a,b;return a=m,m+=x,b=c.call(this,m),m=a,b}function a6(b){var a;for(a=b.length-1;a>=0;--a)if(p.code.isLineTerminator(b.charCodeAt(a)))break;return b.length-1-a}function a7(k,i){var b,a,e,g,d,c,f,h;for(b=k.split(/\r\n|[\r\n]/),c=Number.MAX_VALUE,a=1,e=b.length;a<e;++a){g=b[a],d=0;while(d<g.length&&p.code.isWhiteSpace(g.charCodeAt(d)))++d;c>d&&(c=d)}for(i!==void 0?(f=m,b[1][c]==='*'&&(i+=' '),m=i):(c&1&&--c,f=m),a=1,e=b.length;a<e;++a)h=j(t(b[a].slice(c))),b[a]=w?h.join(''):h;return m=f,b.join('\n')}function E(a,b){return a.type==='Line'?s(a.value)?'//'+a.value:'//'+a.value+'\n':n.format.indent.adjustMultilineComment&&/[\n\r]/.test(a.value)?a7('/*'+a.value+'*/',b):'/*'+a.value+'*/'}function Z(b,a){var c,f,d,i,k,h,g;if(b.leadingComments&&b.leadingComments.length>0){for(i=a,d=b.leadingComments[0],a=[],D&&b.type===e.Program&&b.body.length===0&&a.push('\n'),a.push(E(d)),s(j(a).toString())||a.push('\n'),c=1,f=b.leadingComments.length;c<f;++c)d=b.leadingComments[c],g=[E(d)],s(j(g).toString())||g.push('\n'),a.push(t(g));a.push(t(i))}if(b.trailingComments)for(k=!s(j(a).toString()),h=H(' ',a6(j([m,a,x]).toString())),c=0,f=b.trailingComments.length;c<f;++c)d=b.trailingComments[c],k?(c===0?a=[a,x]:a=[a,h],a.push(E(d,h))):a=[a,t(E(d))],c!==f-1&&!s(j(a).toString())&&(a=[a,'\n']);return a}function r(a,b,c){return b<c?['(',a,')']:a}function q(a,f,c){var d,b;return b=!n.comment||!a.leadingComments,a.type===e.BlockStatement&&b?[h,l(a,{functionBody:c})]:a.type===e.EmptyStatement&&b?';':(o(function(){d=[k,t(l(a,{semicolonOptional:f,functionBody:c}))]}),d)}function y(c,a){var b=s(j(a).toString());return c.type===e.BlockStatement&&!(n.comment&&c.leadingComments)&&!b?[a,h]:b?[a,m]:[a,k,m]}function S(d){var a,c,b;for(b=d.split(/\r\n|\n/),a=1,c=b.length;a<c;a++)b[a]=k+m+b[a];return b}function a2(c,d){var a,b,e;return a=c[n.verbatim],typeof a==='string'?b=r(S(a),f.Sequence,d.precedence):(b=S(a.content),e=a.precedence!=null?a.precedence:f.Sequence,b=r(b,e,d.precedence)),j(b,c)}function A(a){return j(a.name,a)}function U(a,c){var b;return a.type===e.Identifier?b=A(a):b=g(a,{precedence:c.precedence,allowIn:c.allowIn,allowCall:!0}),b}function z(b){var a,c,i,d,j;if(j=b.type===e.ArrowFunctionExpression,j&&b.params.length===1&&b.params[0].type===e.Identifier)a=[A(b.params[0])];else{for(a=['('],c=0,i=b.params.length;c<i;++c)a.push(U(b.params[c],{precedence:f.Assignment,allowIn:!0})),c+1<i&&a.push(','+h);a.push(')')}return j&&(a.push(h),a.push('=>')),b.expression?(a.push(h),d=g(b.body,{precedence:f.Assignment,allowIn:!0,allowCall:!0}),d.toString().charAt(0)==='{'&&(d=['(',d,')']),a.push(d)):a.push(q(b.body,!1,!0)),a}function W(c,b,d){var a=['for'+h+'('];return o(function(){b.left.type===e.VariableDeclaration?o(function(){a.push(b.left.kind+u()),a.push(l(b.left.declarations[0],{allowIn:!1}))}):a.push(g(b.left,{precedence:f.Call,allowIn:!0,allowCall:!0})),a=i(a,c),a=[i(a,g(b.right,{precedence:f.Sequence,allowIn:!0,allowCall:!0})),')']}),a.push(q(b.body,d)),a}function g(b,x){var a,t,D,B,d,q,H,c,v,C,y,L,w,E,K,F,G;if(t=x.precedence,w=x.allowIn,E=x.allowCall,D=b.type||x.type,n.verbatim&&b.hasOwnProperty(n.verbatim))return a2(b,x);switch(D){case e.SequenceExpression:a=[];w|=f.Sequence<t;for(d=0,q=b.expressions.length;d<q;++d)a.push(g(b.expressions[d],{precedence:f.Assignment,allowIn:w,allowCall:!0})),d+1<q&&a.push(','+h);a=r(a,f.Sequence,t);break;case e.AssignmentExpression:w|=f.Assignment<t;a=r([g(b.left,{precedence:f.Call,allowIn:w,allowCall:!0}),h+b.operator+h,g(b.right,{precedence:f.Assignment,allowIn:w,allowCall:!0})],f.Assignment,t);break;case e.ArrowFunctionExpression:w|=f.ArrowFunction<t;a=r(z(b),f.ArrowFunction,t);break;case e.ConditionalExpression:w|=f.Conditional<t;a=r([g(b.test,{precedence:f.LogicalOR,allowIn:w,allowCall:!0}),h+'?'+h,g(b.consequent,{precedence:f.Assignment,allowIn:w,allowCall:!0}),h+':'+h,g(b.alternate,{precedence:f.Assignment,allowIn:w,allowCall:!0})],f.Conditional,t);break;case e.LogicalExpression:case e.BinaryExpression:B=X[b.operator];w|=B<t;c=g(b.left,{precedence:B,allowIn:w,allowCall:!0});y=c.toString();y.charCodeAt(y.length-1)===47&&p.code.isIdentifierPart(b.operator.charCodeAt(0))?a=[c,u(),b.operator]:a=i(c,b.operator);c=g(b.right,{precedence:B+1,allowIn:w,allowCall:!0});b.operator==='/'&&c.toString().charAt(0)==='/'||b.operator.slice(-1)==='<'&&c.toString().slice(0,3)==='!--'?(a.push(u()),a.push(c)):a=i(a,c);b.operator==='in'&&!w?a=['(',a,')']:a=r(a,B,t);break;case e.CallExpression:a=[g(b.callee,{precedence:f.Call,allowIn:!0,allowCall:!0,allowUnparenthesizedNew:!1})];a.push('(');for(d=0,q=b['arguments'].length;d<q;++d)a.push(g(b['arguments'][d],{precedence:f.Assignment,allowIn:!0,allowCall:!0})),d+1<q&&a.push(','+h);a.push(')');E?a=r(a,f.Call,t):a=['(',a,')'];break;case e.NewExpression:q=b['arguments'].length;K=x.allowUnparenthesizedNew===undefined||x.allowUnparenthesizedNew;a=i('new',g(b.callee,{precedence:f.New,allowIn:!0,allowCall:!1,allowUnparenthesizedNew:K&&!J&&q===0}));if(!K||J||q>0){for(a.push('('),d=0;d<q;++d)a.push(g(b['arguments'][d],{precedence:f.Assignment,allowIn:!0,allowCall:!0})),d+1<q&&a.push(','+h);a.push(')')}a=r(a,f.New,t);break;case e.MemberExpression:a=[g(b.object,{precedence:f.Call,allowIn:!0,allowCall:E,allowUnparenthesizedNew:!1})];b.computed?(a.push('['),a.push(g(b.property,{precedence:f.Sequence,allowIn:!0,allowCall:E})),a.push(']')):(b.object.type===e.Literal&&typeof b.object.value==='number'&&(c=j(a).toString(),c.indexOf('.')<0&&!/[eExX]/.test(c)&&p.code.isDecimalDigit(c.charCodeAt(c.length-1))&&!(c.length>=2&&c.charCodeAt(0)===48)&&a.push('.')),a.push('.'),a.push(A(b.property)));a=r(a,f.Member,t);break;case e.UnaryExpression:c=g(b.argument,{precedence:f.Unary,allowIn:!0,allowCall:!0});h===''?a=i(b.operator,c):(a=[b.operator],b.operator.length>2?a=i(a,c):(y=j(a).toString(),C=y.charCodeAt(y.length-1),L=c.toString().charCodeAt(0),(C===43||C===45)&&C===L||p.code.isIdentifierPart(C)&&p.code.isIdentifierPart(L)?(a.push(u()),a.push(c)):a.push(c)));a=r(a,f.Unary,t);break;case e.YieldExpression:b.delegate?a='yield*':a='yield';b.argument&&(a=i(a,g(b.argument,{precedence:f.Yield,allowIn:!0,allowCall:!0})));a=r(a,f.Yield,t);break;case e.UpdateExpression:b.prefix?a=r([b.operator,g(b.argument,{precedence:f.Unary,allowIn:!0,allowCall:!0})],f.Unary,t):a=r([g(b.argument,{precedence:f.Postfix,allowIn:!0,allowCall:!0}),b.operator],f.Postfix,t);break;case e.FunctionExpression:G=b.generator&&!n.moz.starlessGenerator;a=G?'function*':'function';b.id?a=[a,G?h:u(),A(b.id),z(b)]:a=[a+h,z(b)];break;case e.ArrayPattern:case e.ArrayExpression:if(!b.elements.length){a='[]';break}v=b.elements.length>1;a=['[',v?k:''];o(function(c){for(d=0,q=b.elements.length;d<q;++d)b.elements[d]?(a.push(v?c:''),a.push(g(b.elements[d],{precedence:f.Assignment,allowIn:!0,allowCall:!0}))):(v&&a.push(c),d+1===q&&a.push(',')),d+1<q&&a.push(','+(v?k:h))});v&&!s(j(a).toString())&&a.push(k);a.push(v?m:'');a.push(']');break;case e.Property:b.kind==='get'||b.kind==='set'?a=[b.kind,u(),g(b.key,{precedence:f.Sequence,allowIn:!0,allowCall:!0}),z(b.value)]:b.shorthand?a=g(b.key,{precedence:f.Sequence,allowIn:!0,allowCall:!0}):b.method?(a=[],b.value.generator&&a.push('*'),a.push(g(b.key,{precedence:f.Sequence,allowIn:!0,allowCall:!0})),a.push(z(b.value))):a=[g(b.key,{precedence:f.Sequence,allowIn:!0,allowCall:!0}),':'+h,g(b.value,{precedence:f.Assignment,allowIn:!0,allowCall:!0})];break;case e.ObjectExpression:if(!b.properties.length){a='{}';break}v=b.properties.length>1;o(function(){c=g(b.properties[0],{precedence:f.Sequence,allowIn:!0,allowCall:!0,type:e.Property})});if(!(v||$(j(c).toString()))){a=['{',h,c,h,'}'];break}o(function(h){if(a=['{',k,h,c],v)for(a.push(','+k),d=1,q=b.properties.length;d<q;++d)a.push(h),a.push(g(b.properties[d],{precedence:f.Sequence,allowIn:!0,allowCall:!0,type:e.Property})),d+1<q&&a.push(','+k)});s(j(a).toString())||a.push(k);a.push(m);a.push('}');break;case e.ObjectPattern:if(!b.properties.length){a='{}';break}v=!1;if(b.properties.length===1)F=b.properties[0],F.value.type!==e.Identifier&&(v=!0);else for(d=0,q=b.properties.length;d<q;++d)if(F=b.properties[d],!F.shorthand){v=!0;break}a=['{',v?k:''];o(function(c){for(d=0,q=b.properties.length;d<q;++d)a.push(v?c:''),a.push(g(b.properties[d],{precedence:f.Sequence,allowIn:!0,allowCall:!0})),d+1<q&&a.push(','+(v?k:h))});v&&!s(j(a).toString())&&a.push(k);a.push(v?m:'');a.push('}');break;case e.ThisExpression:a='this';break;case e.Identifier:a=A(b);break;case e.Literal:if(b.hasOwnProperty('raw')&&I)try{if(H=I(b.raw).body[0].expression,H.type===e.Literal&&H.value===b.value){a=b.raw;break}}catch(a){}if(b.value===null){a='null';break}if(typeof b.value==='string'){a=_(b.value);break}if(typeof b.value==='number'){a=a0(b.value);break}if(typeof b.value==='boolean'){a=b.value?'true':'false';break}a=a3(b.value);break;case e.GeneratorExpression:case e.ComprehensionExpression:a=D===e.GeneratorExpression?['(']:['['];n.moz.comprehensionExpressionStartsWithAssignment&&(c=g(b.body,{precedence:f.Assignment,allowIn:!0,allowCall:!0}),a.push(c));b.blocks&&o(function(){for(d=0,q=b.blocks.length;d<q;++d)c=g(b.blocks[d],{precedence:f.Sequence,allowIn:!0,allowCall:!0}),d>0||n.moz.comprehensionExpressionStartsWithAssignment?a=i(a,c):a.push(c)});b.filter&&(a=i(a,'if'+h),c=g(b.filter,{precedence:f.Sequence,allowIn:!0,allowCall:!0}),n.moz.parenthesizedComprehensionBlock?a=i(a,['(',c,')']):a=i(a,c));n.moz.comprehensionExpressionStartsWithAssignment||(c=g(b.body,{precedence:f.Assignment,allowIn:!0,allowCall:!0}),a=i(a,c));a.push(D===e.GeneratorExpression?')':']');break;case e.ComprehensionBlock:b.left.type===e.VariableDeclaration?c=[b.left.kind,u(),l(b.left.declarations[0],{allowIn:!1})]:c=g(b.left,{precedence:f.Call,allowIn:!0,allowCall:!0});c=i(c,b.of?'of':'in');c=i(c,g(b.right,{precedence:f.Sequence,allowIn:!0,allowCall:!0}));n.moz.parenthesizedComprehensionBlock?a=['for'+h+'(',c,')']:a=i('for'+h,c);break;default:throw new Error('Unknown expression type: '+b.type)}return j(a,b)}function l(b,x){var c,d,a,v,r,F,C,p,m,E;r=!0,m=';',F=!1,C=!1,x&&(r=x.allowIn===undefined||x.allowIn,!O&&x.semicolonOptional===!0&&(m=''),F=x.functionBody,C=x.directiveContext);switch(b.type){case e.BlockStatement:a=['{',k];o(function(){for(c=0,d=b.body.length;c<d;++c)p=t(l(b.body[c],{semicolonOptional:c===d-1,directiveContext:F})),a.push(p),s(j(p).toString())||a.push(k)});a.push(t('}'));break;case e.BreakStatement:b.label?a='break '+b.label.name+m:a='break'+m;break;case e.ContinueStatement:b.label?a='continue '+b.label.name+m:a='continue'+m;break;case e.DirectiveStatement:b.raw?a=b.raw+m:a=a8(b.directive)+m;break;case e.DoWhileStatement:a=i('do',q(b.body));a=y(b.body,a);a=i(a,['while'+h+'(',g(b.test,{precedence:f.Sequence,allowIn:!0,allowCall:!0}),')'+m]);break;case e.CatchClause:o(function(){var c;a=['catch'+h+'(',g(b.param,{precedence:f.Sequence,allowIn:!0,allowCall:!0}),')'],b.guard&&(c=g(b.guard,{precedence:f.Sequence,allowIn:!0,allowCall:!0}),a.splice(2,0,' if ',c))});a.push(q(b.body));break;case e.DebuggerStatement:a='debugger'+m;break;case e.EmptyStatement:a=';';break;case e.ExportDeclaration:a='export ';if(b.declaration){a=[a,l(b.declaration,{semicolonOptional:m===''})];break}break;case e.ExpressionStatement:a=[g(b.expression,{precedence:f.Sequence,allowIn:!0,allowCall:!0})];p=j(a).toString();p.charAt(0)==='{'||p.slice(0,8)==='function'&&'* ('.indexOf(p.charAt(8))>=0||N&&C&&b.expression.type===e.Literal&&typeof b.expression.value==='string'?a=['(',a,')'+m]:a.push(m);break;case e.VariableDeclarator:b.init?a=[g(b.id,{precedence:f.Assignment,allowIn:r,allowCall:!0}),h,'=',h,g(b.init,{precedence:f.Assignment,allowIn:r,allowCall:!0})]:a=U(b.id,{precedence:f.Assignment,allowIn:r});break;case e.VariableDeclaration:a=[b.kind];b.declarations.length===1&&b.declarations[0].init&&b.declarations[0].init.type===e.FunctionExpression?(a.push(u()),a.push(l(b.declarations[0],{allowIn:r}))):o(function(){for(v=b.declarations[0],n.comment&&v.leadingComments?(a.push('\n'),a.push(t(l(v,{allowIn:r})))):(a.push(u()),a.push(l(v,{allowIn:r}))),c=1,d=b.declarations.length;c<d;++c)v=b.declarations[c],n.comment&&v.leadingComments?(a.push(','+k),a.push(t(l(v,{allowIn:r})))):(a.push(','+h),a.push(l(v,{allowIn:r})))});a.push(m);break;case e.ThrowStatement:a=[i('throw',g(b.argument,{precedence:f.Sequence,allowIn:!0,allowCall:!0})),m];break;case e.TryStatement:a=['try',q(b.block)];a=y(b.block,a);if(b.handlers)for(c=0,d=b.handlers.length;c<d;++c)a=i(a,l(b.handlers[c])),(b.finalizer||c+1!==d)&&(a=y(b.handlers[c].body,a));else{for(b.guardedHandlers=b.guardedHandlers||[],c=0,d=b.guardedHandlers.length;c<d;++c)a=i(a,l(b.guardedHandlers[c])),(b.finalizer||c+1!==d)&&(a=y(b.guardedHandlers[c].body,a));if(b.handler)if(B(b.handler))for(c=0,d=b.handler.length;c<d;++c)a=i(a,l(b.handler[c])),(b.finalizer||c+1!==d)&&(a=y(b.handler[c].body,a));else a=i(a,l(b.handler)),b.finalizer&&(a=y(b.handler.body,a))}b.finalizer&&(a=i(a,['finally',q(b.finalizer)]));break;case e.SwitchStatement:o(function(){a=['switch'+h+'(',g(b.discriminant,{precedence:f.Sequence,allowIn:!0,allowCall:!0}),')'+h+'{'+k]});if(b.cases)for(c=0,d=b.cases.length;c<d;++c)p=t(l(b.cases[c],{semicolonOptional:c===d-1})),a.push(p),s(j(p).toString())||a.push(k);a.push(t('}'));break;case e.SwitchCase:o(function(){for(b.test?a=[i('case',g(b.test,{precedence:f.Sequence,allowIn:!0,allowCall:!0})),':']:a=['default:'],c=0,d=b.consequent.length,d&&b.consequent[0].type===e.BlockStatement&&(p=q(b.consequent[0]),a.push(p),c=1),c!==d&&!s(j(a).toString())&&a.push(k);c<d;++c)p=t(l(b.consequent[c],{semicolonOptional:c===d-1&&m===''})),a.push(p),c+1!==d&&!s(j(p).toString())&&a.push(k)});break;case e.IfStatement:o(function(){a=['if'+h+'(',g(b.test,{precedence:f.Sequence,allowIn:!0,allowCall:!0}),')']});b.alternate?(a.push(q(b.consequent)),a=y(b.consequent,a),b.alternate.type===e.IfStatement?a=i(a,['else ',l(b.alternate,{semicolonOptional:m===''})]):a=i(a,i('else',q(b.alternate,m==='')))):a.push(q(b.consequent,m===''));break;case e.ForStatement:o(function(){a=['for'+h+'('],b.init?b.init.type===e.VariableDeclaration?a.push(l(b.init,{allowIn:!1})):(a.push(g(b.init,{precedence:f.Sequence,allowIn:!1,allowCall:!0})),a.push(';')):a.push(';'),b.test?(a.push(h),a.push(g(b.test,{precedence:f.Sequence,allowIn:!0,allowCall:!0})),a.push(';')):a.push(';'),b.update?(a.push(h),a.push(g(b.update,{precedence:f.Sequence,allowIn:!0,allowCall:!0})),a.push(')')):a.push(')')});a.push(q(b.body,m===''));break;case e.ForInStatement:a=W('in',b,m==='');break;case e.ForOfStatement:a=W('of',b,m==='');break;case e.LabeledStatement:a=[b.label.name+':',q(b.body,m==='')];break;case e.Program:d=b.body.length;a=[D&&d>0?'\n':''];for(c=0;c<d;++c)p=t(l(b.body[c],{semicolonOptional:!D&&c===d-1,directiveContext:!0})),a.push(p),c+1<d&&!s(j(p).toString())&&a.push(k);break;case e.FunctionDeclaration:E=b.generator&&!n.moz.starlessGenerator;a=[E?'function*':'function',E?h:u(),A(b.id),z(b)];break;case e.ReturnStatement:b.argument?a=[i('return',g(b.argument,{precedence:f.Sequence,allowIn:!0,allowCall:!0})),m]:a=['return'+m];break;case e.WhileStatement:o(function(){a=['while'+h+'(',g(b.test,{precedence:f.Sequence,allowIn:!0,allowCall:!0}),')']});a.push(q(b.body,m===''));break;case e.WithStatement:o(function(){a=['with'+h+'(',g(b.object,{precedence:f.Sequence,allowIn:!0,allowCall:!0}),')']});a.push(q(b.body,m===''));break;default:throw new Error('Unknown statement type: '+b.type)}return n.comment&&(a=Z(b,a)),p=j(a).toString(),b.type===e.Program&&!D&&k===''&&p.charAt(p.length-1)==='\n'&&(a=w?j(a).replaceRight(/\s+$/,''):p.replace(/\s+$/,'')),j(a,b)}function a1(o,i){var j=P(),p,q;i!=null?(typeof i.indent==='string'&&(j.format.indent.style=i.indent),typeof i.base==='number'&&(j.format.indent.base=i.base),i=F(j,i),x=i.format.indent.style,typeof i.base==='string'?m=i.base:m=H(x,i.format.indent.base)):(i=j,x=i.format.indent.style,m=H(x,i.format.indent.base)),v=i.format.json,K=i.format.renumber,R=v?!1:i.format.hexadecimal,G=v?'double':i.format.quotes,L=i.format.escapeless,k=i.format.newline,h=i.format.space,i.format.compact&&(k=h=x=m=''),J=i.format.parentheses,O=i.format.semicolons,D=i.format.safeConcatenation,N=i.directive,I=v?null:i.parse,w=i.sourceMap,n=i,w&&(c.browser?C=b.sourceMap.SourceNode:C=a('/node_modules/source-map/lib/source-map.js',d).SourceNode);switch(o.type){case e.BlockStatement:case e.BreakStatement:case e.CatchClause:case e.ContinueStatement:case e.DirectiveStatement:case e.DoWhileStatement:case e.DebuggerStatement:case e.EmptyStatement:case e.ExpressionStatement:case e.ForStatement:case e.ForInStatement:case e.ForOfStatement:case e.FunctionDeclaration:case e.IfStatement:case e.LabeledStatement:case e.Program:case e.ReturnStatement:case e.SwitchStatement:case e.SwitchCase:case e.ThrowStatement:case e.TryStatement:case e.VariableDeclaration:case e.VariableDeclarator:case e.WhileStatement:case e.WithStatement:p=l(o);break;case e.AssignmentExpression:case e.ArrayExpression:case e.ArrayPattern:case e.BinaryExpression:case e.CallExpression:case e.ConditionalExpression:case e.FunctionExpression:case e.Identifier:case e.Literal:case e.LogicalExpression:case e.MemberExpression:case e.NewExpression:case e.ObjectExpression:case e.ObjectPattern:case e.Property:case e.SequenceExpression:case e.ThisExpression:case e.UnaryExpression:case e.UpdateExpression:case e.YieldExpression:p=g(o,{precedence:f.Sequence,allowIn:!0,allowCall:!0});break;default:throw new Error('Unknown node type: '+o.type)}return w?(q=p.toStringWithSourceMap({file:i.file,sourceRoot:i.sourceMapRoot}),i.sourceContent&&q.map.setSourceContent(i.sourceMap,i.sourceContent),i.sourceMapWithCode?q:q.map.toString()):p.toString()}V=a('/node_modules/estraverse/estraverse.js',d),p=a('/node_modules/esutils/lib/utils.js',d),e={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',ExportDeclaration:'ExportDeclaration',ExpressionStatement:'ExpressionStatement',ForStatement:'ForStatement',ForInStatement:'ForInStatement',ForOfStatement:'ForOfStatement',FunctionDeclaration:'FunctionDeclaration',FunctionExpression:'FunctionExpression',GeneratorExpression:'GeneratorExpression',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'},f={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},X={'||':f.LogicalOR,'&&':f.LogicalAND,'|':f.BitwiseOR,'^':f.BitwiseXOR,'&':f.BitwiseAND,'==':f.Equality,'!=':f.Equality,'===':f.Equality,'!==':f.Equality,is:f.Equality,isnt:f.Equality,'<':f.Relational,'>':f.Relational,'<=':f.Relational,'>=':f.Relational,'in':f.Relational,'instanceof':f.Relational,'<<':f.BitwiseSHIFT,'>>':f.BitwiseSHIFT,'>>>':f.BitwiseSHIFT,'+':f.Additive,'-':f.Additive,'*':f.Multiplicative,'%':f.Multiplicative,'/':f.Multiplicative},B=Array.isArray,B||(B=function a(b){return Object.prototype.toString.call(b)==='[object Array]'}),Y={indent:{style:'',base:0},renumber:!0,hexadecimal:!0,quotes:'auto',escapeless:!0,compact:!0,parentheses:!1,semicolons:!1},T=P().format,c.version=a('/package.json',d).version,c.generate=a1,c.attachComments=V.attachComments,c.Precedence=F({},f),c.browser=!1,c.FORMAT_MINIFY=Y,c.FORMAT_DEFAULTS=T}()}),a.define('/package.json',function(a,b,c,d){a.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.3.0',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':'*',q:'*',bower:'*',semver:'*',chai:'~1.7.2',gulp:'~3.5.0','gulp-mocha':'~0.4.1','gulp-eslint':'~0.1.2','jshint-stylish':'~0.1.5','gulp-jshint':'~1.4.0','commonjs-everywhere':'~0.9.6'},licenses:[{type:'BSD',url:'http://github.com/Constellation/escodegen/raw/master/LICENSE.BSD'}],scripts:{test:'gulp travis','unit-test':'gulp test',lint:'gulp 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'}}}),a.define('/node_modules/source-map/lib/source-map.js',function(b,c,d,e){c.SourceMapGenerator=a('/node_modules/source-map/lib/source-map/source-map-generator.js',b).SourceMapGenerator,c.SourceMapConsumer=a('/node_modules/source-map/lib/source-map/source-map-consumer.js',b).SourceMapConsumer,c.SourceNode=a('/node_modules/source-map/lib/source-map/source-node.js',b).SourceNode}),a.define('/node_modules/source-map/lib/source-map/source-node.js',function(c,d,e,f){if(typeof b!=='function')var b=a('/node_modules/source-map/node_modules/amdefine/amdefine.js',c)(c,a);b(function(c,f,d){function a(a,b,c,d,e){this.children=[],this.sourceContents={},this.line=a===undefined?null:a,this.column=b===undefined?null:b,this.source=c===undefined?null:c,this.name=e===undefined?null:e,d!=null&&this.add(d)}var e=c('/node_modules/source-map/lib/source-map/source-map-generator.js',d).SourceMapGenerator,b=c('/node_modules/source-map/lib/source-map/util.js',d);a.fromStringWithSourceMap=function b(j,h){function i(b,c){b===null||b.source===undefined?e.add(c):e.add(new a(b.originalLine,b.originalColumn,b.source,c,b.name))}var e=new a,c=j.split('\n'),f=1,d=0,g=null;return h.eachMapping(function(a){if(g===null){while(f<a.generatedLine)e.add(c.shift()+'\n'),f++;if(d<a.generatedColumn){var b=c[0];e.add(b.substr(0,a.generatedColumn)),c[0]=b.substr(a.generatedColumn),d=a.generatedColumn}}else if(f<a.generatedLine){var h='';do h+=c.shift()+'\n',f++,d=0;while(f<a.generatedLine);if(d<a.generatedColumn){var b=c[0];h+=b.substr(0,a.generatedColumn),c[0]=b.substr(a.generatedColumn),d=a.generatedColumn}i(g,h)}else{var b=c[0],h=b.substr(0,a.generatedColumn-d);c[0]=b.substr(a.generatedColumn-d),d=a.generatedColumn,i(g,h)}g=a},this),i(g,c.join('\n')),h.sources.forEach(function(b){var a=h.sourceContentFor(b);a&&e.setSourceContent(b,a)}),e},a.prototype.add=function b(c){if(Array.isArray(c))c.forEach(function(a){this.add(a)},this);else if(c instanceof a||typeof c==='string')c&&this.children.push(c);else throw new TypeError('Expected a SourceNode, string, or an array of SourceNodes and strings. Got '+c);return this},a.prototype.prepend=function b(c){if(Array.isArray(c))for(var d=c.length-1;d>=0;d--)this.prepend(c[d]);else if(c instanceof a||typeof c==='string')this.children.unshift(c);else throw new TypeError('Expected a SourceNode, string, or an array of SourceNodes and strings. Got '+c);return this},a.prototype.walk=function b(e){var c;for(var d=0,f=this.children.length;d<f;d++)c=this.children[d],c instanceof a?c.walk(e):c!==''&&e(c,{source:this.source,line:this.line,column:this.column,name:this.name})},a.prototype.join=function a(e){var b,c,d=this.children.length;if(d>0){for(b=[],c=0;c<d-1;c++)b.push(this.children[c]),b.push(e);b.push(this.children[c]),this.children=b}return this},a.prototype.replaceRight=function b(d,e){var c=this.children[this.children.length-1];return c instanceof a?c.replaceRight(d,e):typeof c==='string'?this.children[this.children.length-1]=c.replace(d,e):this.children.push(''.replace(d,e)),this},a.prototype.setSourceContent=function a(c,d){this.sourceContents[b.toSetString(c)]=d},a.prototype.walkSourceContents=function c(g){for(var d=0,e=this.children.length;d<e;d++)this.children[d]instanceof a&&this.children[d].walkSourceContents(g);var f=Object.keys(this.sourceContents);for(var d=0,e=f.length;d<e;d++)g(b.fromSetString(f[d]),this.sourceContents[f[d]])},a.prototype.toString=function a(){var b='';return this.walk(function(a){b+=a}),b},a.prototype.toStringWithSourceMap=function a(j){var b={code:'',line:1,column:0},c=new e(j),d=!1,f=null,g=null,h=null,i=null;return this.walk(function(e,a){b.code+=e,a.source!==null&&a.line!==null&&a.column!==null?((f!==a.source||g!==a.line||h!==a.column||i!==a.name)&&c.addMapping({source:a.source,original:{line:a.line,column:a.column},generated:{line:b.line,column:b.column},name:a.name}),f=a.source,g=a.line,h=a.column,i=a.name,d=!0):d&&(c.addMapping({generated:{line:b.line,column:b.column}}),f=null,d=!1),e.split('').forEach(function(a){a==='\n'?(b.line++,b.column=0):b.column++})}),this.walkSourceContents(function(a,b){c.setSourceContent(a,b)}),{code:b.code,map:c}},f.SourceNode=a})}),a.define('/node_modules/source-map/lib/source-map/util.js',function(c,d,e,f){if(typeof b!=='function')var b=a('/node_modules/source-map/node_modules/amdefine/amdefine.js',c)(c,a);b(function(n,a,o){function g(b,a,c){if(a in b)return b[a];else if(arguments.length===3)return c;else throw new Error('"'+a+'" is a required argument.')}function d(b){var a=b.match(c);return a?{scheme:a[1],auth:a[3],host:a[4],port:a[6],path:a[7]}:null}function f(a){var b=a.scheme+'://';return a.auth&&(b+=a.auth+'@'),a.host&&(b+=a.host),a.port&&(b+=':'+a.port),a.path&&(b+=a.path),b}function h(g,a){var b;return a.match(c)||a.match(e)?a:a.charAt(0)==='/'&&(b=d(g))?(b.path=a,f(b)):g.replace(/\/$/,'')+'/'+a}function l(a){return'$'+a}function j(a){return a.substr(1)}function k(a,b){a=a.replace(/\/$/,'');var c=d(a);return b.charAt(0)=='/'&&c&&c.path=='/'?b.slice(1):b.indexOf(a+'/')===0?b.substr(a.length+1):b}function b(c,d){var a=c||'',b=d||'';return(a>b)-(a<b)}function m(c,d,e){var a;return a=b(c.source,d.source),a?a:(a=c.originalLine-d.originalLine,a?a:(a=c.originalColumn-d.originalColumn,a||e?a:(a=b(c.name,d.name),a?a:(a=c.generatedLine-d.generatedLine,a?a:c.generatedColumn-d.generatedColumn))))}function i(c,d,e){var a;return a=c.generatedLine-d.generatedLine,a?a:(a=c.generatedColumn-d.generatedColumn,a||e?a:(a=b(c.source,d.source),a?a:(a=c.originalLine-d.originalLine,a?a:(a=c.originalColumn-d.originalColumn,a?a:b(c.name,d.name)))))}a.getArg=g;var c=/([\w+\-.]+):\/\/((\w+:\w+)@)?([\w.]+)?(:(\d+))?(\S+)?/,e=/^data:.+\,.+/;a.urlParse=d,a.urlGenerate=f,a.join=h,a.toSetString=l,a.fromSetString=j,a.relative=k,a.compareByOriginalPositions=m,a.compareByGeneratedPositions=i})}),a.define('/node_modules/source-map/node_modules/amdefine/amdefine.js',function(b,f,g,d){'use strict';function e(e,i){'use strict';function q(b){var a,c;for(a=0;b[a];a+=1)if(c=b[a],c==='.')b.splice(a,1),a-=1;else if(c==='..')if(a===1&&(b[2]==='..'||b[0]==='..'))break;else a>0&&(b.splice(a-1,2),a-=2)}function j(b,c){var a;return b&&b.charAt(0)==='.'&&c&&(a=c.split('/'),a=a.slice(0,a.length-1),a=a.concat(b.split('/')),q(a),b=a.join('/')),b}function p(a){return function(b){return j(b,a)}}function o(c){function a(a){b[c]=a}return a.fromText=function(a,b){throw new Error('amdefine does not implement load.fromText')},a}function m(c,h,l){var m,f,a,j;if(c)f=b[c]={},a={id:c,uri:d,exports:f},m=g(i,f,a,c);else{if(k)throw new Error('amdefine with no module ID cannot be called more than once per file.');k=!0,f=e.exports,a=e,m=g(i,f,a,e.id)}h&&(h=h.map(function(a){return m(a)})),typeof l==='function'?j=l.apply(a.exports,h):j=l,j!==undefined&&(a.exports=j,c&&(b[c]=a.exports))}function l(b,a,c){Array.isArray(b)?(c=a,a=b,b=undefined):typeof b!=='string'&&(c=b,b=a=undefined),a&&!Array.isArray(a)&&(c=a,a=undefined),a||(a=['require','exports','module']),b?f[b]=[b,a,c]:m(b,a,c)}var f={},b={},k=!1,n=a('path',e),g,h;return g=function(b,d,a,e){function f(f,g){if(typeof f==='string')return h(b,d,a,f,e);f=f.map(function(c){return h(b,d,a,c,e)}),c.nextTick(function(){g.apply(null,f)})}return f.toUrl=function(b){return b.indexOf('.')===0?j(b,n.dirname(a.filename)):b},f},i=i||function a(){return e.require.apply(e,arguments)},h=function(d,e,i,a,c){var k=a.indexOf('!'),n=a,q,l;if(k===-1)if(a=j(a,c),a==='require')return g(d,e,i,c);else if(a==='exports')return e;else if(a==='module')return i;else if(b.hasOwnProperty(a))return b[a];else if(f[a])return m.apply(null,f[a]),b[a];else if(d)return d(n);else throw new Error('No module with ID: '+a);else return q=a.substring(0,k),a=a.substring(k+1,a.length),l=h(d,e,i,q,c),l.normalize?a=l.normalize(a,p(c)):a=j(a,c),b[a]?b[a]:(l.load(a,g(d,e,i,c),o(a),{}),b[a])},l.require=function(a){return b[a]?b[a]:f[a]?(m.apply(null,f[a]),b[a]):void 0},l.amd={},l}b.exports=e}),a.define('/node_modules/source-map/lib/source-map/source-map-generator.js',function(c,d,e,f){if(typeof b!=='function')var b=a('/node_modules/source-map/node_modules/amdefine/amdefine.js',c)(c,a);b(function(e,g,f){function b(b){this._file=a.getArg(b,'file'),this._sourceRoot=a.getArg(b,'sourceRoot',null),this._sources=new d,this._names=new d,this._mappings=[],this._sourcesContents=null}var c=e('/node_modules/source-map/lib/source-map/base64-vlq.js',f),a=e('/node_modules/source-map/lib/source-map/util.js',f),d=e('/node_modules/source-map/lib/source-map/array-set.js',f).ArraySet;b.prototype._version=3,b.fromSourceMap=function c(d){var e=d.sourceRoot,f=new b({file:d.file,sourceRoot:e});return d.eachMapping(function(b){var c={generated:{line:b.generatedLine,column:b.generatedColumn}};b.source&&(c.source=b.source,e&&(c.source=a.relative(e,c.source)),c.original={line:b.originalLine,column:b.originalColumn},b.name&&(c.name=b.name)),f.addMapping(c)}),d.sources.forEach(function(b){var a=d.sourceContentFor(b);a&&f.setSourceContent(b,a)}),f},b.prototype.addMapping=function b(f){var g=a.getArg(f,'generated'),c=a.getArg(f,'original',null),d=a.getArg(f,'source',null),e=a.getArg(f,'name',null);this._validateMapping(g,c,d,e),d&&!this._sources.has(d)&&this._sources.add(d),e&&!this._names.has(e)&&this._names.add(e),this._mappings.push({generatedLine:g.line,generatedColumn:g.column,originalLine:c!=null&&c.line,originalColumn:c!=null&&c.column,source:d,name:e})},b.prototype.setSourceContent=function b(e,d){var c=e;this._sourceRoot&&(c=a.relative(this._sourceRoot,c)),d!==null?(this._sourcesContents||(this._sourcesContents={}),this._sourcesContents[a.toSetString(c)]=d):(delete this._sourcesContents[a.toSetString(c)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},b.prototype.applySourceMap=function b(f,e){e||(e=f.file);var c=this._sourceRoot;c&&(e=a.relative(c,e));var g=new d,h=new d;this._mappings.forEach(function(b){if(b.source===e&&b.originalLine){var d=f.originalPositionFor({line:b.originalLine,column:b.originalColumn});d.source!==null&&(c?b.source=a.relative(c,d.source):b.source=d.source,b.originalLine=d.line,b.originalColumn=d.column,d.name!==null&&b.name!==null&&(b.name=d.name))}var i=b.source;i&&!g.has(i)&&g.add(i);var j=b.name;j&&!h.has(j)&&h.add(j)},this),this._sources=g,this._names=h,f.sources.forEach(function(b){var d=f.sourceContentFor(b);d&&(c&&(b=a.relative(c,b)),this.setSourceContent(b,d))},this)},b.prototype._validateMapping=function a(b,c,d,e){if(b&&'line'in b&&'column'in b&&b.line>0&&b.column>=0&&!c&&!d&&!e)return;else if(b&&'line'in b&&'column'in b&&c&&'line'in c&&'column'in c&&b.line>0&&b.column>=0&&c.line>0&&c.column>=0&&d)return;else throw new Error('Invalid mapping: '+JSON.stringify({generated:b,source:d,orginal:c,name:e}))},b.prototype._serializeMappings=function b(){var h=0,g=1,j=0,k=0,i=0,l=0,e='',d;this._mappings.sort(a.compareByGeneratedPositions);for(var f=0,m=this._mappings.length;f<m;f++){if(d=this._mappings[f],d.generatedLine!==g){h=0;while(d.generatedLine!==g)e+=';',g++}else if(f>0){if(!a.compareByGeneratedPositions(d,this._mappings[f-1]))continue;e+=','}e+=c.encode(d.generatedColumn-h),h=d.generatedColumn,d.source&&(e+=c.encode(this._sources.indexOf(d.source)-l),l=this._sources.indexOf(d.source),e+=c.encode(d.originalLine-1-k),k=d.originalLine-1,e+=c.encode(d.originalColumn-j),j=d.originalColumn,d.name&&(e+=c.encode(this._names.indexOf(d.name)-i),i=this._names.indexOf(d.name)))}return e},b.prototype._generateSourcesContent=function b(d,c){return d.map(function(b){if(!this._sourcesContents)return null;c&&(b=a.relative(c,b));var d=a.toSetString(b);return Object.prototype.hasOwnProperty.call(this._sourcesContents,d)?this._sourcesContents[d]:null},this)},b.prototype.toJSON=function a(){var b={version:this._version,file:this._file,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._sourceRoot&&(b.sourceRoot=this._sourceRoot),this._sourcesContents&&(b.sourcesContent=this._generateSourcesContent(b.sources,b.sourceRoot)),b},b.prototype.toString=function a(){return JSON.stringify(this)},g.SourceMapGenerator=b})}),a.define('/node_modules/source-map/lib/source-map/array-set.js',function(c,d,e,f){if(typeof b!=='function')var b=a('/node_modules/source-map/node_modules/amdefine/amdefine.js',c)(c,a);b(function(c,d,e){function a(){this._array=[],this._set={}}var b=c('/node_modules/source-map/lib/source-map/util.js',e);a.fromArray=function b(e,g){var d=new a;for(var c=0,f=e.length;c<f;c++)d.add(e[c],g);return d},a.prototype.add=function a(c,f){var d=this.has(c),e=this._array.length;(!d||f)&&this._array.push(c),d||(this._set[b.toSetString(c)]=e)},a.prototype.has=function a(c){return Object.prototype.hasOwnProperty.call(this._set,b.toSetString(c))},a.prototype.indexOf=function a(c){if(this.has(c))return this._set[b.toSetString(c)];throw new Error('"'+c+'" is not in the set.')},a.prototype.at=function a(b){if(b>=0&&b<this._array.length)return this._array[b];throw new Error('No element indexed by '+b)},a.prototype.toArray=function a(){return this._array.slice()},d.ArraySet=a})}),a.define('/node_modules/source-map/lib/source-map/base64-vlq.js',function(c,d,e,f){if(typeof b!=='function')var b=a('/node_modules/source-map/node_modules/amdefine/amdefine.js',c)(c,a);b(function(j,f,h){function i(a){return a<0?(-a<<1)+1:(a<<1)+0}function g(b){var c=(b&1)===1,a=b>>1;return c?-a:a}var c=j('/node_modules/source-map/lib/source-map/base64.js',h),a=5,d=1<<a,e=d-1,b=d;f.encode=function d(j){var g='',h,f=i(j);do h=f&e,f>>>=a,f>0&&(h|=b),g+=c.encode(h);while(f>0);return g},f.decode=function d(i){var f=0,l=i.length,j=0,k=0,m,h;do{if(f>=l)throw new Error('Expected more digits in base 64 VLQ value.');h=c.decode(i.charAt(f++)),m=!!(h&b),h&=e,j+=h<<k,k+=a}while(m);return{value:g(j),rest:i.slice(f)}}})}),a.define('/node_modules/source-map/lib/source-map/base64.js',function(c,d,e,f){if(typeof b!=='function')var b=a('/node_modules/source-map/node_modules/amdefine/amdefine.js',c)(c,a);b(function(d,c,e){var a={},b={};'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('').forEach(function(c,d){a[c]=d,b[d]=c}),c.encode=function a(c){if(c in b)return b[c];throw new TypeError('Must be between 0 and 63: '+c)},c.decode=function b(c){if(c in a)return a[c];throw new TypeError('Not a valid base 64 digit: '+c)}})}),a.define('/node_modules/source-map/lib/source-map/source-map-consumer.js',function(c,d,e,f){if(typeof b!=='function')var b=a('/node_modules/source-map/node_modules/amdefine/amdefine.js',c)(c,a);b(function(e,h,f){function b(c){var b=c;typeof c==='string'&&(b=JSON.parse(c.replace(/^\)\]\}'/,'')));var e=a.getArg(b,'version'),f=a.getArg(b,'sources'),g=a.getArg(b,'names',[]),h=a.getArg(b,'sourceRoot',null),i=a.getArg(b,'sourcesContent',null),j=a.getArg(b,'mappings'),k=a.getArg(b,'file',null);if(e!=this._version)throw new Error('Unsupported version: '+e);this._names=d.fromArray(g,!0),this._sources=d.fromArray(f,!0),this.sourceRoot=h,this.sourcesContent=i,this._mappings=j,this.file=k}var a=e('/node_modules/source-map/lib/source-map/util.js',f),g=e('/node_modules/source-map/lib/source-map/binary-search.js',f),d=e('/node_modules/source-map/lib/source-map/array-set.js',f).ArraySet,c=e('/node_modules/source-map/lib/source-map/base64-vlq.js',f);b.fromSourceMap=function c(f){var e=Object.create(b.prototype);return e._names=d.fromArray(f._names.toArray(),!0),e._sources=d.fromArray(f._sources.toArray(),!0),e.sourceRoot=f._sourceRoot,e.sourcesContent=f._generateSourcesContent(e._sources.toArray(),e.sourceRoot),e.file=f._file,e.__generatedMappings=f._mappings.slice().sort(a.compareByGeneratedPositions),e.__originalMappings=f._mappings.slice().sort(a.compareByOriginalPositions),e},b.prototype._version=3,Object.defineProperty(b.prototype,'sources',{get:function(){return this._sources.toArray().map(function(b){return this.sourceRoot?a.join(this.sourceRoot,b):b},this)}}),b.prototype.__generatedMappings=null,Object.defineProperty(b.prototype,'_generatedMappings',{get:function(){return this.__generatedMappings||(this.__generatedMappings=[],this.__originalMappings=[],this._parseMappings(this._mappings,this.sourceRoot)),this.__generatedMappings}}),b.prototype.__originalMappings=null,Object.defineProperty(b.prototype,'_originalMappings',{get:function(){return this.__originalMappings||(this.__generatedMappings=[],this.__originalMappings=[],this._parseMappings(this._mappings,this.sourceRoot)),this.__originalMappings}}),b.prototype._parseMappings=function b(n,o){var j=1,h=0,i=0,m=0,k=0,l=0,g=/^[,;]/,d=n,f,e;while(d.length>0)if(d.charAt(0)===';')j++,d=d.slice(1),h=0;else if(d.charAt(0)===',')d=d.slice(1);else{if(f={},f.generatedLine=j,e=c.decode(d),f.generatedColumn=h+e.value,h=f.generatedColumn,d=e.rest,d.length>0&&!g.test(d.charAt(0))){if(e=c.decode(d),f.source=this._sources.at(k+e.value),k+=e.value,d=e.rest,d.length===0||g.test(d.charAt(0)))throw new Error('Found a source, but no line and column');if(e=c.decode(d),f.originalLine=i+e.value,i=f.originalLine,f.originalLine+=1,d=e.rest,d.length===0||g.test(d.charAt(0)))throw new Error('Found a source and line, but no column');e=c.decode(d),f.originalColumn=m+e.value,m=f.originalColumn,d=e.rest,d.length>0&&!g.test(d.charAt(0))&&(e=c.decode(d),f.name=this._names.at(l+e.value),l+=e.value,d=e.rest)}this.__generatedMappings.push(f),typeof f.originalLine==='number'&&this.__originalMappings.push(f)}this.__originalMappings.sort(a.compareByOriginalPositions)},b.prototype._findMapping=function a(b,e,c,d,f){if(b[c]<=0)throw new TypeError('Line must be greater than or equal to 1, got '+b[c]);if(b[d]<0)throw new TypeError('Column must be greater than or equal to 0, got '+b[d]);return g.search(b,e,f)},b.prototype.originalPositionFor=function b(e){var f={generatedLine:a.getArg(e,'line'),generatedColumn:a.getArg(e,'column')},c=this._findMapping(f,this._generatedMappings,'generatedLine','generatedColumn',a.compareByGeneratedPositions);if(c){var d=a.getArg(c,'source',null);return d&&this.sourceRoot&&(d=a.join(this.sourceRoot,d)),{source:d,line:a.getArg(c,'originalLine',null),column:a.getArg(c,'originalColumn',null),name:a.getArg(c,'name',null)}}return{source:null,line:null,column:null,name:null}},b.prototype.sourceContentFor=function b(c){if(!this.sourcesContent)return null;if(this.sourceRoot&&(c=a.relative(this.sourceRoot,c)),this._sources.has(c))return this.sourcesContent[this._sources.indexOf(c)];var d;if(this.sourceRoot&&(d=a.urlParse(this.sourceRoot))){var e=c.replace(/^file:\/\//,'');if(d.scheme=='file'&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!d.path||d.path=='/')&&this._sources.has('/'+c))return this.sourcesContent[this._sources.indexOf('/'+c)]}throw new Error('"'+c+'" is not in the SourceMap.')},b.prototype.generatedPositionFor=function b(e){var c={source:a.getArg(e,'source'),originalLine:a.getArg(e,'line'),originalColumn:a.getArg(e,'column')};this.sourceRoot&&(c.source=a.relative(this.sourceRoot,c.source));var d=this._findMapping(c,this._originalMappings,'originalLine','originalColumn',a.compareByOriginalPositions);return d?{line:a.getArg(d,'generatedLine',null),column:a.getArg(d,'generatedColumn',null)}:{line:null,column:null}},b.GENERATED_ORDER=1,b.ORIGINAL_ORDER=2,b.prototype.eachMapping=function c(h,i,j){var f=i||null,g=j||b.GENERATED_ORDER,d;switch(g){case b.GENERATED_ORDER:d=this._generatedMappings;break;case b.ORIGINAL_ORDER:d=this._originalMappings;break;default:throw new Error('Unknown order of iteration.')}var e=this.sourceRoot;d.map(function(b){var c=b.source;return c&&e&&(c=a.join(e,c)),{source:c,generatedLine:b.generatedLine,generatedColumn:b.generatedColumn,originalLine:b.originalLine,originalColumn:b.originalColumn,name:b.name}}).forEach(h,f)},h.SourceMapConsumer=b})}),a.define('/node_modules/source-map/lib/source-map/binary-search.js',function(c,d,e,f){if(typeof b!=='function')var b=a('/node_modules/source-map/node_modules/amdefine/amdefine.js',c)(c,a);b(function(c,b,d){function a(c,e,f,d,g){var b=Math.floor((e-c)/2)+c,h=g(f,d[b],!0);return h===0?d[b]:h>0?e-b>1?a(b,e,f,d,g):d[b]:b-c>1?a(c,b,f,d,g):c<0?null:d[c]}b.search=function b(d,c,e){return c.length>0?a(-1,c.length,d,c,e):null}})}),a.define('/node_modules/esutils/lib/utils.js',function(b,c,d,e){!function(){'use strict';c.code=a('/node_modules/esutils/lib/code.js',b),c.keyword=a('/node_modules/esutils/lib/keyword.js',b)}()}),a.define('/node_modules/esutils/lib/keyword.js',function(b,c,d,e){!function(c){'use strict';function e(a){switch(a){case'implements':case'interface':case'package':case'private':case'protected':case'public':case'static':case'let':return!0;default:return!1}}function f(a,b){return!b&&a==='yield'?!1:d(a,b)}function d(a,b){if(b&&e(a))return!0;switch(a.length){case 2:return a==='if'||a==='in'||a==='do';case 3:return a==='var'||a==='for'||a==='new'||a==='try';case 4:return a==='this'||a==='else'||a==='case'||a==='void'||a==='with'||a==='enum';case 5:return a==='while'||a==='break'||a==='catch'||a==='throw'||a==='const'||a==='yield'||a==='class'||a==='super';case 6:return a==='return'||a==='typeof'||a==='delete'||a==='switch'||a==='export'||a==='import';case 7:return a==='default'||a==='finally'||a==='extends';case 8:return a==='function'||a==='continue'||a==='debugger';case 10:return a==='instanceof';default:return!1}}function g(a){return a==='eval'||a==='arguments'}function h(b){var d,e,a;if(b.length===0)return!1;if(a=b.charCodeAt(0),!c.isIdentifierStart(a)||a===92)return!1;for(d=1,e=b.length;d<e;++d)if(a=b.charCodeAt(d),!c.isIdentifierPart(a)||a===92)return!1;return!0}c=a('/node_modules/esutils/lib/code.js',b),b.exports={isKeywordES5:f,isKeywordES6:d,isRestrictedWord:g,isIdentifierName:h}}()}),a.define('/node_modules/esutils/lib/code.js',function(a,b,c,d){!function(b){'use strict';function c(a){return a>=48&&a<=57}function d(a){return c(a)||97<=a&&a<=102||65<=a&&a<=70}function e(a){return a>=48&&a<=55}function f(a){return a===32||a===9||a===11||a===12||a===160||a>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(a)>=0}function g(a){return a===10||a===13||a===8232||a===8233}function h(a){return a===36||a===95||a>=65&&a<=90||a>=97&&a<=122||a===92||a>=128&&b.NonAsciiIdentifierStart.test(String.fromCharCode(a))}function i(a){return a===36||a===95||a>=65&&a<=90||a>=97&&a<=122||a>=48&&a<=57||a===92||a>=128&&b.NonAsciiIdentifierPart.test(String.fromCharCode(a))}b={NonAsciiIdentifierStart:new RegExp('[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]'),NonAsciiIdentifierPart:new RegExp('[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]')},a.exports={isDecimalDigit:c,isHexDigit:d,isOctalDigit:e,isWhiteSpace:f,isLineTerminator:g,isIdentifierStart:h,isIdentifierPart:i}}()}),a.define('/node_modules/estraverse/estraverse.js',function(b,a,c,d){!function(c,b){'use strict';typeof define==='function'&&define.amd?define(['exports'],b):a!==void 0?b(a):b(c.estraverse={})}(this,function(e){'use strict';function m(){}function l(d){var c={},a,b;for(a in d)d.hasOwnProperty(a)&&(b=d[a],typeof b==='object'&&b!==null?c[a]=l(b):c[a]=b);return c}function s(b){var c={},a;for(a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);return c}function r(e,f){var b,a,c,d;a=e.length,c=0;while(a)b=a>>>1,d=c+b,f(e[d])?a=b:(c=d+1,a-=b+1);return c}function q(e,f){var b,a,c,d;a=e.length,c=0;while(a)b=a>>>1,d=c+b,f(e[d])?(c=d+1,a-=b+1):a=b;return c}function h(a,b){this.parent=a,this.key=b}function d(a,b,c,d){this.node=a,this.path=b,this.wrap=c,this.ref=d}function b(){}function k(c,d){var a=new b;return a.traverse(c,d)}function p(c,d){var a=new b;return a.replace(c,d)}function n(a,c){var b;return b=r(c,function b(c){return c.range[0]>a.range[0]}),a.extendedRange=[a.range[0],a.range[1]],b!==c.length&&(a.extendedRange[1]=c[b].range[0]),b-=1,b>=0&&(a.extendedRange[0]=c[b].range[1]),a}function o(d,e,i){var a=[],h,g,c,b;if(!d.range)throw new Error('attachComments needs range information');if(!i.length){if(e.length){for(c=0,g=e.length;c<g;c+=1)h=l(e[c]),h.extendedRange=[0,d.range[0]],a.push(h);d.leadingComments=a}return d}for(c=0,g=e.length;c<g;c+=1)a.push(n(l(e[c]),i));return b=0,k(d,{enter:function(c){var d;while(b<a.length){if(d=a[b],d.extendedRange[1]>c.range[0])break;d.extendedRange[1]===c.range[0]?(c.leadingComments||(c.leadingComments=[]),c.leadingComments.push(d),a.splice(b,1)):b+=1}return b===a.length?f.Break:a[b].extendedRange[0]>c.range[1]?f.Skip:void 0}}),b=0,k(d,{leave:function(c){var d;while(b<a.length){if(d=a[b],c.range[1]<d.extendedRange[0])break;c.range[1]===d.extendedRange[0]?(c.trailingComments||(c.trailingComments=[]),c.trailingComments.push(d),a.splice(b,1)):b+=1}return b===a.length?f.Break:a[b].extendedRange[0]>c.range[1]?f.Skip:void 0}}),d}var i,g,f,j,a,c;i={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'},g=Array.isArray,g||(g=function a(b){return Object.prototype.toString.call(b)==='[object Array]'}),m(s),m(q),j={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']},a={},c={},f={Break:a,Skip:c},h.prototype.replace=function a(b){this.parent[this.key]=b},b.prototype.path=function a(){function e(b,a){if(g(a))for(c=0,h=a.length;c<h;++c)b.push(a[c]);else b.push(a)}var b,f,c,h,d,i;if(!this.__current.path)return null;for(d=[],b=2,f=this.__leavelist.length;b<f;++b)i=this.__leavelist[b],e(d,i.path);return e(d,this.__current.path),d},b.prototype.parents=function a(){var b,d,c;for(c=[],b=1,d=this.__leavelist.length;b<d;++b)c.push(this.__leavelist[b].node);return c},b.prototype.current=function a(){return this.__current.node},b.prototype.__execute=function a(c,d){var e,b;return b=undefined,e=this.__current,this.__current=d,this.__state=null,c&&(b=c.call(this,d.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=e,b},b.prototype.notify=function a(b){this.__state=b},b.prototype.skip=function(){this.notify(c)},b.prototype['break']=function(){this.notify(a)},b.prototype.__initialize=function(a,b){this.visitor=b,this.root=a,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null},b.prototype.traverse=function b(u,r){var h,o,e,t,n,l,m,p,k,q,f,s;this.__initialize(u,r),s={},h=this.__worklist,o=this.__leavelist,h.push(new d(u,null,null,null)),o.push(new d(null,null,null,null));while(h.length){if(e=h.pop(),e===s){if(e=o.pop(),l=this.__execute(r.leave,e),this.__state===a||l===a)return;continue}if(e.node){if(l=this.__execute(r.enter,e),this.__state===a||l===a)return;if(h.push(s),o.push(e),this.__state===c||l===c)continue;t=e.node,n=e.wrap||t.type,q=j[n],p=q.length;while((p-=1)>=0){if(m=q[p],f=t[m],!f)continue;if(!g(f)){h.push(new d(f,m,null,null));continue}k=f.length;while((k-=1)>=0){if(!f[k])continue;(n===i.ObjectExpression||n===i.ObjectPattern)&&'properties'===q[p]?e=new d(f[k],[m,k],'Property',null):e=new d(f[k],[m,k],null,null),h.push(e)}}}}},b.prototype.replace=function b(u,v){var m,r,o,t,f,e,q,l,s,k,w,p,n;this.__initialize(u,v),w={},m=this.__worklist,r=this.__leavelist,p={root:u},e=new d(u,null,null,new h(p,'root')),m.push(e),r.push(e);while(m.length){if(e=m.pop(),e===w){if(e=r.pop(),f=this.__execute(v.leave,e),f!==undefined&&f!==a&&f!==c&&e.ref.replace(f),this.__state===a||f===a)return p.root;continue}if(f=this.__execute(v.enter,e),f!==undefined&&f!==a&&f!==c&&(e.ref.replace(f),e.node=f),this.__state===a||f===a)return p.root;if(o=e.node,!o)continue;if(m.push(w),r.push(e),this.__state===c||f===c)continue;t=e.wrap||o.type,s=j[t],q=s.length;while((q-=1)>=0){if(n=s[q],k=o[n],!k)continue;if(!g(k)){m.push(new d(k,n,null,new h(o,n)));continue}l=k.length;while((l-=1)>=0){if(!k[l])continue;t===i.ObjectExpression&&'properties'===s[q]?e=new d(k[l],[n,l],'Property',new h(k,l)):e=new d(k[l],[n,l],null,new h(k,l)),m.push(e)}}}return p.root},e.version='1.3.3-dev',e.Syntax=i,e.traverse=k,e.replace=p,e.attachComments=o,e.VisitorKeys=j,e.VisitorOption=f,e.Controller=b})}),a('/tools/entry-point.js')}.call(this,this))
diff --git a/package.json b/package.json
index 3fda6db..a95c034 100644
--- a/package.json
+++ b/package.json
@@ -1,60 +1,60 @@
{
- "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.2.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.3.0",
+ "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": "*",
+ "q": "*",
+ "bower": "*",
+ "semver": "*",
+ "chai": "~1.7.2",
+ "gulp": "~3.5.0",
+ "gulp-mocha": "~0.4.1",
+ "gulp-eslint": "~0.1.2",
+ "jshint-stylish": "~0.1.5",
+ "gulp-jshint": "~1.4.0",
+ "commonjs-everywhere": "~0.9.6"
+ },
+ "licenses": [
+ {
+ "type": "BSD",
+ "url": "http://github.com/Constellation/escodegen/raw/master/LICENSE.BSD"
+ }
+ ],
+ "scripts": {
+ "test": "gulp travis",
+ "unit-test": "gulp test",
+ "lint": "gulp 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": "*",
- "q": "*",
- "bower": "*",
- "semver": "*",
- "chai": "~1.7.2",
- "gulp": "~3.5.0",
- "gulp-mocha": "~0.4.1",
- "gulp-eslint": "~0.1.2",
- "jshint-stylish": "~0.1.5",
- "gulp-jshint": "~1.4.0",
- "commonjs-everywhere": "~0.9.6"
- },
- "licenses": [
- {
- "type": "BSD",
- "url": "http://github.com/Constellation/escodegen/raw/master/LICENSE.BSD"
- }
- ],
- "scripts": {
- "test": "gulp travis",
- "unit-test": "gulp test",
- "lint": "gulp 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