hasharray / revaluate.js

non destructive code revaluation
https://revaluate.js.org
2 stars 0 forks source link

Eliminate constant proxy function eval #5

Open caspervonb opened 8 years ago

caspervonb commented 8 years ago

A proxy function currently looks something like the following:

function fn() {
  if (__function[0].length > 0) {
    __function[0] = eval(__function[0]);
  }

  return __function[0].apply(this, arguments);
}

The eval statement here will prevent V8 from doing optimisation on the function.