acornjs / acorn-stage3

Support for stage 3 proposals in acorn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stage3 package doesn't work with Acorn v7.0.0

rumkin opened this issue · comments

Problem

This package doesn't work with Acorn v7.0.0. An attempt to extend parser fails with such result:

/dev/esbundles/node_modules/acorn-private-class-elements/index.js:5
  throw new Error(`acorn-private-class-elements requires acorn@^6.1.0, not ${acorn.version}`)
  ^

Error: acorn-private-class-elements requires acorn@^6.1.0, not 7.1.0
    at Object.<anonymous> (/dev/esbundles/node_modules/acorn-private-class-elements/index.js:5:9)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/dev/esbundles/node_modules/acorn-class-fields/index.js:5:30)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)

Steps to reproduce

  1. Install acorn:
    npm i acorn@7
  2. Install acorn-stage3:
    npm i acorn-stage3@2
  3. Create acorn-stage3.js file with the code:
    const acorn = require('acorn');
    const stage3 = require('acorn-stage3');
    
    acorn.Parser.extend(stage3)
  4. Run node:
    node acorn-stage3.js

I just published 3.0.0 which requires (and supports) acorn@^7.2.