block scope + direct non-strict eval

John J Barton johnjbarton at
Tue Jan 31 19:01:37 PST 2012

>    2) people whose are writing code to dynamically construct the source code
> of a function that will be created via eval are probably think about
> different issues than. I hypothesize that they are more likely to place the
> eval in a block that conditionalized by a if statement.

Just to inform the discussion, some use cases for eval that I have seen:
  1) REPL  (dicey, users have to deal with it)
  2) JS source loaders  (dicey, we're desperate)
  3) Domain Specific Languages compiled into JS, eg domplate in
Firebug, calculators. (solid)

Conditional compilation per se isn't a common use case because
generating or downloading the code will probably be more expensive
than compiling it.


More information about the es-discuss mailing list