Let's kill terms "native" and "host"
Tom Van Cutsem
tomvc.be at gmail.com
Mon Jan 30 06:38:00 PST 2012
> On 29 January 2012 20:25, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
> > Here is a first cut at some improved terminology:
> > ECMAScript Object - an object whose primitive semantics are specified by
> > ECMAScript specification
> > Foreign Object - an object whose primitive semantics differ from those
> > specified by the ECMAScript specification
Gilad Bracha has been using the term "aliens" for "Foreign Objects" in
Newspeak. It's shorter, and to me sounds less awkward than having to refer
to a Foreign object as a "foreigner" ;-)
> > ECMAScript Code Function - an ECMAScript Function whose application level
> semantics are defined using ECMAScript code
> > ECMAScript Foreign Code Function - an ECMAScript Function whose
> > level semantics are defined in some manner other than with ECMAScript
> The last two seem a bit obscure, especially since the spec doesn't
> really talk about code. Also, for e.g. function proxies, it is not
> really clear what code this is referring to (the call trap? the
> construct trap? what if the call trap is itself a function proxy whose
> call trap is foreign?).
I agree there's room for improvement, but proxies are weird beasts in this
respect. For direct proxies though, I have a principled answer: I'd
classify function proxies recursively as however their target would be
classified. So if the target is an ECMAScript Code Function, so is the
proxy. If the target is foreign, so is the proxy. This is consistent with
the way typeof and [[Class]] are specified for direct proxies in general.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss