ecma262
ecma262 copied to clipboard
Allow cross-realm tail calls to consume linear resources.
LGTM; it seems like we reached consensus on this at the March 2016 TC39 meeting on Tuesday.
In more discussion within the TC39 meeting, we decided that this patch should be reworded to explicitly allow (and, non-normatively, prefer) proper tail calls. @allenwb
I believe the current patch meets the requirements from TC39 that the wording should aim towards explicitly allowing (and phrasing as the default) proper tail calls.
In https://github.com/tc39/ecma262/issues/535 , @msaboff raised concerns about the web compatibility of making proper tail calls optional for the cross-realm case. Let's continue discussion of that on this thread.
@littledan / @efaust I don't believe this text matches consensus because it is default-no-TCO-cross-realm. I think it would be preferable to have the default case be that cross-realm tail calls happen as this text reads like it's somehow desirable to not do tail calls. That said, I'm not entirely sure how to accomplish this without allowing an implementation to decide for any reason they can't do a tail call which kind of defeats the purpose here. Thoughts?
We could make it like SetValueInBuffer, where the implementation decides whether it's a tail-calling or non-tail-calling cross-realm thing.
At the TC39 meeting in May 2016, @msaboff clarified that he has no objection to this change. The PR seems to have changed the default.