archives

« Bugzilla Issues Index

#590 — 13.7 Tail Position specification resolution


Per resolution on July 24th at the in-person TC39 meeting...


Anything that could invoke user written code in a tail position to act as a tail call.

This includes:
call, apply, accessors, quasi aka template (interpolation), proxy calls


NOTE: We still need to specify the tail positions in the syntax. There's a start by DH on http://wiki.ecmascript.org/doku.php?id=harmony:proper_tail_calls which uses an attribute grammar, but the current spec draft leaves this blank.


regular calls, constructors, template tag calls, and the call and apply functions are specified to do tail calls.

accessor calls, proxy traps, and internal methods in general aren't don't have their own execution context so they don't internally know when they may be making a tail call relative to the surrounding method and externally determining whether every possible internal operation that might trigger one of these seems way to hard. It isn't going to happen for ES6. Maybe in the future, but maybe not...