02:15 | <canadahonk> | very random, what type of error would you expect from (console.log(1))++ |
02:31 | <rkirsling> | "cannot increment a value" |
02:32 | <rkirsling> | JSC's Postfix ++ operator applied to value that is not a reference. seems good |
02:38 | <jmdyck> | a ReferenceError, if that's what you mean by "what type of error" |
02:38 | <rkirsling> | ah yeah sorry, misread the question |
02:38 | <rkirsling> | looks like 1++ is a syntax error and yours is a reference error |
02:39 | <rkirsling> | since one can be determined early and the other can't |
02:46 | <jmdyck> | But now I'm unsure why (console.log(1))++ isn't a Syntax Error. |
02:48 | <jmdyck> | Isn't the AssignmentTargetType of (console.log(1)) ~invalid~ ? |
02:48 | <bakkot> | There is still the old issue about `f() = y` being legal syntax in engines |
02:48 | <bakkot> | This might be the same issue |
02:50 | <rkirsling> | seems likely |
02:52 | <jmdyck> | So this is a case where the spec doesn't match web reality? and tc39 hasn't been able to agree on a resolution? |
03:02 | <canadahonk> | a ReferenceError, if that's what you mean by "what type of error" |
03:06 | <rkirsling> | this was the pre-pandemic state of affairs https://github.com/tc39/ecma262/issues/257#issuecomment-502878708 |
03:06 | <rkirsling> | not sure whether this discussion has advanced significantly since |
03:20 | <bakkot> | So this is a case where the spec doesn't match web reality? and tc39 hasn't been able to agree on a resolution? |
03:33 | <rkirsling> | Rick had made a PR (https://github.com/tc39/ecma262/pull/2193) but I'm not sure whether it was ever discussed in plenary? |
03:36 | <rkirsling> | if the course of action is clear -- syntax error in strict mode ( / for logical assignment), reference error in sloppy mode for web compatibility -- then it does seem just a matter of finally doing it |
03:55 | <Domenic> | I don't think web compat is the issue, for types of errors? I think it's more about implementation burden of adding more/different special case code. I suspect a strict/sloppy split would make that burden worse.... |
03:56 | <Domenic> | Although I guess I am wrong, since it's mentioned that JSC and SpiderMonkey already have a strict/sloppy split. |
03:56 | <Domenic> | Maybe I am remembering some other ReferenceError vs. TypeError issue. |
04:43 | <bakkot> | Domenic you may be thinking of https://github.com/tc39/ecma262/pull/1527, though engines were also willing to do that one |
04:44 | <bakkot> | (or rather, really, were willing to accept rkirsling's patches to do it) |
04:44 | <rkirsling> | yes, that one time when I went for the trifecta |
10:19 | <canadahonk> |