diff --git a/docs/demo/astring.min.js b/docs/demo/astring.min.js index 46a39419..25cefbaa 100644 --- a/docs/demo/astring.min.js +++ b/docs/demo/astring.min.js @@ -1,3 +1,3 @@ -(function(a,b){if("function"==typeof define&&define.amd)define(["exports"],b);else if("undefined"!=typeof exports)b(exports);else{var c={exports:{}};b(c.exports),a.astring=c.exports}})("undefined"==typeof globalThis?"undefined"==typeof self?this:self:globalThis,function(a){"use strict";var m=String.prototype;function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function c(a,b){for(var c,d=0;d":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},p=17;a.NEEDS_PARENTHESES=p;var q={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:p,ClassExpression:p,FunctionExpression:p,ObjectExpression:p,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,YieldExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,RestElement:1};a.EXPRESSIONS_PRECEDENCE=q;var r,s,t,u,v,w,x={Program:function Program(a,b){var c=b.indent.repeat(b.indentLevel),d=b.lineEnd,e=b.writeComments;e&&null!=a.comments&&j(b,a.comments,c,d);for(var f,g=a.body,h=g.length,k=0;k "),"O"===a.body.type[0]?(b.write("("),this.ObjectExpression(a.body,b),b.write(")")):this[a.body.type](a.body,b)},ThisExpression:function ThisExpression(a,b){b.write("this",a)},Super:function Super(a,b){b.write("super",a)},RestElement:t=function(a,b){b.write("..."),this[a.argument.type](a.argument,b)},SpreadElement:t,YieldExpression:function YieldExpression(a,b){b.write(a.delegate?"yield*":"yield"),a.argument&&(b.write(" "),this[a.argument.type](a.argument,b))},AwaitExpression:function AwaitExpression(a,b){b.write("await ",a),g(b,a.argument,a)},TemplateLiteral:function TemplateLiteral(a,b){var c=a.quasis,d=a.expressions;b.write("`");for(var e=d.length,f=0;fb.expressionsPrecedence.ConditionalExpression?this[a.test.type](a.test,b):(b.write("("),this[a.test.type](a.test,b),b.write(")")),b.write(" ? "),this[a.consequent.type](a.consequent,b),b.write(" : "),this[a.alternate.type](a.alternate,b)},NewExpression:function NewExpression(a,b){b.write("new "),b.expressionsPrecedence[a.callee.type]":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},p=17;a.NEEDS_PARENTHESES=p;var q={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:p,ClassExpression:p,FunctionExpression:p,ObjectExpression:p,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};a.EXPRESSIONS_PRECEDENCE=q;var r,s,t,u,v,w,x={Program:function Program(a,b){var c=b.indent.repeat(b.indentLevel),d=b.lineEnd,e=b.writeComments;e&&null!=a.comments&&k(b,a.comments,c,d);for(var f,g=a.body,h=g.length,j=0;j "),"O"===a.body.type[0]?(b.write("("),this.ObjectExpression(a.body,b),b.write(")")):this[a.body.type](a.body,b)},ThisExpression:function ThisExpression(a,b){b.write("this",a)},Super:function Super(a,b){b.write("super",a)},RestElement:t=function(a,b){b.write("..."),this[a.argument.type](a.argument,b)},SpreadElement:t,YieldExpression:function YieldExpression(a,b){b.write(a.delegate?"yield*":"yield"),a.argument&&(b.write(" "),this[a.argument.type](a.argument,b))},AwaitExpression:function AwaitExpression(a,b){b.write("await ",a),h(b,a.argument,a)},TemplateLiteral:function TemplateLiteral(a,b){var c=a.quasis,d=a.expressions;b.write("`");for(var e=d.length,f=0;f': 9,\n '<=': 9,\n '>=': 9,\n in: 9,\n instanceof: 9,\n '<<': 10,\n '>>': 10,\n '>>>': 10,\n '+': 11,\n '-': 11,\n '*': 12,\n '%': 12,\n '/': 12,\n '**': 13,\n}\n\n// Enables parenthesis regardless of precedence\nexport const NEEDS_PARENTHESES = 17\n\nexport const EXPRESSIONS_PRECEDENCE = {\n // Definitions\n ArrayExpression: 20,\n TaggedTemplateExpression: 20,\n ThisExpression: 20,\n Identifier: 20,\n Literal: 18,\n TemplateLiteral: 20,\n Super: 20,\n SequenceExpression: 20,\n // Operations\n MemberExpression: 19,\n ChainExpression: 19,\n CallExpression: 19,\n NewExpression: 19,\n // Other definitions\n ArrowFunctionExpression: NEEDS_PARENTHESES,\n ClassExpression: NEEDS_PARENTHESES,\n FunctionExpression: NEEDS_PARENTHESES,\n ObjectExpression: NEEDS_PARENTHESES,\n // Other operations\n UpdateExpression: 16,\n UnaryExpression: 15,\n AwaitExpression: 15,\n YieldExpression: 15,\n BinaryExpression: 14,\n LogicalExpression: 13,\n ConditionalExpression: 4,\n AssignmentExpression: 3,\n RestElement: 1,\n}\n\nfunction formatSequence(state, nodes) {\n /*\n Writes into `state` a sequence of `nodes`.\n */\n const { generator } = state\n state.write('(')\n if (nodes != null && nodes.length > 0) {\n generator[nodes[0].type](nodes[0], state)\n const { length } = nodes\n for (let i = 1; i < length; i++) {\n const param = nodes[i]\n state.write(', ')\n generator[param.type](param, state)\n }\n }\n state.write(')')\n}\n\nfunction expressionNeedsParenthesis(state, node, parentNode, isRightHand) {\n const nodePrecedence = state.expressionsPrecedence[node.type]\n if (nodePrecedence === NEEDS_PARENTHESES) {\n return true\n }\n const parentNodePrecedence = state.expressionsPrecedence[parentNode.type]\n if (nodePrecedence !== parentNodePrecedence) {\n // Different node types\n return (\n (!isRightHand &&\n nodePrecedence === 15 &&\n parentNodePrecedence === 14 &&\n parentNode.operator === '**') ||\n nodePrecedence < parentNodePrecedence\n )\n }\n if (nodePrecedence !== 13 && nodePrecedence !== 14) {\n // Not a `LogicalExpression` or `BinaryExpression`\n return false\n }\n if (node.operator === '**' && parentNode.operator === '**') {\n // Exponentiation operator has right-to-left associativity\n return !isRightHand\n }\n if (isRightHand) {\n // Parenthesis are used if both operators have the same precedence\n return (\n OPERATOR_PRECEDENCE[node.operator] <=\n OPERATOR_PRECEDENCE[parentNode.operator]\n )\n }\n return (\n OPERATOR_PRECEDENCE[node.operator] <\n OPERATOR_PRECEDENCE[parentNode.operator]\n )\n}\n\nfunction formatExpression(state, node, parentNode, isRightHand) {\n /*\n Writes into `state` a left-hand or right-hand expression `node`\n from a binary expression applying the provided `operator`.\n The `isRightHand` parameter should be `true` if the `node` is a right-hand argument.\n */\n const { generator } = state\n if (expressionNeedsParenthesis(state, node, parentNode, isRightHand)) {\n state.write('(')\n generator[node.type](node, state)\n state.write(')')\n } else {\n generator[node.type](node, state)\n }\n}\n\nfunction reindent(state, text, indent, lineEnd) {\n /*\n Writes into `state` the `text` string reindented with the provided `indent`.\n */\n const lines = text.split('\\n')\n const end = lines.length - 1\n state.write(lines[0].trim())\n if (end > 0) {\n state.write(lineEnd)\n for (let i = 1; i < end; i++) {\n state.write(indent + lines[i].trim() + lineEnd)\n }\n state.write(indent + lines[end].trim())\n }\n}\n\nfunction formatComments(state, comments, indent, lineEnd) {\n /*\n Writes into `state` the provided list of `comments`, with the given `indent` and `lineEnd` strings.\n Line comments will end with `\"\\n\"` regardless of the value of `lineEnd`.\n Expects to start on a new unindented line.\n */\n const { length } = comments\n for (let i = 0; i < length; i++) {\n const comment = comments[i]\n state.write(indent)\n if (comment.type[0] === 'L') {\n // Line comment\n state.write('// ' + comment.value.trim() + '\\n', comment)\n } else {\n // Block comment\n state.write('/*')\n reindent(state, comment.value, indent, lineEnd)\n state.write('*/' + lineEnd)\n }\n }\n}\n\nfunction hasCallExpression(node) {\n /*\n Returns `true` if the provided `node` contains a call expression and `false` otherwise.\n */\n let currentNode = node\n while (currentNode != null) {\n const { type } = currentNode\n if (type[0] === 'C' && type[1] === 'a') {\n // Is CallExpression\n return true\n } else if (type[0] === 'M' && type[1] === 'e' && type[2] === 'm') {\n // Is MemberExpression\n currentNode = currentNode.object\n } else {\n return false\n }\n }\n}\n\nfunction formatVariableDeclaration(state, node) {\n /*\n Writes into `state` a variable declaration.\n */\n const { generator } = state\n const { declarations } = node\n state.write(node.kind + ' ')\n const { length } = declarations\n if (length > 0) {\n generator.VariableDeclarator(declarations[0], state)\n for (let i = 1; i < length; i++) {\n state.write(', ')\n generator.VariableDeclarator(declarations[i], state)\n }\n }\n}\n\nlet ForInStatement,\n FunctionDeclaration,\n RestElement,\n BinaryExpression,\n ArrayExpression,\n BlockStatement\n\nexport const GENERATOR = {\n /*\n Default generator.\n */\n Program(node, state) {\n const indent = state.indent.repeat(state.indentLevel)\n const { lineEnd, writeComments } = state\n if (writeComments && node.comments != null) {\n formatComments(state, node.comments, indent, lineEnd)\n }\n const statements = node.body\n const { length } = statements\n for (let i = 0; i < length; i++) {\n const statement = statements[i]\n if (writeComments && statement.comments != null) {\n formatComments(state, statement.comments, indent, lineEnd)\n }\n state.write(indent)\n this[statement.type](statement, state)\n state.write(lineEnd)\n }\n if (writeComments && node.trailingComments != null) {\n formatComments(state, node.trailingComments, indent, lineEnd)\n }\n },\n BlockStatement: (BlockStatement = function (node, state) {\n const indent = state.indent.repeat(state.indentLevel++)\n const { lineEnd, writeComments } = state\n const statementIndent = indent + state.indent\n state.write('{')\n const statements = node.body\n if (statements != null && statements.length > 0) {\n state.write(lineEnd)\n if (writeComments && node.comments != null) {\n formatComments(state, node.comments, statementIndent, lineEnd)\n }\n const { length } = statements\n for (let i = 0; i < length; i++) {\n const statement = statements[i]\n if (writeComments && statement.comments != null) {\n formatComments(state, statement.comments, statementIndent, lineEnd)\n }\n state.write(statementIndent)\n this[statement.type](statement, state)\n state.write(lineEnd)\n }\n state.write(indent)\n } else {\n if (writeComments && node.comments != null) {\n state.write(lineEnd)\n formatComments(state, node.comments, statementIndent, lineEnd)\n state.write(indent)\n }\n }\n if (writeComments && node.trailingComments != null) {\n formatComments(state, node.trailingComments, statementIndent, lineEnd)\n }\n state.write('}')\n state.indentLevel--\n }),\n ClassBody: BlockStatement,\n EmptyStatement(node, state) {\n state.write(';')\n },\n ExpressionStatement(node, state) {\n const precedence = state.expressionsPrecedence[node.expression.type]\n if (\n precedence === NEEDS_PARENTHESES ||\n (precedence === 3 && node.expression.left.type[0] === 'O')\n ) {\n // Should always have parentheses or is an AssignmentExpression to an ObjectPattern\n state.write('(')\n this[node.expression.type](node.expression, state)\n state.write(')')\n } else {\n this[node.expression.type](node.expression, state)\n }\n state.write(';')\n },\n IfStatement(node, state) {\n state.write('if (')\n this[node.test.type](node.test, state)\n state.write(') ')\n this[node.consequent.type](node.consequent, state)\n if (node.alternate != null) {\n state.write(' else ')\n this[node.alternate.type](node.alternate, state)\n }\n },\n LabeledStatement(node, state) {\n this[node.label.type](node.label, state)\n state.write(': ')\n this[node.body.type](node.body, state)\n },\n BreakStatement(node, state) {\n state.write('break')\n if (node.label != null) {\n state.write(' ')\n this[node.label.type](node.label, state)\n }\n state.write(';')\n },\n ContinueStatement(node, state) {\n state.write('continue')\n if (node.label != null) {\n state.write(' ')\n this[node.label.type](node.label, state)\n }\n state.write(';')\n },\n WithStatement(node, state) {\n state.write('with (')\n this[node.object.type](node.object, state)\n state.write(') ')\n this[node.body.type](node.body, state)\n },\n SwitchStatement(node, state) {\n const indent = state.indent.repeat(state.indentLevel++)\n const { lineEnd, writeComments } = state\n state.indentLevel++\n const caseIndent = indent + state.indent\n const statementIndent = caseIndent + state.indent\n state.write('switch (')\n this[node.discriminant.type](node.discriminant, state)\n state.write(') {' + lineEnd)\n const { cases: occurences } = node\n const { length: occurencesCount } = occurences\n for (let i = 0; i < occurencesCount; i++) {\n const occurence = occurences[i]\n if (writeComments && occurence.comments != null) {\n formatComments(state, occurence.comments, caseIndent, lineEnd)\n }\n if (occurence.test) {\n state.write(caseIndent + 'case ')\n this[occurence.test.type](occurence.test, state)\n state.write(':' + lineEnd)\n } else {\n state.write(caseIndent + 'default:' + lineEnd)\n }\n const { consequent } = occurence\n const { length: consequentCount } = consequent\n for (let i = 0; i < consequentCount; i++) {\n const statement = consequent[i]\n if (writeComments && statement.comments != null) {\n formatComments(state, statement.comments, statementIndent, lineEnd)\n }\n state.write(statementIndent)\n this[statement.type](statement, state)\n state.write(lineEnd)\n }\n }\n state.indentLevel -= 2\n state.write(indent + '}')\n },\n ReturnStatement(node, state) {\n state.write('return')\n if (node.argument) {\n state.write(' ')\n this[node.argument.type](node.argument, state)\n }\n state.write(';')\n },\n ThrowStatement(node, state) {\n state.write('throw ')\n this[node.argument.type](node.argument, state)\n state.write(';')\n },\n TryStatement(node, state) {\n state.write('try ')\n this[node.block.type](node.block, state)\n if (node.handler) {\n const { handler } = node\n if (handler.param == null) {\n state.write(' catch ')\n } else {\n state.write(' catch (')\n this[handler.param.type](handler.param, state)\n state.write(') ')\n }\n this[handler.body.type](handler.body, state)\n }\n if (node.finalizer) {\n state.write(' finally ')\n this[node.finalizer.type](node.finalizer, state)\n }\n },\n WhileStatement(node, state) {\n state.write('while (')\n this[node.test.type](node.test, state)\n state.write(') ')\n this[node.body.type](node.body, state)\n },\n DoWhileStatement(node, state) {\n state.write('do ')\n this[node.body.type](node.body, state)\n state.write(' while (')\n this[node.test.type](node.test, state)\n state.write(');')\n },\n ForStatement(node, state) {\n state.write('for (')\n if (node.init != null) {\n const { init } = node\n if (init.type[0] === 'V') {\n formatVariableDeclaration(state, init)\n } else {\n this[init.type](init, state)\n }\n }\n state.write('; ')\n if (node.test) {\n this[node.test.type](node.test, state)\n }\n state.write('; ')\n if (node.update) {\n this[node.update.type](node.update, state)\n }\n state.write(') ')\n this[node.body.type](node.body, state)\n },\n ForInStatement: (ForInStatement = function (node, state) {\n state.write(`for ${node.await ? 'await ' : ''}(`)\n const { left } = node\n if (left.type[0] === 'V') {\n formatVariableDeclaration(state, left)\n } else {\n this[left.type](left, state)\n }\n // Identifying whether node.type is `ForInStatement` or `ForOfStatement`\n state.write(node.type[3] === 'I' ? ' in ' : ' of ')\n this[node.right.type](node.right, state)\n state.write(') ')\n this[node.body.type](node.body, state)\n }),\n ForOfStatement: ForInStatement,\n DebuggerStatement(node, state) {\n state.write('debugger;' + state.lineEnd)\n },\n FunctionDeclaration: (FunctionDeclaration = function (node, state) {\n state.write(\n (node.async ? 'async ' : '') +\n (node.generator ? 'function* ' : 'function ') +\n (node.id ? node.id.name : ''),\n node,\n )\n formatSequence(state, node.params)\n state.write(' ')\n this[node.body.type](node.body, state)\n }),\n FunctionExpression: FunctionDeclaration,\n VariableDeclaration(node, state) {\n formatVariableDeclaration(state, node)\n state.write(';')\n },\n VariableDeclarator(node, state) {\n this[node.id.type](node.id, state)\n if (node.init != null) {\n state.write(' = ')\n this[node.init.type](node.init, state)\n }\n },\n ClassDeclaration(node, state) {\n state.write('class ' + (node.id ? `${node.id.name} ` : ''), node)\n if (node.superClass) {\n state.write('extends ')\n this[node.superClass.type](node.superClass, state)\n state.write(' ')\n }\n this.ClassBody(node.body, state)\n },\n ImportDeclaration(node, state) {\n state.write('import ')\n const { specifiers } = node\n const { length } = specifiers\n // NOTE: Once babili is fixed, put this after condition\n // https://github.com/babel/babili/issues/430\n let i = 0\n if (length > 0) {\n for (; i < length; ) {\n if (i > 0) {\n state.write(', ')\n }\n const specifier = specifiers[i]\n const type = specifier.type[6]\n if (type === 'D') {\n // ImportDefaultSpecifier\n state.write(specifier.local.name, specifier)\n i++\n } else if (type === 'N') {\n // ImportNamespaceSpecifier\n state.write('* as ' + specifier.local.name, specifier)\n i++\n } else {\n // ImportSpecifier\n break\n }\n }\n if (i < length) {\n state.write('{')\n for (;;) {\n const specifier = specifiers[i]\n const { name } = specifier.imported\n state.write(name, specifier)\n if (name !== specifier.local.name) {\n state.write(' as ' + specifier.local.name)\n }\n if (++i < length) {\n state.write(', ')\n } else {\n break\n }\n }\n state.write('}')\n }\n state.write(' from ')\n }\n this.Literal(node.source, state)\n state.write(';')\n },\n ImportExpression(node, state) {\n state.write('import(')\n this[node.source.type](node.source, state)\n state.write(')')\n },\n ExportDefaultDeclaration(node, state) {\n state.write('export default ')\n this[node.declaration.type](node.declaration, state)\n if (\n state.expressionsPrecedence[node.declaration.type] != null &&\n node.declaration.type[0] !== 'F'\n ) {\n // All expression nodes except `FunctionExpression`\n state.write(';')\n }\n },\n ExportNamedDeclaration(node, state) {\n state.write('export ')\n if (node.declaration) {\n this[node.declaration.type](node.declaration, state)\n } else {\n state.write('{')\n const { specifiers } = node,\n { length } = specifiers\n if (length > 0) {\n for (let i = 0; ; ) {\n const specifier = specifiers[i]\n const { name } = specifier.local\n state.write(name, specifier)\n if (name !== specifier.exported.name) {\n state.write(' as ' + specifier.exported.name)\n }\n if (++i < length) {\n state.write(', ')\n } else {\n break\n }\n }\n }\n state.write('}')\n if (node.source) {\n state.write(' from ')\n this.Literal(node.source, state)\n }\n state.write(';')\n }\n },\n ExportAllDeclaration(node, state) {\n if (node.exported != null) {\n state.write('export * as ' + node.exported.name + ' from ')\n } else {\n state.write('export * from ')\n }\n this.Literal(node.source, state)\n state.write(';')\n },\n MethodDefinition(node, state) {\n if (node.static) {\n state.write('static ')\n }\n const kind = node.kind[0]\n if (kind === 'g' || kind === 's') {\n // Getter or setter\n state.write(node.kind + ' ')\n }\n if (node.value.async) {\n state.write('async ')\n }\n if (node.value.generator) {\n state.write('*')\n }\n if (node.computed) {\n state.write('[')\n this[node.key.type](node.key, state)\n state.write(']')\n } else {\n this[node.key.type](node.key, state)\n }\n formatSequence(state, node.value.params)\n state.write(' ')\n this[node.value.body.type](node.value.body, state)\n },\n ClassExpression(node, state) {\n this.ClassDeclaration(node, state)\n },\n ArrowFunctionExpression(node, state) {\n state.write(node.async ? 'async ' : '', node)\n const { params } = node\n if (params != null) {\n // Omit parenthesis if only one named parameter\n if (params.length === 1 && params[0].type[0] === 'I') {\n // If params[0].type[0] starts with 'I', it can't be `ImportDeclaration` nor `IfStatement` and thus is `Identifier`\n state.write(params[0].name, params[0])\n } else {\n formatSequence(state, node.params)\n }\n }\n state.write(' => ')\n if (node.body.type[0] === 'O') {\n // Body is an object expression\n state.write('(')\n this.ObjectExpression(node.body, state)\n state.write(')')\n } else {\n this[node.body.type](node.body, state)\n }\n },\n ThisExpression(node, state) {\n state.write('this', node)\n },\n Super(node, state) {\n state.write('super', node)\n },\n RestElement: (RestElement = function (node, state) {\n state.write('...')\n this[node.argument.type](node.argument, state)\n }),\n SpreadElement: RestElement,\n YieldExpression(node, state) {\n state.write(node.delegate ? 'yield*' : 'yield')\n if (node.argument) {\n state.write(' ')\n this[node.argument.type](node.argument, state)\n }\n },\n AwaitExpression(node, state) {\n state.write('await ', node)\n formatExpression(state, node.argument, node)\n },\n TemplateLiteral(node, state) {\n const { quasis, expressions } = node\n state.write('`')\n const { length } = expressions\n for (let i = 0; i < length; i++) {\n const expression = expressions[i]\n const quasi = quasis[i]\n state.write(quasi.value.raw, quasi)\n state.write('${')\n this[expression.type](expression, state)\n state.write('}')\n }\n const quasi = quasis[quasis.length - 1]\n state.write(quasi.value.raw, quasi)\n state.write('`')\n },\n TemplateElement(node, state) {\n state.write(node.value.raw, node)\n },\n TaggedTemplateExpression(node, state) {\n this[node.tag.type](node.tag, state)\n this[node.quasi.type](node.quasi, state)\n },\n ArrayExpression: (ArrayExpression = function (node, state) {\n state.write('[')\n if (node.elements.length > 0) {\n const { elements } = node,\n { length } = elements\n for (let i = 0; ; ) {\n const element = elements[i]\n if (element != null) {\n this[element.type](element, state)\n }\n if (++i < length) {\n state.write(', ')\n } else {\n if (element == null) {\n state.write(', ')\n }\n break\n }\n }\n }\n state.write(']')\n }),\n ArrayPattern: ArrayExpression,\n ObjectExpression(node, state) {\n const indent = state.indent.repeat(state.indentLevel++)\n const { lineEnd, writeComments } = state\n const propertyIndent = indent + state.indent\n state.write('{')\n if (node.properties.length > 0) {\n state.write(lineEnd)\n if (writeComments && node.comments != null) {\n formatComments(state, node.comments, propertyIndent, lineEnd)\n }\n const comma = ',' + lineEnd\n const { properties } = node,\n { length } = properties\n for (let i = 0; ; ) {\n const property = properties[i]\n if (writeComments && property.comments != null) {\n formatComments(state, property.comments, propertyIndent, lineEnd)\n }\n state.write(propertyIndent)\n this[property.type](property, state)\n if (++i < length) {\n state.write(comma)\n } else {\n break\n }\n }\n state.write(lineEnd)\n if (writeComments && node.trailingComments != null) {\n formatComments(state, node.trailingComments, propertyIndent, lineEnd)\n }\n state.write(indent + '}')\n } else if (writeComments) {\n if (node.comments != null) {\n state.write(lineEnd)\n formatComments(state, node.comments, propertyIndent, lineEnd)\n if (node.trailingComments != null) {\n formatComments(state, node.trailingComments, propertyIndent, lineEnd)\n }\n state.write(indent + '}')\n } else if (node.trailingComments != null) {\n state.write(lineEnd)\n formatComments(state, node.trailingComments, propertyIndent, lineEnd)\n state.write(indent + '}')\n } else {\n state.write('}')\n }\n } else {\n state.write('}')\n }\n state.indentLevel--\n },\n Property(node, state) {\n if (node.method || node.kind[0] !== 'i') {\n // Either a method or of kind `set` or `get` (not `init`)\n this.MethodDefinition(node, state)\n } else {\n if (!node.shorthand) {\n if (node.computed) {\n state.write('[')\n this[node.key.type](node.key, state)\n state.write(']')\n } else {\n this[node.key.type](node.key, state)\n }\n state.write(': ')\n }\n this[node.value.type](node.value, state)\n }\n },\n ObjectPattern(node, state) {\n state.write('{')\n if (node.properties.length > 0) {\n const { properties } = node,\n { length } = properties\n for (let i = 0; ; ) {\n this[properties[i].type](properties[i], state)\n if (++i < length) {\n state.write(', ')\n } else {\n break\n }\n }\n }\n state.write('}')\n },\n SequenceExpression(node, state) {\n formatSequence(state, node.expressions)\n },\n UnaryExpression(node, state) {\n if (node.prefix) {\n const {\n operator,\n argument,\n argument: { type },\n } = node\n state.write(operator)\n if (\n operator.length > 1 ||\n (type[0] === 'U' &&\n (type[1] === 'n' || type[1] === 'p') &&\n argument.prefix &&\n argument.operator[0] === operator &&\n (operator === '+' || operator === '-'))\n ) {\n // Large operator or argument is UnaryExpression or UpdateExpression node\n state.write(' ')\n }\n if (\n state.expressionsPrecedence[type] <\n state.expressionsPrecedence.UnaryExpression\n ) {\n state.write('(')\n this[type](argument, state)\n state.write(')')\n } else {\n this[type](argument, state)\n }\n } else {\n // FIXME: This case never occurs\n this[node.argument.type](node.argument, state)\n state.write(node.operator)\n }\n },\n UpdateExpression(node, state) {\n // Always applied to identifiers or members, no parenthesis check needed\n if (node.prefix) {\n state.write(node.operator)\n this[node.argument.type](node.argument, state)\n } else {\n this[node.argument.type](node.argument, state)\n state.write(node.operator)\n }\n },\n AssignmentExpression(node, state) {\n this[node.left.type](node.left, state)\n state.write(' ' + node.operator + ' ')\n this[node.right.type](node.right, state)\n },\n AssignmentPattern(node, state) {\n this[node.left.type](node.left, state)\n state.write(' = ')\n this[node.right.type](node.right, state)\n },\n BinaryExpression: (BinaryExpression = function (node, state) {\n const isIn = node.operator === 'in'\n if (isIn) {\n // Avoids confusion in `for` loops initializers\n state.write('(')\n }\n formatExpression(state, node.left, node, false)\n state.write(' ' + node.operator + ' ')\n formatExpression(state, node.right, node, true)\n if (isIn) {\n state.write(')')\n }\n }),\n LogicalExpression: BinaryExpression,\n ConditionalExpression(node, state) {\n if (\n state.expressionsPrecedence[node.test.type] >\n state.expressionsPrecedence.ConditionalExpression\n ) {\n this[node.test.type](node.test, state)\n } else {\n state.write('(')\n this[node.test.type](node.test, state)\n state.write(')')\n }\n state.write(' ? ')\n this[node.consequent.type](node.consequent, state)\n state.write(' : ')\n this[node.alternate.type](node.alternate, state)\n },\n NewExpression(node, state) {\n state.write('new ')\n if (\n state.expressionsPrecedence[node.callee.type] <\n state.expressionsPrecedence.CallExpression ||\n hasCallExpression(node.callee)\n ) {\n state.write('(')\n this[node.callee.type](node.callee, state)\n state.write(')')\n } else {\n this[node.callee.type](node.callee, state)\n }\n formatSequence(state, node['arguments'])\n },\n CallExpression(node, state) {\n if (\n state.expressionsPrecedence[node.callee.type] <\n state.expressionsPrecedence.CallExpression\n ) {\n state.write('(')\n this[node.callee.type](node.callee, state)\n state.write(')')\n } else {\n this[node.callee.type](node.callee, state)\n }\n if (node.optional) {\n state.write('?.')\n }\n formatSequence(state, node['arguments'])\n },\n ChainExpression(node, state) {\n this[node.expression.type](node.expression, state)\n },\n MemberExpression(node, state) {\n if (\n state.expressionsPrecedence[node.object.type] <\n state.expressionsPrecedence.MemberExpression\n ) {\n state.write('(')\n this[node.object.type](node.object, state)\n state.write(')')\n } else {\n this[node.object.type](node.object, state)\n }\n if (node.computed) {\n if (node.optional) {\n state.write('?.')\n }\n state.write('[')\n this[node.property.type](node.property, state)\n state.write(']')\n } else {\n if (node.optional) {\n state.write('?.')\n } else {\n state.write('.')\n }\n this[node.property.type](node.property, state)\n }\n },\n MetaProperty(node, state) {\n state.write(node.meta.name + '.' + node.property.name, node)\n },\n Identifier(node, state) {\n state.write(node.name, node)\n },\n Literal(node, state) {\n if (node.raw != null) {\n // Non-standard property\n state.write(node.raw, node)\n } else if (node.regex != null) {\n this.RegExpLiteral(node, state)\n } else if (node.bigint != null) {\n state.write(node.bigint + 'n', node)\n } else {\n state.write(stringify(node.value), node)\n }\n },\n RegExpLiteral(node, state) {\n const { regex } = node\n state.write(`/${regex.pattern}/${regex.flags}`, node)\n },\n}\n\nconst EMPTY_OBJECT = {}\n\n/*\nDEPRECATED: Alternate export of `GENERATOR`.\n*/\nexport const baseGenerator = GENERATOR\n\nclass State {\n constructor(options) {\n const setup = options == null ? EMPTY_OBJECT : options\n this.output = ''\n // Functional options\n if (setup.output != null) {\n this.output = setup.output\n this.write = this.writeToStream\n } else {\n this.output = ''\n }\n this.generator = setup.generator != null ? setup.generator : GENERATOR\n this.expressionsPrecedence =\n setup.expressionsPrecedence != null\n ? setup.expressionsPrecedence\n : EXPRESSIONS_PRECEDENCE\n // Formating setup\n this.indent = setup.indent != null ? setup.indent : ' '\n this.lineEnd = setup.lineEnd != null ? setup.lineEnd : '\\n'\n this.indentLevel =\n setup.startingIndentLevel != null ? setup.startingIndentLevel : 0\n this.writeComments = setup.comments ? setup.comments : false\n // Source map\n if (setup.sourceMap != null) {\n this.write =\n setup.output == null ? this.writeAndMap : this.writeToStreamAndMap\n this.sourceMap = setup.sourceMap\n this.line = 1\n this.column = 0\n this.lineEndSize = this.lineEnd.split('\\n').length - 1\n this.mapping = {\n original: null,\n // Uses the entire state to avoid generating ephemeral objects\n generated: this,\n name: undefined,\n source: setup.sourceMap.file || setup.sourceMap._file,\n }\n }\n }\n\n write(code) {\n this.output += code\n }\n\n writeToStream(code) {\n this.output.write(code)\n }\n\n writeAndMap(code, node) {\n this.output += code\n this.map(code, node)\n }\n\n writeToStreamAndMap(code, node) {\n this.output.write(code)\n this.map(code, node)\n }\n\n map(code, node) {\n if (node != null) {\n const { type } = node\n if (type[0] === 'L' && type[2] === 'n') {\n // LineComment\n this.column = 0\n this.line++\n return\n }\n if (node.loc != null) {\n const { mapping } = this\n mapping.original = node.loc.start\n mapping.name = node.name\n this.sourceMap.addMapping(mapping)\n }\n if (\n (type[0] === 'T' && type[8] === 'E') ||\n (type[0] === 'L' && type[1] === 'i' && typeof node.value === 'string')\n ) {\n // TemplateElement or Literal string node\n const { length } = code\n let { column, line } = this\n for (let i = 0; i < length; i++) {\n if (code[i] === '\\n') {\n column = 0\n line++\n } else {\n column++\n }\n }\n this.column = column\n this.line = line\n return\n }\n }\n const { length } = code\n const { lineEnd } = this\n if (length > 0) {\n if (\n this.lineEndSize > 0 &&\n (lineEnd.length === 1\n ? code[length - 1] === lineEnd\n : code.endsWith(lineEnd))\n ) {\n this.line += this.lineEndSize\n this.column = 0\n } else {\n this.column += length\n }\n }\n }\n\n toString() {\n return this.output\n }\n}\n\nexport function generate(node, options) {\n /*\n Returns a string representing the rendered code of the provided AST `node`.\n The `options` are:\n\n - `indent`: string to use for indentation (defaults to `␣␣`)\n - `lineEnd`: string to use for line endings (defaults to `\\n`)\n - `startingIndentLevel`: indent level to start from (defaults to `0`)\n - `comments`: generate comments if `true` (defaults to `false`)\n - `output`: output stream to write the rendered code to (defaults to `null`)\n - `generator`: custom code generator (defaults to `GENERATOR`)\n - `expressionsPrecedence`: custom map of node types and their precedence level (defaults to `EXPRESSIONS_PRECEDENCE`)\n */\n const state = new State(options)\n // Travel through the AST node and generate the code\n state.generator[node.type](node, state)\n return state.output\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../src/astring.js"],"names":[],"mappings":"qSAaK,MAAM,CAAC,S,0TA6EZ,QAAS,CAAA,CAAT,CAAwB,CAAxB,CAA+B,CAA/B,CAAsC,IAI5B,CAAA,CAJ4B,CAId,CAJc,CAI5B,SAJ4B,CAMpC,GADA,CAAK,CAAC,KAAN,CAAY,GAAZ,CACA,CAAa,IAAT,EAAA,CAAK,EAA2B,CAAf,CAAA,CAAK,CAAC,MAA3B,CAAuC,CACrC,CAAS,CAAC,CAAK,CAAC,CAAD,CAAL,CAAS,IAAV,CAAT,CAAyB,CAAK,CAAC,CAAD,CAA9B,CAAmC,CAAnC,CADqC,CAGrC,OACQ,CAAA,CADR,CADQ,CACR,CADmB,CACnB,CADQ,MACR,CAAS,CAAC,CAAG,CAAb,CAAgB,CAAC,CAAG,CAApB,CAA4B,CAAC,EAA7B,CACQ,CADR,CACgB,CAAK,CAAC,CAAD,CADrB,CAEE,CAAK,CAAC,KAAN,CAAY,IAAZ,CAFF,CAGE,CAAS,CAAC,CAAK,CAAC,IAAP,CAAT,CAAsB,CAAtB,CAA6B,CAA7B,CAEH,CACD,CAAK,CAAC,KAAN,CAAY,GAAZ,CACD,CAED,QAAS,CAAA,CAAT,CAAoC,CAApC,CAA2C,CAA3C,CAAiD,CAAjD,CAA6D,CAA7D,CAA0E,CACxE,GAAM,CAAA,CAAc,CAAG,CAAK,CAAC,qBAAN,CAA4B,CAAI,CAAC,IAAjC,CAAvB,CACA,GAAI,CAAc,KAAlB,CACE,SAEF,GAAM,CAAA,CAAoB,CAAG,CAAK,CAAC,qBAAN,CAA4B,CAAU,CAAC,IAAvC,CAA7B,CALwE,MAMpE,CAAA,CAAc,GAAK,C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AmCN,MAnCM,CAoCN,CApCM,CAoCM,IApCN,CAoCN,OApCM,CAqCD,CAAT,CAAA,CArCU,GAuCS,CAAnB,MAAK,WAAL,GACoB,CAAnB,GAAA,CAAO,CAAC,MAAR,CACG,CAAI,CAAC,CAAM,CAAG,CAAV,CAAJ,GAAqB,CADxB,CAEG,CAAI,CAAC,QAAL,CAAc,CAAd,CAHJ,CAvCU,EA4CV,KAAK,IAAL,EAAa,KAAK,WA5CR,CA6CV,KAAK,MAAL,CAAc,CA7CJ,EA+CV,KAAK,MAAL,EAAe,CA/CL,CAkDf,C,wBAED,mBAAW,CACT,MAAO,MAAK,MACb,C","file":"astring.min.js","sourcesContent":["// Astring is a tiny and fast JavaScript code generator from an ESTree-compliant AST.\n//\n// Astring was written by David Bonnet and released under an MIT license.\n//\n// The Git repository for Astring is available at:\n// https://github.com/davidbonnet/astring.git\n//\n// Please use the GitHub bug tracker to report issues:\n// https://github.com/davidbonnet/astring/issues\n\nconst { stringify } = JSON\n\n/* c8 ignore if */\nif (!String.prototype.repeat) {\n /* c8 ignore next */\n throw new Error(\n 'String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation',\n )\n}\n\n/* c8 ignore if */\nif (!String.prototype.endsWith) {\n /* c8 ignore next */\n throw new Error(\n 'String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation',\n )\n}\n\nconst OPERATOR_PRECEDENCE = {\n '||': 3,\n '&&': 4,\n '|': 5,\n '^': 6,\n '&': 7,\n '==': 8,\n '!=': 8,\n '===': 8,\n '!==': 8,\n '<': 9,\n '>': 9,\n '<=': 9,\n '>=': 9,\n in: 9,\n instanceof: 9,\n '<<': 10,\n '>>': 10,\n '>>>': 10,\n '+': 11,\n '-': 11,\n '*': 12,\n '%': 12,\n '/': 12,\n '**': 13,\n}\n\n// Enables parenthesis regardless of precedence\nexport const NEEDS_PARENTHESES = 17\n\nexport const EXPRESSIONS_PRECEDENCE = {\n // Definitions\n ArrayExpression: 20,\n TaggedTemplateExpression: 20,\n ThisExpression: 20,\n Identifier: 20,\n Literal: 18,\n TemplateLiteral: 20,\n Super: 20,\n SequenceExpression: 20,\n // Operations\n MemberExpression: 19,\n ChainExpression: 19,\n CallExpression: 19,\n NewExpression: 19,\n // Other definitions\n ArrowFunctionExpression: NEEDS_PARENTHESES,\n ClassExpression: NEEDS_PARENTHESES,\n FunctionExpression: NEEDS_PARENTHESES,\n ObjectExpression: NEEDS_PARENTHESES,\n // Other operations\n UpdateExpression: 16,\n UnaryExpression: 15,\n AwaitExpression: 15,\n BinaryExpression: 14,\n LogicalExpression: 13,\n ConditionalExpression: 4,\n AssignmentExpression: 3,\n YieldExpression: 2,\n RestElement: 1,\n}\n\nfunction formatSequence(state, nodes) {\n /*\n Writes into `state` a sequence of `nodes`.\n */\n const { generator } = state\n state.write('(')\n if (nodes != null && nodes.length > 0) {\n generator[nodes[0].type](nodes[0], state)\n const { length } = nodes\n for (let i = 1; i < length; i++) {\n const param = nodes[i]\n state.write(', ')\n generator[param.type](param, state)\n }\n }\n state.write(')')\n}\n\nfunction expressionNeedsParenthesis(state, node, parentNode, isRightHand) {\n const nodePrecedence = state.expressionsPrecedence[node.type]\n if (nodePrecedence === NEEDS_PARENTHESES) {\n return true\n }\n const parentNodePrecedence = state.expressionsPrecedence[parentNode.type]\n if (nodePrecedence !== parentNodePrecedence) {\n // Different node types\n return (\n (!isRightHand &&\n nodePrecedence === 15 &&\n parentNodePrecedence === 14 &&\n parentNode.operator === '**') ||\n nodePrecedence < parentNodePrecedence\n )\n }\n if (nodePrecedence !== 13 && nodePrecedence !== 14) {\n // Not a `LogicalExpression` or `BinaryExpression`\n return false\n }\n if (node.operator === '**' && parentNode.operator === '**') {\n // Exponentiation operator has right-to-left associativity\n return !isRightHand\n }\n if (isRightHand) {\n // Parenthesis are used if both operators have the same precedence\n return (\n OPERATOR_PRECEDENCE[node.operator] <=\n OPERATOR_PRECEDENCE[parentNode.operator]\n )\n }\n return (\n OPERATOR_PRECEDENCE[node.operator] <\n OPERATOR_PRECEDENCE[parentNode.operator]\n )\n}\n\nfunction formatExpression(state, node, parentNode, isRightHand) {\n /*\n Writes into `state` the provided `node`, adding parenthesis around if the provided `parentNode` needs it. If `node` is a right-hand argument, the provided `isRightHand` parameter should be `true`.\n */\n const { generator } = state\n if (expressionNeedsParenthesis(state, node, parentNode, isRightHand)) {\n state.write('(')\n generator[node.type](node, state)\n state.write(')')\n } else {\n generator[node.type](node, state)\n }\n}\n\nfunction reindent(state, text, indent, lineEnd) {\n /*\n Writes into `state` the `text` string reindented with the provided `indent`.\n */\n const lines = text.split('\\n')\n const end = lines.length - 1\n state.write(lines[0].trim())\n if (end > 0) {\n state.write(lineEnd)\n for (let i = 1; i < end; i++) {\n state.write(indent + lines[i].trim() + lineEnd)\n }\n state.write(indent + lines[end].trim())\n }\n}\n\nfunction formatComments(state, comments, indent, lineEnd) {\n /*\n Writes into `state` the provided list of `comments`, with the given `indent` and `lineEnd` strings.\n Line comments will end with `\"\\n\"` regardless of the value of `lineEnd`.\n Expects to start on a new unindented line.\n */\n const { length } = comments\n for (let i = 0; i < length; i++) {\n const comment = comments[i]\n state.write(indent)\n if (comment.type[0] === 'L') {\n // Line comment\n state.write('// ' + comment.value.trim() + '\\n', comment)\n } else {\n // Block comment\n state.write('/*')\n reindent(state, comment.value, indent, lineEnd)\n state.write('*/' + lineEnd)\n }\n }\n}\n\nfunction hasCallExpression(node) {\n /*\n Returns `true` if the provided `node` contains a call expression and `false` otherwise.\n */\n let currentNode = node\n while (currentNode != null) {\n const { type } = currentNode\n if (type[0] === 'C' && type[1] === 'a') {\n // Is CallExpression\n return true\n } else if (type[0] === 'M' && type[1] === 'e' && type[2] === 'm') {\n // Is MemberExpression\n currentNode = currentNode.object\n } else {\n return false\n }\n }\n}\n\nfunction formatVariableDeclaration(state, node) {\n /*\n Writes into `state` a variable declaration.\n */\n const { generator } = state\n const { declarations } = node\n state.write(node.kind + ' ')\n const { length } = declarations\n if (length > 0) {\n generator.VariableDeclarator(declarations[0], state)\n for (let i = 1; i < length; i++) {\n state.write(', ')\n generator.VariableDeclarator(declarations[i], state)\n }\n }\n}\n\nlet ForInStatement,\n FunctionDeclaration,\n RestElement,\n BinaryExpression,\n ArrayExpression,\n BlockStatement\n\nexport const GENERATOR = {\n /*\n Default generator.\n */\n Program(node, state) {\n const indent = state.indent.repeat(state.indentLevel)\n const { lineEnd, writeComments } = state\n if (writeComments && node.comments != null) {\n formatComments(state, node.comments, indent, lineEnd)\n }\n const statements = node.body\n const { length } = statements\n for (let i = 0; i < length; i++) {\n const statement = statements[i]\n if (writeComments && statement.comments != null) {\n formatComments(state, statement.comments, indent, lineEnd)\n }\n state.write(indent)\n this[statement.type](statement, state)\n state.write(lineEnd)\n }\n if (writeComments && node.trailingComments != null) {\n formatComments(state, node.trailingComments, indent, lineEnd)\n }\n },\n BlockStatement: (BlockStatement = function (node, state) {\n const indent = state.indent.repeat(state.indentLevel++)\n const { lineEnd, writeComments } = state\n const statementIndent = indent + state.indent\n state.write('{')\n const statements = node.body\n if (statements != null && statements.length > 0) {\n state.write(lineEnd)\n if (writeComments && node.comments != null) {\n formatComments(state, node.comments, statementIndent, lineEnd)\n }\n const { length } = statements\n for (let i = 0; i < length; i++) {\n const statement = statements[i]\n if (writeComments && statement.comments != null) {\n formatComments(state, statement.comments, statementIndent, lineEnd)\n }\n state.write(statementIndent)\n this[statement.type](statement, state)\n state.write(lineEnd)\n }\n state.write(indent)\n } else {\n if (writeComments && node.comments != null) {\n state.write(lineEnd)\n formatComments(state, node.comments, statementIndent, lineEnd)\n state.write(indent)\n }\n }\n if (writeComments && node.trailingComments != null) {\n formatComments(state, node.trailingComments, statementIndent, lineEnd)\n }\n state.write('}')\n state.indentLevel--\n }),\n ClassBody: BlockStatement,\n EmptyStatement(node, state) {\n state.write(';')\n },\n ExpressionStatement(node, state) {\n const precedence = state.expressionsPrecedence[node.expression.type]\n if (\n precedence === NEEDS_PARENTHESES ||\n (precedence === 3 && node.expression.left.type[0] === 'O')\n ) {\n // Should always have parentheses or is an AssignmentExpression to an ObjectPattern\n state.write('(')\n this[node.expression.type](node.expression, state)\n state.write(')')\n } else {\n this[node.expression.type](node.expression, state)\n }\n state.write(';')\n },\n IfStatement(node, state) {\n state.write('if (')\n this[node.test.type](node.test, state)\n state.write(') ')\n this[node.consequent.type](node.consequent, state)\n if (node.alternate != null) {\n state.write(' else ')\n this[node.alternate.type](node.alternate, state)\n }\n },\n LabeledStatement(node, state) {\n this[node.label.type](node.label, state)\n state.write(': ')\n this[node.body.type](node.body, state)\n },\n BreakStatement(node, state) {\n state.write('break')\n if (node.label != null) {\n state.write(' ')\n this[node.label.type](node.label, state)\n }\n state.write(';')\n },\n ContinueStatement(node, state) {\n state.write('continue')\n if (node.label != null) {\n state.write(' ')\n this[node.label.type](node.label, state)\n }\n state.write(';')\n },\n WithStatement(node, state) {\n state.write('with (')\n this[node.object.type](node.object, state)\n state.write(') ')\n this[node.body.type](node.body, state)\n },\n SwitchStatement(node, state) {\n const indent = state.indent.repeat(state.indentLevel++)\n const { lineEnd, writeComments } = state\n state.indentLevel++\n const caseIndent = indent + state.indent\n const statementIndent = caseIndent + state.indent\n state.write('switch (')\n this[node.discriminant.type](node.discriminant, state)\n state.write(') {' + lineEnd)\n const { cases: occurences } = node\n const { length: occurencesCount } = occurences\n for (let i = 0; i < occurencesCount; i++) {\n const occurence = occurences[i]\n if (writeComments && occurence.comments != null) {\n formatComments(state, occurence.comments, caseIndent, lineEnd)\n }\n if (occurence.test) {\n state.write(caseIndent + 'case ')\n this[occurence.test.type](occurence.test, state)\n state.write(':' + lineEnd)\n } else {\n state.write(caseIndent + 'default:' + lineEnd)\n }\n const { consequent } = occurence\n const { length: consequentCount } = consequent\n for (let i = 0; i < consequentCount; i++) {\n const statement = consequent[i]\n if (writeComments && statement.comments != null) {\n formatComments(state, statement.comments, statementIndent, lineEnd)\n }\n state.write(statementIndent)\n this[statement.type](statement, state)\n state.write(lineEnd)\n }\n }\n state.indentLevel -= 2\n state.write(indent + '}')\n },\n ReturnStatement(node, state) {\n state.write('return')\n if (node.argument) {\n state.write(' ')\n this[node.argument.type](node.argument, state)\n }\n state.write(';')\n },\n ThrowStatement(node, state) {\n state.write('throw ')\n this[node.argument.type](node.argument, state)\n state.write(';')\n },\n TryStatement(node, state) {\n state.write('try ')\n this[node.block.type](node.block, state)\n if (node.handler) {\n const { handler } = node\n if (handler.param == null) {\n state.write(' catch ')\n } else {\n state.write(' catch (')\n this[handler.param.type](handler.param, state)\n state.write(') ')\n }\n this[handler.body.type](handler.body, state)\n }\n if (node.finalizer) {\n state.write(' finally ')\n this[node.finalizer.type](node.finalizer, state)\n }\n },\n WhileStatement(node, state) {\n state.write('while (')\n this[node.test.type](node.test, state)\n state.write(') ')\n this[node.body.type](node.body, state)\n },\n DoWhileStatement(node, state) {\n state.write('do ')\n this[node.body.type](node.body, state)\n state.write(' while (')\n this[node.test.type](node.test, state)\n state.write(');')\n },\n ForStatement(node, state) {\n state.write('for (')\n if (node.init != null) {\n const { init } = node\n if (init.type[0] === 'V') {\n formatVariableDeclaration(state, init)\n } else {\n this[init.type](init, state)\n }\n }\n state.write('; ')\n if (node.test) {\n this[node.test.type](node.test, state)\n }\n state.write('; ')\n if (node.update) {\n this[node.update.type](node.update, state)\n }\n state.write(') ')\n this[node.body.type](node.body, state)\n },\n ForInStatement: (ForInStatement = function (node, state) {\n state.write(`for ${node.await ? 'await ' : ''}(`)\n const { left } = node\n if (left.type[0] === 'V') {\n formatVariableDeclaration(state, left)\n } else {\n this[left.type](left, state)\n }\n // Identifying whether node.type is `ForInStatement` or `ForOfStatement`\n state.write(node.type[3] === 'I' ? ' in ' : ' of ')\n this[node.right.type](node.right, state)\n state.write(') ')\n this[node.body.type](node.body, state)\n }),\n ForOfStatement: ForInStatement,\n DebuggerStatement(node, state) {\n state.write('debugger;', node)\n },\n FunctionDeclaration: (FunctionDeclaration = function (node, state) {\n state.write(\n (node.async ? 'async ' : '') +\n (node.generator ? 'function* ' : 'function ') +\n (node.id ? node.id.name : ''),\n node,\n )\n formatSequence(state, node.params)\n state.write(' ')\n this[node.body.type](node.body, state)\n }),\n FunctionExpression: FunctionDeclaration,\n VariableDeclaration(node, state) {\n formatVariableDeclaration(state, node)\n state.write(';')\n },\n VariableDeclarator(node, state) {\n this[node.id.type](node.id, state)\n if (node.init != null) {\n state.write(' = ')\n this[node.init.type](node.init, state)\n }\n },\n ClassDeclaration(node, state) {\n state.write('class ' + (node.id ? `${node.id.name} ` : ''), node)\n if (node.superClass) {\n state.write('extends ')\n const { superClass } = node\n const { type } = superClass\n const precedence = state.expressionsPrecedence[type]\n if (\n (type[0] !== 'C' || type[1] !== 'l' || type[5] !== 'E') &&\n (precedence === NEEDS_PARENTHESES ||\n precedence < state.expressionsPrecedence.ClassExpression)\n ) {\n // Not a ClassExpression that needs parentheses\n state.write('(')\n this[node.superClass.type](superClass, state)\n state.write(')')\n } else {\n this[superClass.type](superClass, state)\n }\n state.write(' ')\n }\n this.ClassBody(node.body, state)\n },\n ImportDeclaration(node, state) {\n state.write('import ')\n const { specifiers } = node\n const { length } = specifiers\n // TODO: Once babili is fixed, put this after condition\n // https://github.com/babel/babili/issues/430\n let i = 0\n if (length > 0) {\n for (; i < length; ) {\n if (i > 0) {\n state.write(', ')\n }\n const specifier = specifiers[i]\n const type = specifier.type[6]\n if (type === 'D') {\n // ImportDefaultSpecifier\n state.write(specifier.local.name, specifier)\n i++\n } else if (type === 'N') {\n // ImportNamespaceSpecifier\n state.write('* as ' + specifier.local.name, specifier)\n i++\n } else {\n // ImportSpecifier\n break\n }\n }\n if (i < length) {\n state.write('{')\n for (;;) {\n const specifier = specifiers[i]\n const { name } = specifier.imported\n state.write(name, specifier)\n if (name !== specifier.local.name) {\n state.write(' as ' + specifier.local.name)\n }\n if (++i < length) {\n state.write(', ')\n } else {\n break\n }\n }\n state.write('}')\n }\n state.write(' from ')\n }\n this.Literal(node.source, state)\n state.write(';')\n },\n ImportExpression(node, state) {\n state.write('import(')\n this[node.source.type](node.source, state)\n state.write(')')\n },\n ExportDefaultDeclaration(node, state) {\n state.write('export default ')\n this[node.declaration.type](node.declaration, state)\n if (\n state.expressionsPrecedence[node.declaration.type] != null &&\n node.declaration.type[0] !== 'F'\n ) {\n // All expression nodes except `FunctionExpression`\n state.write(';')\n }\n },\n ExportNamedDeclaration(node, state) {\n state.write('export ')\n if (node.declaration) {\n this[node.declaration.type](node.declaration, state)\n } else {\n state.write('{')\n const { specifiers } = node,\n { length } = specifiers\n if (length > 0) {\n for (let i = 0; ; ) {\n const specifier = specifiers[i]\n const { name } = specifier.local\n state.write(name, specifier)\n if (name !== specifier.exported.name) {\n state.write(' as ' + specifier.exported.name)\n }\n if (++i < length) {\n state.write(', ')\n } else {\n break\n }\n }\n }\n state.write('}')\n if (node.source) {\n state.write(' from ')\n this.Literal(node.source, state)\n }\n state.write(';')\n }\n },\n ExportAllDeclaration(node, state) {\n if (node.exported != null) {\n state.write('export * as ' + node.exported.name + ' from ')\n } else {\n state.write('export * from ')\n }\n this.Literal(node.source, state)\n state.write(';')\n },\n MethodDefinition(node, state) {\n if (node.static) {\n state.write('static ')\n }\n const kind = node.kind[0]\n if (kind === 'g' || kind === 's') {\n // Getter or setter\n state.write(node.kind + ' ')\n }\n if (node.value.async) {\n state.write('async ')\n }\n if (node.value.generator) {\n state.write('*')\n }\n if (node.computed) {\n state.write('[')\n this[node.key.type](node.key, state)\n state.write(']')\n } else {\n this[node.key.type](node.key, state)\n }\n formatSequence(state, node.value.params)\n state.write(' ')\n this[node.value.body.type](node.value.body, state)\n },\n ClassExpression(node, state) {\n this.ClassDeclaration(node, state)\n },\n ArrowFunctionExpression(node, state) {\n state.write(node.async ? 'async ' : '', node)\n const { params } = node\n if (params != null) {\n // Omit parenthesis if only one named parameter\n if (params.length === 1 && params[0].type[0] === 'I') {\n // If params[0].type[0] starts with 'I', it can't be `ImportDeclaration` nor `IfStatement` and thus is `Identifier`\n state.write(params[0].name, params[0])\n } else {\n formatSequence(state, node.params)\n }\n }\n state.write(' => ')\n if (node.body.type[0] === 'O') {\n // Body is an object expression\n state.write('(')\n this.ObjectExpression(node.body, state)\n state.write(')')\n } else {\n this[node.body.type](node.body, state)\n }\n },\n ThisExpression(node, state) {\n state.write('this', node)\n },\n Super(node, state) {\n state.write('super', node)\n },\n RestElement: (RestElement = function (node, state) {\n state.write('...')\n this[node.argument.type](node.argument, state)\n }),\n SpreadElement: RestElement,\n YieldExpression(node, state) {\n state.write(node.delegate ? 'yield*' : 'yield')\n if (node.argument) {\n state.write(' ')\n this[node.argument.type](node.argument, state)\n }\n },\n AwaitExpression(node, state) {\n state.write('await ', node)\n formatExpression(state, node.argument, node)\n },\n TemplateLiteral(node, state) {\n const { quasis, expressions } = node\n state.write('`')\n const { length } = expressions\n for (let i = 0; i < length; i++) {\n const expression = expressions[i]\n const quasi = quasis[i]\n state.write(quasi.value.raw, quasi)\n state.write('${')\n this[expression.type](expression, state)\n state.write('}')\n }\n const quasi = quasis[quasis.length - 1]\n state.write(quasi.value.raw, quasi)\n state.write('`')\n },\n TemplateElement(node, state) {\n state.write(node.value.raw, node)\n },\n TaggedTemplateExpression(node, state) {\n this[node.tag.type](node.tag, state)\n this[node.quasi.type](node.quasi, state)\n },\n ArrayExpression: (ArrayExpression = function (node, state) {\n state.write('[')\n if (node.elements.length > 0) {\n const { elements } = node,\n { length } = elements\n for (let i = 0; ; ) {\n const element = elements[i]\n if (element != null) {\n this[element.type](element, state)\n }\n if (++i < length) {\n state.write(', ')\n } else {\n if (element == null) {\n state.write(', ')\n }\n break\n }\n }\n }\n state.write(']')\n }),\n ArrayPattern: ArrayExpression,\n ObjectExpression(node, state) {\n const indent = state.indent.repeat(state.indentLevel++)\n const { lineEnd, writeComments } = state\n const propertyIndent = indent + state.indent\n state.write('{')\n if (node.properties.length > 0) {\n state.write(lineEnd)\n if (writeComments && node.comments != null) {\n formatComments(state, node.comments, propertyIndent, lineEnd)\n }\n const comma = ',' + lineEnd\n const { properties } = node,\n { length } = properties\n for (let i = 0; ; ) {\n const property = properties[i]\n if (writeComments && property.comments != null) {\n formatComments(state, property.comments, propertyIndent, lineEnd)\n }\n state.write(propertyIndent)\n this[property.type](property, state)\n if (++i < length) {\n state.write(comma)\n } else {\n break\n }\n }\n state.write(lineEnd)\n if (writeComments && node.trailingComments != null) {\n formatComments(state, node.trailingComments, propertyIndent, lineEnd)\n }\n state.write(indent + '}')\n } else if (writeComments) {\n if (node.comments != null) {\n state.write(lineEnd)\n formatComments(state, node.comments, propertyIndent, lineEnd)\n if (node.trailingComments != null) {\n formatComments(state, node.trailingComments, propertyIndent, lineEnd)\n }\n state.write(indent + '}')\n } else if (node.trailingComments != null) {\n state.write(lineEnd)\n formatComments(state, node.trailingComments, propertyIndent, lineEnd)\n state.write(indent + '}')\n } else {\n state.write('}')\n }\n } else {\n state.write('}')\n }\n state.indentLevel--\n },\n Property(node, state) {\n if (node.method || node.kind[0] !== 'i') {\n // Either a method or of kind `set` or `get` (not `init`)\n this.MethodDefinition(node, state)\n } else {\n if (!node.shorthand) {\n if (node.computed) {\n state.write('[')\n this[node.key.type](node.key, state)\n state.write(']')\n } else {\n this[node.key.type](node.key, state)\n }\n state.write(': ')\n }\n this[node.value.type](node.value, state)\n }\n },\n ObjectPattern(node, state) {\n state.write('{')\n if (node.properties.length > 0) {\n const { properties } = node,\n { length } = properties\n for (let i = 0; ; ) {\n this[properties[i].type](properties[i], state)\n if (++i < length) {\n state.write(', ')\n } else {\n break\n }\n }\n }\n state.write('}')\n },\n SequenceExpression(node, state) {\n formatSequence(state, node.expressions)\n },\n UnaryExpression(node, state) {\n if (node.prefix) {\n const {\n operator,\n argument,\n argument: { type },\n } = node\n state.write(operator)\n const needsParentheses = expressionNeedsParenthesis(state, argument, node)\n if (\n !needsParentheses &&\n (operator.length > 1 ||\n (type[0] === 'U' &&\n (type[1] === 'n' || type[1] === 'p') &&\n argument.prefix &&\n argument.operator[0] === operator &&\n (operator === '+' || operator === '-')))\n ) {\n // Large operator or argument is UnaryExpression or UpdateExpression node\n state.write(' ')\n }\n if (needsParentheses) {\n state.write(operator.length > 1 ? ' (' : '(')\n this[type](argument, state)\n state.write(')')\n } else {\n this[type](argument, state)\n }\n } else {\n // FIXME: This case never occurs\n this[node.argument.type](node.argument, state)\n state.write(node.operator)\n }\n },\n UpdateExpression(node, state) {\n // Always applied to identifiers or members, no parenthesis check needed\n if (node.prefix) {\n state.write(node.operator)\n this[node.argument.type](node.argument, state)\n } else {\n this[node.argument.type](node.argument, state)\n state.write(node.operator)\n }\n },\n AssignmentExpression(node, state) {\n this[node.left.type](node.left, state)\n state.write(' ' + node.operator + ' ')\n this[node.right.type](node.right, state)\n },\n AssignmentPattern(node, state) {\n this[node.left.type](node.left, state)\n state.write(' = ')\n this[node.right.type](node.right, state)\n },\n BinaryExpression: (BinaryExpression = function (node, state) {\n const isIn = node.operator === 'in'\n if (isIn) {\n // Avoids confusion in `for` loops initializers\n state.write('(')\n }\n formatExpression(state, node.left, node, false)\n state.write(' ' + node.operator + ' ')\n formatExpression(state, node.right, node, true)\n if (isIn) {\n state.write(')')\n }\n }),\n LogicalExpression: BinaryExpression,\n ConditionalExpression(node, state) {\n const { test } = node\n const precedence = state.expressionsPrecedence[test.type]\n if (\n precedence === NEEDS_PARENTHESES ||\n precedence <= state.expressionsPrecedence.ConditionalExpression\n ) {\n state.write('(')\n this[test.type](test, state)\n state.write(')')\n } else {\n this[test.type](test, state)\n }\n state.write(' ? ')\n this[node.consequent.type](node.consequent, state)\n state.write(' : ')\n this[node.alternate.type](node.alternate, state)\n },\n NewExpression(node, state) {\n state.write('new ')\n const precedence = state.expressionsPrecedence[node.callee.type]\n if (\n precedence === NEEDS_PARENTHESES ||\n precedence < state.expressionsPrecedence.CallExpression ||\n hasCallExpression(node.callee)\n ) {\n state.write('(')\n this[node.callee.type](node.callee, state)\n state.write(')')\n } else {\n this[node.callee.type](node.callee, state)\n }\n formatSequence(state, node['arguments'])\n },\n CallExpression(node, state) {\n const precedence = state.expressionsPrecedence[node.callee.type]\n if (\n precedence === NEEDS_PARENTHESES ||\n precedence < state.expressionsPrecedence.CallExpression\n ) {\n state.write('(')\n this[node.callee.type](node.callee, state)\n state.write(')')\n } else {\n this[node.callee.type](node.callee, state)\n }\n if (node.optional) {\n state.write('?.')\n }\n formatSequence(state, node['arguments'])\n },\n ChainExpression(node, state) {\n this[node.expression.type](node.expression, state)\n },\n MemberExpression(node, state) {\n const precedence = state.expressionsPrecedence[node.object.type]\n if (\n precedence === NEEDS_PARENTHESES ||\n precedence < state.expressionsPrecedence.MemberExpression\n ) {\n state.write('(')\n this[node.object.type](node.object, state)\n state.write(')')\n } else {\n this[node.object.type](node.object, state)\n }\n if (node.computed) {\n if (node.optional) {\n state.write('?.')\n }\n state.write('[')\n this[node.property.type](node.property, state)\n state.write(']')\n } else {\n if (node.optional) {\n state.write('?.')\n } else {\n state.write('.')\n }\n this[node.property.type](node.property, state)\n }\n },\n MetaProperty(node, state) {\n state.write(node.meta.name + '.' + node.property.name, node)\n },\n Identifier(node, state) {\n state.write(node.name, node)\n },\n Literal(node, state) {\n if (node.raw != null) {\n // Non-standard property\n state.write(node.raw, node)\n } else if (node.regex != null) {\n this.RegExpLiteral(node, state)\n } else if (node.bigint != null) {\n state.write(node.bigint + 'n', node)\n } else {\n state.write(stringify(node.value), node)\n }\n },\n RegExpLiteral(node, state) {\n const { regex } = node\n state.write(`/${regex.pattern}/${regex.flags}`, node)\n },\n}\n\nconst EMPTY_OBJECT = {}\n\n/*\nDEPRECATED: Alternate export of `GENERATOR`.\n*/\nexport const baseGenerator = GENERATOR\n\nclass State {\n constructor(options) {\n const setup = options == null ? EMPTY_OBJECT : options\n this.output = ''\n // Functional options\n if (setup.output != null) {\n this.output = setup.output\n this.write = this.writeToStream\n } else {\n this.output = ''\n }\n this.generator = setup.generator != null ? setup.generator : GENERATOR\n this.expressionsPrecedence =\n setup.expressionsPrecedence != null\n ? setup.expressionsPrecedence\n : EXPRESSIONS_PRECEDENCE\n // Formating setup\n this.indent = setup.indent != null ? setup.indent : ' '\n this.lineEnd = setup.lineEnd != null ? setup.lineEnd : '\\n'\n this.indentLevel =\n setup.startingIndentLevel != null ? setup.startingIndentLevel : 0\n this.writeComments = setup.comments ? setup.comments : false\n // Source map\n if (setup.sourceMap != null) {\n this.write =\n setup.output == null ? this.writeAndMap : this.writeToStreamAndMap\n this.sourceMap = setup.sourceMap\n this.line = 1\n this.column = 0\n this.lineEndSize = this.lineEnd.split('\\n').length - 1\n this.mapping = {\n original: null,\n // Uses the entire state to avoid generating ephemeral objects\n generated: this,\n name: undefined,\n source: setup.sourceMap.file || setup.sourceMap._file,\n }\n }\n }\n\n write(code) {\n this.output += code\n }\n\n writeToStream(code) {\n this.output.write(code)\n }\n\n writeAndMap(code, node) {\n this.output += code\n this.map(code, node)\n }\n\n writeToStreamAndMap(code, node) {\n this.output.write(code)\n this.map(code, node)\n }\n\n map(code, node) {\n if (node != null) {\n const { type } = node\n if (type[0] === 'L' && type[2] === 'n') {\n // LineComment\n this.column = 0\n this.line++\n return\n }\n if (node.loc != null) {\n const { mapping } = this\n mapping.original = node.loc.start\n mapping.name = node.name\n this.sourceMap.addMapping(mapping)\n }\n if (\n (type[0] === 'T' && type[8] === 'E') ||\n (type[0] === 'L' && type[1] === 'i' && typeof node.value === 'string')\n ) {\n // TemplateElement or Literal string node\n const { length } = code\n let { column, line } = this\n for (let i = 0; i < length; i++) {\n if (code[i] === '\\n') {\n column = 0\n line++\n } else {\n column++\n }\n }\n this.column = column\n this.line = line\n return\n }\n }\n const { length } = code\n const { lineEnd } = this\n if (length > 0) {\n if (\n this.lineEndSize > 0 &&\n (lineEnd.length === 1\n ? code[length - 1] === lineEnd\n : code.endsWith(lineEnd))\n ) {\n this.line += this.lineEndSize\n this.column = 0\n } else {\n this.column += length\n }\n }\n }\n\n toString() {\n return this.output\n }\n}\n\nexport function generate(node, options) {\n /*\n Returns a string representing the rendered code of the provided AST `node`.\n The `options` are:\n\n - `indent`: string to use for indentation (defaults to `␣␣`)\n - `lineEnd`: string to use for line endings (defaults to `\\n`)\n - `startingIndentLevel`: indent level to start from (defaults to `0`)\n - `comments`: generate comments if `true` (defaults to `false`)\n - `output`: output stream to write the rendered code to (defaults to `null`)\n - `generator`: custom code generator (defaults to `GENERATOR`)\n - `expressionsPrecedence`: custom map of node types and their precedence level (defaults to `EXPRESSIONS_PRECEDENCE`)\n */\n const state = new State(options)\n // Travel through the AST node and generate the code\n state.generator[node.type](node, state)\n return state.output\n}\n"]} \ No newline at end of file diff --git a/src/astring.js b/src/astring.js index 85b13449..59c53004 100644 --- a/src/astring.js +++ b/src/astring.js @@ -145,9 +145,7 @@ function expressionNeedsParenthesis(state, node, parentNode, isRightHand) { function formatExpression(state, node, parentNode, isRightHand) { /* - Writes into `state` a left-hand or right-hand expression `node` - from a binary expression applying the provided `operator`. - The `isRightHand` parameter should be `true` if the `node` is a right-hand argument. + Writes into `state` the provided `node`, adding parenthesis around if the provided `parentNode` needs it. If `node` is a right-hand argument, the provided `isRightHand` parameter should be `true`. */ const { generator } = state if (expressionNeedsParenthesis(state, node, parentNode, isRightHand)) { @@ -505,7 +503,21 @@ export const GENERATOR = { state.write('class ' + (node.id ? `${node.id.name} ` : ''), node) if (node.superClass) { state.write('extends ') - this[node.superClass.type](node.superClass, state) + const { superClass } = node + const { type } = superClass + const precedence = state.expressionsPrecedence[type] + if ( + (type[0] !== 'C' || type[1] !== 'l' || type[5] !== 'E') && + (precedence === NEEDS_PARENTHESES || + precedence < state.expressionsPrecedence.ClassExpression) + ) { + // Not a ClassExpression that needs parentheses + state.write('(') + this[node.superClass.type](superClass, state) + state.write(')') + } else { + this[superClass.type](superClass, state) + } state.write(' ') } this.ClassBody(node.body, state) @@ -514,7 +526,7 @@ export const GENERATOR = { state.write('import ') const { specifiers } = node const { length } = specifiers - // NOTE: Once babili is fixed, put this after condition + // TODO: Once babili is fixed, put this after condition // https://github.com/babel/babili/issues/430 let i = 0 if (length > 0) { @@ -830,22 +842,21 @@ export const GENERATOR = { argument: { type }, } = node state.write(operator) + const needsParentheses = expressionNeedsParenthesis(state, argument, node) if ( - operator.length > 1 || - (type[0] === 'U' && - (type[1] === 'n' || type[1] === 'p') && - argument.prefix && - argument.operator[0] === operator && - (operator === '+' || operator === '-')) + !needsParentheses && + (operator.length > 1 || + (type[0] === 'U' && + (type[1] === 'n' || type[1] === 'p') && + argument.prefix && + argument.operator[0] === operator && + (operator === '+' || operator === '-'))) ) { // Large operator or argument is UnaryExpression or UpdateExpression node state.write(' ') } - if ( - state.expressionsPrecedence[type] < - state.expressionsPrecedence.UnaryExpression - ) { - state.write('(') + if (needsParentheses) { + state.write(operator.length > 1 ? ' (' : '(') this[type](argument, state) state.write(')') } else { @@ -892,15 +903,17 @@ export const GENERATOR = { }), LogicalExpression: BinaryExpression, ConditionalExpression(node, state) { + const { test } = node + const precedence = state.expressionsPrecedence[test.type] if ( - state.expressionsPrecedence[node.test.type] > - state.expressionsPrecedence.ConditionalExpression + precedence === NEEDS_PARENTHESES || + precedence <= state.expressionsPrecedence.ConditionalExpression ) { - this[node.test.type](node.test, state) - } else { state.write('(') - this[node.test.type](node.test, state) + this[test.type](test, state) state.write(')') + } else { + this[test.type](test, state) } state.write(' ? ') this[node.consequent.type](node.consequent, state) @@ -909,9 +922,10 @@ export const GENERATOR = { }, NewExpression(node, state) { state.write('new ') + const precedence = state.expressionsPrecedence[node.callee.type] if ( - state.expressionsPrecedence[node.callee.type] < - state.expressionsPrecedence.CallExpression || + precedence === NEEDS_PARENTHESES || + precedence < state.expressionsPrecedence.CallExpression || hasCallExpression(node.callee) ) { state.write('(') @@ -923,9 +937,10 @@ export const GENERATOR = { formatSequence(state, node['arguments']) }, CallExpression(node, state) { + const precedence = state.expressionsPrecedence[node.callee.type] if ( - state.expressionsPrecedence[node.callee.type] < - state.expressionsPrecedence.CallExpression + precedence === NEEDS_PARENTHESES || + precedence < state.expressionsPrecedence.CallExpression ) { state.write('(') this[node.callee.type](node.callee, state) @@ -942,9 +957,10 @@ export const GENERATOR = { this[node.expression.type](node.expression, state) }, MemberExpression(node, state) { + const precedence = state.expressionsPrecedence[node.object.type] if ( - state.expressionsPrecedence[node.object.type] < - state.expressionsPrecedence.MemberExpression + precedence === NEEDS_PARENTHESES || + precedence < state.expressionsPrecedence.MemberExpression ) { state.write('(') this[node.object.type](node.object, state) diff --git a/src/tests/fixtures/syntax/class.js b/src/tests/fixtures/syntax/class.js index 34cbbdb9..795f1fad 100644 --- a/src/tests/fixtures/syntax/class.js +++ b/src/tests/fixtures/syntax/class.js @@ -37,3 +37,13 @@ class J extends A { super(); } } +class K extends (() => {}) {} +class L extends (1 + 1) {} +class M extends (-1) {} +class N extends (c++) {} +function* a() { + class A extends (yield) {} +} +async function b() { + class A extends (await a()) {} +} diff --git a/src/tests/fixtures/syntax/precedence.js b/src/tests/fixtures/syntax/precedence.js index 79c205c2..2ca93d98 100644 --- a/src/tests/fixtures/syntax/precedence.js +++ b/src/tests/fixtures/syntax/precedence.js @@ -16,6 +16,7 @@ c = !(x instanceof Number); d = typeof a === 'boolean'; e = !typeof a === 'boolean'; f = !(typeof a === 'boolean'); +f = typeof (() => {}); a = (1.1).toString(); b = new A().toString(); c = new x.A().toString(); @@ -50,3 +51,12 @@ g = b + -+-a++; yield a = b; const c = yield 3; }); +(function* () { + !(yield 1); +}); +!(() => {}); +(() => {}) ? a : b; +({}) ? a : b; +(({}) ? a : b) ? c : d; +(function () {}) ? a : b; +(class {}) ? a : b;