P
Peter Michaux
Peter said:Peter Michaux wrote:
[...] For example, from David's code
if (isRealObjectProperty(this, 'document')) {
doc = this.document;
// snip ...
if (isFeaturedMethod(doc, 'getElementById')) {
return function(id, docNode) {
return idCheck((docNode || doc).getElementById(id), id);
};
}
In the call to isFeaturedMethod there is no need to check the typeof
doc. It is already known from the isRealObjectProperty call. This
statement assumes that the isFeaturedMethod and isRealObjects work as
advertised.
I think David will never have the error that you are concerned about
when you write about unqualified references causing an error when the
call is made.
ACK.I don't know what this means. I rarely know what your abbreviations
mean.
It means ACKnowledge(d) (from the ASCII mnemonic), and it is not my
invention:http://catb.org/~esr/jargon/html/A/ACK.html
You can also find explanations for (hacker) jargon like those abbreviations
in the Wikipedia, e.g.http://en.wikipedia.org/wiki/ACK
That could be done with the following around all the code.if (typeof this != 'unknown') {
I meant "undefined"