Sergio Maffeis (2014-06-11T15:08:50.000Z)
domenic at domenicdenicola.com (2014-06-12T22:41:06.927Z)
According to paragraph 11.4.1 of ECMA262 v.5.1, and in particular to point 5.a of that paragraph, a catchable "SyntaxError exception" should be thrown when deleting a strict reference in strict mode. The code below tests this feature: ```js var fun = function (){ "use strict"; // strict mode delete x; // strict reference }; // this assignment should execute fine try { fun (); // this should throw a SyntaxError } catch (e){ alert("exception caught as expected"); } ``` We found that current browsers instead terminate abruptly the script execution at parse time, with an error message. This behaviour is typical of "early errors", described in Chapter 16, but it is not obvious that the one above should be considered an early error. Ch.16 says that "syntax errors" must be reported early. Now, while the code "foo( ^&*bar((]" is clearly a "syntax error", it's not obvious that throwing a SyntaxError exception should also be considered a "syntax error" in the same sense. (Section 11.1.5 states explicitly a case where the latter should happen, but 11.4.1 does not.) so, should every occurrence in the spec of the wording "throw a SyntaxError exception" be taken to have the implicit subscript "unless this can be reported as an early error", or are the browsers diverging from the spec? the jscert.org team