Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

es-build is not compatible with meriyah #24

Open
Tarrowren opened this issue Mar 10, 2021 · 0 comments
Open

es-build is not compatible with meriyah #24

Tarrowren opened this issue Mar 10, 2021 · 0 comments

Comments

@Tarrowren
Copy link

jackson-js-bug

Environment

node.js v14.15.4

Description

repo https://github.com/Tarrowren/jackson-js-bug

npm run tsc:dev

npm run es-build:dev

es-build throw Class declaration must have a name in this context

at meriyah.parseScript

import { parseScript } from "meriyah";

export const getArgumentNames = (method): string[] => {
  // ...
  const ast = parseScript(code, {
    next: true,
    webcompat: true,
    directives: true,
  });
  // ...
};

now I use regular expressions solve it

export const getArgumentNames = (method): string[] => {
  return method
    .toString()
    .match(/constructor\(.*\)/)[0]
    .match(/[^constructor\(].*[^\)]/)[0]
    .split(", ");
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant