You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you parse the expression "valueOf" in __proto with the Directives option enabled, then a directive property is added to the ExpressionStatement node, which is wrong. The directive property should only be added for "use strict" literals.
A fix could be that you in the parseDirective() function when checking for the directive option, also test the node type stored in expression variable and only add the directive property if it is a Literal.
-Thomas
The text was updated successfully, but these errors were encountered:
Hi,
If you parse the expression "valueOf" in __proto with the Directives option enabled, then a directive property is added to the ExpressionStatement node, which is wrong. The directive property should only be added for "use strict" literals.
Meriyah also adds a BinaryExpression in the expression property, which is not legal according to the AST specification for directives. See https://github.com/estree/estree/blob/master/es5.md#directive
For these two lines:
the tree looks like:
A fix could be that you in the parseDirective() function when checking for the directive option, also test the node type stored in expression variable and only add the directive property if it is a Literal.
-Thomas
The text was updated successfully, but these errors were encountered: