« Bugzilla Issues Index

#133 — S13.0_A5 checks for a syntax error in what could be (is, in Firefox) a language extension

S13.0_A5 checks for these things throwing SyntaxError exceptions:

eval("function __func([arg1, arg2, arg3]){return arguments.length;}");
eval("function __func((arg1, arg2, arg3)){return arguments.length;}");
eval("function __func(arg1, arg2, arg3,){return arguments.length;}");

In theory an implementation could extend syntax to permit all of these. I'm not aware of anything that implements the latter two as extensions, so I don't particularly care about them (although some policy on this -- I think I remember a bug on the matter -- is probably a good idea). :-) But the first is destructuring assignment, which Firefox implements (and which might end up in a future ECMAScript edition), so testing for it throwing a SyntaxError breaks us.

Could the first check, at the very least, be removed from the test?

Yes, FormalParameterListopt in FunctionDeclaration/FunctionExpression could be replaced by an array or something else via ES5's extension clause. Just disabled the test in source control, and now re-assigning to Mark to address (e.g., move to a "Sputnik\Negative\*" directory?). Thanks for spotting this Jeff!

Fixed at