support bigint

This commit is contained in:
Jeff Williams 2017-07-06 16:40:21 -07:00
parent b3952f6fed
commit 8f5c60befd
4 changed files with 8 additions and 0 deletions

View File

@ -9,6 +9,7 @@ var parserOptions = exports.parserOptions = {
sourceType: 'module',
plugins: [
'asyncGenerators',
'bigInt',
'classPrivateProperties',
'classProperties',
'decorators2',

View File

@ -136,6 +136,10 @@ var nodeToValue = exports.nodeToValue = function(node) {
str = nodeToValue(node.left);
break;
case Syntax.BigIntLiteral:
str = node.value;
break;
case Syntax.ClassDeclaration:
str = nodeToValue(node.id);
break;

View File

@ -8,6 +8,7 @@ exports.Syntax = {
AssignmentExpression: 'AssignmentExpression',
AssignmentPattern: 'AssignmentPattern',
AwaitExpression: 'AwaitExpression',
BigIntLiteral: 'BigIntLiteral',
BinaryExpression: 'BinaryExpression',
BindExpression: 'BindExpression',
BlockStatement: 'BlockStatement',

View File

@ -100,6 +100,8 @@ walkers[Syntax.AwaitExpression] = function(node, parent, state, cb) {
cb(node.argument, node, state);
};
walkers[Syntax.BigIntLiteral] = leafNode;
walkers[Syntax.BinaryExpression] = function(node, parent, state, cb) {
cb(node.left, node, state);
cb(node.right, node, state);