browserify / browserify/static-eval

It does not evaluate functions

Open
#41 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
177
Forks
27
PR merge metrics
No merged PRs in 30d

Description

```
const { parse } = require('esprima');
const staticEval = require('static-eval');
const ast = parse('(() => 1)()');
const val = staticEval(ast.body[0].expression, {}, { allowAccessToMethodsOnFunctions: true });
// val is undefined
```

The expression I was actually trying to evaluate looks more like `'[1,2,3].map(x => x)'`

Is there some workaround?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.