Skip to content

Commit

Permalink
support bigint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Williams committed Jul 6, 2017
1 parent b3952f6 commit 8f5c60b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/jsdoc/src/astbuilder.js
Expand Up @@ -9,6 +9,7 @@ var parserOptions = exports.parserOptions = {
sourceType: 'module',
plugins: [
'asyncGenerators',
'bigInt',
'classPrivateProperties',
'classProperties',
'decorators2',
Expand Down
4 changes: 4 additions & 0 deletions lib/jsdoc/src/astnode.js
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions lib/jsdoc/src/syntax.js
Expand Up @@ -8,6 +8,7 @@ exports.Syntax = {
AssignmentExpression: 'AssignmentExpression',
AssignmentPattern: 'AssignmentPattern',
AwaitExpression: 'AwaitExpression',
BigIntLiteral: 'BigIntLiteral',
BinaryExpression: 'BinaryExpression',
BindExpression: 'BindExpression',
BlockStatement: 'BlockStatement',
Expand Down
2 changes: 2 additions & 0 deletions lib/jsdoc/src/walker.js
Expand Up @@ -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);
Expand Down

0 comments on commit 8f5c60b

Please sign in to comment.