-
Notifications
You must be signed in to change notification settings - Fork 756
Description
While investigating the standards documents for function parsing, I found that the TR document for css-syntax-3 has parse errors for unexpected EOF tokens, while the draft version does not.
This was apparently changed in [6ab5888] without any reasonable explanation, and it effectively undoes #132 for this part of the spec at least.
Also, there is conflicting information here: a missing closing parenthesis for a function is, according to the spec, not optional (and hasn't been at least since 2011, I didn't check further back) and should throw a syntax error, while an EOF says to throw a parse error and still return the function.
It makes no sense to silently accept this kind of error for a function, especially if the standard explicitly says to throw. At the moment, our engine does throw (a syntaxerror) as indicated by the spec, when a closing parenthesis is omitted e.g. in a querySelectorAll JS call, but with this change it would also be instructed to silently ignore it, promoting non-standard coding practices.
"Well, which is it, baby? Spitz or Swallows?" -- Austin Powers
It would serve everyone (browser vendors, webmasters, etc.) for this standard to be clear what to do with obviously incomplete functions, and at the very least preserve the parse error on unexpected EOF.