This returns false as it should: delete Boolean.prototype This returns true: delete (Boolean.prototype)
This is an instance of a general parser bug wherein the parser returns Ast::ListExpr nodes far too often. The grammar production in question is ListExpression, but this production is overloaded to be used both on function parameters and on comma expressions. The latter cases should (probably) be rewritten to use a CommaExpression production which produces a simple expression if there's only one and Ast::Comma(x,y) otherwise. Note, this may cause some wrinkles in cogen which depends on Ast::ListExpr in a couple of places.
Also a problem for "typeof (x)" for the same reason.
Summary: delete operator is wonky → Parser generates ListExpr in many cases when it shouldn't
Created attachment 311190 [details] [diff] [review] Patch Removes ListExpr from ESC, substitutes CommaExpr and cleans up some hacks that were necessary to support ListExpr previously.
Attachment #311190 - Flags: review?(jodyer)
Comment on attachment 311190 [details] [diff] [review] Patch This matches my updated grammar with one difference being is renamed parenListExpression to parenExpression rather than parenCommaExpression
Attachment #311190 - Flags: review?(jodyer) → review+
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Was never pushed, new changeset 492:9068d6de7549
You need to log in before you can comment on or make changes to this bug.