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

feature: add an API that works on ASTs instead of pre-evaluated values #57

Open
goto-bus-stop opened this issue Jun 15, 2020 · 0 comments

Comments

@goto-bus-stop
Copy link
Member

static-eval doesn't support function expressions like the body option in:

cwise({
  body: () => {}
})

I think because of this patch browserify/static-eval#18

static-module has a special case for function arguments as callbacks:

readFile('xyz', function () {})

A possible solution may be to have a static-module option or a method like staticModule.ast that passes the parsed AST nodes to functions, instead of statically evaluated values. Projects like cwise could then use static-eval to selectively evaluate strings and other primitive types, and stringify the AST for function arguments using escodegen.

Originally posted by @goto-bus-stop in #48 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant