dhtmlkitchen at gmail.com
Thu Oct 11 22:36:21 PDT 2007
On 10/11/07, Brendan Eich <brendan at mozilla.org> wrote:
> On Oct 11, 2007, at 8:02 PM, Garrett Smith wrote:
> >> If you want to apply or call a non-function
> >> callable, use Function.apply(callable, thisp, argArray) or
> >> Function.call(callable, thisp, arg1, ...argN).
> > So these are equivalent?
> > aNonFunctionCallableObj()
> > Function.call( aNonFunctionCallableObj )
> We don't need to go back and forth -- I wrote essentially the same
> thing, but included the optional arguments. The two expressions you
> wrote are equivalent assuming the global object should bind to |this|
> for both to be equivalent.
> > If an object is invokable with arguments (), but not a Callable, it's
> > impossible to type check. IE's call-like operation on with () is not
> > [[call]].
> Why do you say that? There's no reflection of [[Call]] into the
> language yet, so how can you tell?
Well yeah, you're right, I don't know, it's just a lame guess.
* The caller does not provide a reference to the object it acts on.
* The typeof operator. typeof appendChild == "object"; // true.
I don't know what it is.
> (Don't rely on typeof x == "function" meaning x.[[Call]] exists --
> browsers do not follow ES3 here, although we tried in SpiderMonkey
> for years before throwing in the towel.)
> > Microsoft often says that it is necessary to retain backwards
> > compatibility. I would hope they would
> You're barking up the wrong tree here. This is es4-discuss.
Ok. I meant to say "hope they would not continue with this" (or
something like that). Host objects that can act like functions but not
be functions are confusing.
So that that's out of scope for ES4; it's OK for host objects to have
> > Mozilla has this weird function-like thing, too, (only with
> > document.all, which is not used much anymore)
> As I keep saying, any reflection of document.all in an ES4 "DOM level
> 0 plus IE quirks" binding should indeed make (document.all is
> Callable) => true.
> >> I don't know what "BackCompat mode" means, but we do reflect
> >> document.all if a script uses it without object-detecting it, and
> >> only in such cases (since many well-written scripts fork based on if
> >> (document.all) ... else ... tests and we want to run the else
> >> clause).
> > document.compatMode
> > "CSS1Compat" -- standards mode
> > "BackCompat" - quirks mode
> > BackCompat supports document.all
> No, you're mixing things up. As I wrote, our document.all emulation
> has nothing to do with DOM specs or document.compatMode, and it works
> irrespective of the latter's value.
quirksmode -- document.all works
strict mode -- no document.all
It is detectable.
"all" in document
> > Mozilla really made document.all look like IE's weird
> > collection-that-can-be-invoked-with-().
> Like, yeah -- that was the point!
Was heavily debated and implemented. Water under the bridge, right?
Programming is a collaborative art.
More information about the Es4-discuss