sinonjs / fake-timers

Fake setTimeout and friends (collectively known as "timers"). Useful in your JavaScript tests. Extracted from Sinon.JS
BSD 3-Clause "New" or "Revised" License
802 stars 105 forks source link

Remove use of `eval` #327

Closed itayperry closed 4 years ago

itayperry commented 4 years ago

Purpose

Removing the use of eval() as there are 'Rollup complaints about the use of eval.' According to MDN:

'Executing JavaScript from a string is an enormous security risk'

Issue #319

codecov[bot] commented 4 years ago

Codecov Report

Merging #327 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #327   +/-   ##
=======================================
  Coverage   92.75%   92.75%           
=======================================
  Files           1        1           
  Lines         552      552           
=======================================
  Hits          512      512           
  Misses         40       40           
Flag Coverage Δ
#unit 92.75% <100.00%> (ø)
Impacted Files Coverage Δ
src/fake-timers-src.js 92.75% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1f83b99...2a74d2d. Read the comment docs.

itayperry commented 4 years ago

As decided in #319 eval() will not be entirely canceled, for further info read: https://github.com/sinonjs/fake-timers/issues/319#issuecomment-632794814