G
Garrett Smith
David said:[...]David said:kangax wrote:
Conrad Lender wrote:
[...]
I'm can't prove it was not, but I bet you are wrong on that.
Are you kidding?
Not kidding.
It was an "unknown" type. That's a fact. And it
behaved just as the "unknown" types do in Windows (blows up on type
conversion, among other things.)
So you had an object where:-
typeof obj == "unknown"
was true in Mac IE. I have not seen that and I'm calling you on that. I
think you are mistaken. Please post an example.
That is exactly what I said. I didn't say a thing about Gecko's
developers trying to stay away from it.
I don't know what that means.
Ah, you said:
| Gecko's document.all is an "undefined" type, despite its availability
| (clearly a cue from the Gecko developers to stay away from it.)
My reply is in response to that. Gecko developers were not cuing. They
were trying to make IE-only sites work.
As in refuse.
Are you British?
And?
I wanted to ask: Is what I wrote what you meant? Did you mean: If
isHostMethod(document, "getElementById"); returns true, then you can be
sure that isHostMethod is a host method.
?
That is a true statement and I think that is what you meant but it is
not what you wrote. You wrote:
| If it passes - for example - gEBI, you can be quite sure it is a host
| method.
- not true, if taken literally. Does not make much sense to me.
YES.
That is what isHostMethod does. It does nothing more.
That is *also* the approach for using the |in| operator.
Both are valid approaches. Neither is infallible.
We've discussed this to death.
No argument there.
The first argument is a host
object. Not an Object object or a string or whatever. The second is
the name of a method. Not a name of any other type of property. I
think it is quite clear. The name kind of says it all.
The method requires the developer to know that the second argument is
the name of a method.
Do you see a parallel to the approach using |in| ?
The benefit to |in| is that is inline and does not require stepping into
another line of code in another file.
So, IIUC, isHostMethod detects the presence of a property, and that it
is not a primitive value (it even has to call [[Get]] to do that). Did I
get that right?
Not even in the ballpark. And I don't think you are really trying.
How did you come to that, or why do you say that? Can you respond more
specifically to what I wrote?
That is not what it does. In fact, such a method would be completely
idiotic (see jQuery.) And see above.
It would be well-intentioned, but could not work.
Oh, but it does. Perhaps not in the way you would like, but it is the
only way in reality.
isHostMethod(document, "images");
returns true in all browsers.
But document.images is *not* callable in all browsers.
I don't care what you do with that thing.
I am disappointed to hear that. Yesterday you seemed interested with
what should and should not go into the FAQ.
| We've settled these issues and nothing like this is going in
| the FAQ if I have anything to say about it (and you know I will.)
You said your bit, the proposed change that you agreed to was agreed on
by me, making three of us.
The FAQ is a document for learning and reference.
The FAQ is an accurate collection of knowledge that is critically
reviewed. It is corrected and republished at 0 marginal cost with little
environmental impact. It is a more accurate reference than the books and
videos and other sources of inaccuracies.
The rampant misconception that javascript development requires using a
preconceived library like Dojo can be recognized for what it is by more
people learning.
The FAQ has to get better.
Garrett