Object ID's

Igor Bukanov igor at mir2.org
Thu Mar 22 02:12:58 PDT 2007


On 22/03/07, Brendan Eich <brendan at mozilla.org> wrote:
> On Mar 21, 2007, at 7:27 AM, Igor Bukanov wrote:
> > It looks like the proposal misses function intrinsic::delete(ident)
>
> Why is this needed? There's no delete hook that can be overridden, so
> the delete operator (not a function or method) can be used on any
> property, either named by lexical reference, or by obj.prop or obj
> [computed_name] or more complicated forms involving ::.

Do you mean that ES4 already allows to override delete operator?

> You're right that without has (not the intrinsic::has that would be
> the override-able built-in -- but why do we need that given the in
> operator?) one cannot make with (obj) foo work when obj = {get *(id)
> { if (id === "foo") return 42; return undefined }}. The parallel
> construct would be obj = {has *(id) {...}}. Is this really necessary
> just for with and with-like constructs (E4X's o.(e) filtering
> predicate)?

Oh, "in" can already be overwritten as well? Then one do not need has
* as the implementation can just call the in implementation during
scope lookup to implement with statement.

Regards, Igor



More information about the Es4-discuss mailing list