How to use the Node function from acorn

Find comprehensive JavaScript acorn.Node code examples handpicked from public code repositorys.

37
38
39
40
41
42
43
44
45
46
 * @constructor
 * @param {!acorn.Parser} parser
 * @param {?} pos
 * @param {?} loc
 */
acorn.Node = acorn.Node;

/**
 * @constructor
 * @param {!Object} options Parse options.
fork icon42
star icon182
watch icon16

+ 5 other calls in file

1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
// Need a parser to pass to acorn.Node constructor.
// Create it once and reuse it.
const stubParser = new acorn.Parser({ecmaVersion: 2020});


function createNode(props) {
  const node = new acorn.Node(stubParser);
  Object.assign(node, props);
  return node;
}

fork icon0
star icon0
watch icon1

+ 3 other calls in file