Closed littledan closed 8 years ago
Sounds good!
That looks buggy to me:
continue (((eval)))("...")
, which is still a direct eval (unless a nontrivial definition of StringValue is provided),I think that some more static analysis is needed. Something like the following:
And:
Identifier : IdentifierName
1. If StringValue of IdentifierName is "eval" return true.
2. Return false.
CoverParenthesizedExpressionAndArrowParameterList[Yield] : ( Expression[In, ?Yield] )
1. Return MayBeDirectEvalReference of Expression[In, ?Yield].
SomeNonTerminal : SomeOtherNonTerminal
1. Return MayBeDirectEvalReference of SomeOtherNonTerminal.
Anything else
1. Return false.
I guess we have more detailed cases like continue (1, eval)("...")
as well. We implementations statically detect direct eval possibilities, so this should be possible somehow, but it's not clear how the spec text should be worded. @claudepache wanna write a PR?
I guess we have more detailed cases like continue (1, eval)("...") as well.
(1, eval)
triggers an indirect eval.implementations statically detect direct eval possibilities, so this should be possible somehow, but it's not clear how the spec text should be worded. @claudepache wanna write a PR?
Detailing
MayBeDirectEvalReference
for each production, following the model ofIsValidSimpleAssignmentTarget
, is easy but tedious. However, one could instead use a formulation similar to what is done for thedelete
operator (12.5.3.1). OK, I'll write a PR soon.
Closes #14