gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 786 forks source link

Instrumenter uses eval #705

Open chge opened 8 years ago

chge commented 8 years ago

Instrumenter currently uses eval to get top-level scope. If you use both Strict mode and Content-Security-Policy, you have to hack your server to add a script-src 'unsafe-eval' directive to allow execution of instrumented code.

Is there a way for instrumenter to track top-level scope without eval? Maybe a temporary field inside __coverage__ object?

jmcken8 commented 7 years ago

+1