15.1.2.1.1 in the ES5 spec does not make the determination of whether an eval is an operator or function dependent on the number of parameters passed to it.
Currently eval('foo') is an EvalExpr, but eval('foo', 'bar') is not.
Comment #1
Posted on Jan 8, 2010 by Quick DogI just noticed that tomvc submitted a change intentionally to add a arguments.length === 1 check. What is the reasoning behind that?
Comment #2
Posted on Jan 15, 2010 by Massive BirdFailing to get a satisfying answer from es-discuss, MarkM and I had another look at this and decided it would make most sense to have the parser generate an EvalExpr no matter the number of arguments passed to eval. It seemed like a strange restriction for the parser to check the number of arguments. Furthermore, the spec does not mention # of arguments when defining what a 'direct call to eval' means.
Change reverted in r136.
Comment #3
Posted on Jan 15, 2010 by Quick DogFor reference, the relevant es-discuss thread is https://mail.mozilla.org/pipermail/es- discuss/2010-January/010512.html .
Status: Fixed
Labels:
Type-Defect
Priority-Medium