Thomas said:
Garrett said:
Thomas said:
Garrett Smith wrote:
Thomas 'PointedEars' Lahn wrote:
Garrett Smith wrote:
A safe way to remove an existing event handler property is to replace
the value with a function the does nothing and returns undefined. The
global noop function `Function.prototype` fits that bill perfectly.
Example:
hostObject[methodName] = Function.prototype;
ECMA-262 states:
| The Function prototype object is itself a Function object (its
| [[Class]] is "Function") that, when invoked, accepts any arguments
| and returns undefined.
We've been over this.
Ah, PointedEars, never one to miss an opportunity to harass the FAQ
Maintainer with his confusion. And here again...
Fallacy.
Function.prototype returns nothing.
Irrelevant.
Not irrelevant, but not correct terminology. Function.prototype returns
undefined.
Which is either irrelevant to the question whether it is a "no-op function"
or proves that it is _not_ a "no-op function".
They are as fully specified as Function.prototype.
No, with only a few exceptions there are algorithms specified for those
functions that need to be implemented in conforming implementations.
You just apparently didn't take the advice that you so often curtly dish
out: RTFM.
F^HRead it yourself.
You have posted misinformation here on this thread and on your website.
The one of us that has not read (or understood) the specification is you.
As for String(), the Specification goes:
| 15.5.1.1 String ( [ value ] )
|
| Returns a String value (not a String object) computed by ToString(value).
| If value is not supplied, the empty String "" is returned.
That is *a lot* more definitive than for `Function.prototype'.
That definition is an algorithm definition. It does not imply the use of
any specific implementation technique. In practice, there may be more
efficient algorithms available to implement a given feature.
The definition for Function.prototype completely describes the expected
behavior that is seen in implementations.
| The Function prototype object is itself a Function object (its
| [[Class]] is "Function") that, when invoked, accepts any arguments and
| returns undefined.
And if that is enough, then perhaps somebody (and hopefully someone who
has demonstrated a more rational line of thinking) might state why it is
confusing.
Indeed, it would seem like a Pointless waste of space to have such
algorithm there, e.g.
| 1. Return.
Would anyone care to see that included in the specification? The
specification authors have issues of greater significance to worry about
such pedantic nonsense.
And so the absence of such algorithm does not mean that there may be
side effects any more than the absence of mention of side effects for
parseInt means there may be side effects. The algorithms in the
specification are used to clarify semantics.
Given the number of your fallacies lately, it is too much of a waste of time
for me to look up the English terminology. Get a new logic module, then I
might start to take you seriously again.
There a few fallacies there.
The first is that it is too much of a waste of time for you. It is
obvious that you love wasting time, so your statement is obviously
untrue. That is a non sequitur.
The second fallacy is that you provided a false statement to support the
claim that htere are a number of fallacies lately.
The second is a Tu Quoque. I post something correct, then you want to
say that its wrong or nonsense. It usually takes several posts to get
the message through. You went as far recently as to posting blatant lies
about the intentions of what I wrote. There was the long argument about
authors serving invalid HTML are expecting nonstandard behavior.
All of these things take time away from other things that I do, which
includes maintaining the FAQ.
Which is irrelevant as to what happens between the moment it is called and
the moment it returns.
The definition in the specification is as clear and precise as needed.
I missed the word "what" before implementations.
I find your arguments increasingly strewn with increasingly gaping defects
in logic. They are really getting VK-ish.
What does VK have to do with this?
One case where Function.prototype function cannot be used is for new
expressions; Function.prototype is not specified to implement
[[Construct]],
Yes, it is. All "Function objects" must have that property, per section
13.2.
"13.2 Creating Function Objects" describes the process for creating a
user-defined function.
Yes, that can be inferred.
There is a difference between built-in and user-defined. *sigh* and after
all that discussion of the FAQ entry "What is a built-in object".
Fallacy again.
No fallacy at all.
[...]
Keep coughing. To yourself.
Ah, another (worthless) unsupported assertion that, unsurprisingly,
happens to be false.
I earlier posted the first paragraph for Function.prototype. I will post
and explain the second paragraph from the specification, for the whiny
baby who refuses to read it himself.
When a property is to be resolved, the object itself is searched first.
If the object does not contain a property, the prototype chain is searched.
Thus, a resolution of `Function.prototype.prototype` must first attempt
to resolve a property named "prototype" on `Function.prototype`.
Function.prototype does not contain a prototype property and so the
[[prototype]] for Function.prototype is searched. That object is
`Object.prototype`.
| The value of the [[Prototype]] internal property of the Function
| prototype object is the standard built-in Object prototype object
| (15.2.4).
Object.prototype is next in the prototype chain and it does not have a
prototype property either. Object.prototype has:
constructor
toString
toLocaleString
valueOf
hasOwnProperty
isPrototypeOf
propertyIsEnumerable
| The value of the [[Prototype]] internal property of the Object
| prototype object is null, the value of the [[Class]] internal property
| is "Object", and the initial value of the [[Extensible]] internal
| property is true.
Object.prototype does not have a prototype, and so the property
resolution ends at the end of the prototype chain and the value
undefined is returned.
This is redundantly stated elsewhere in the specification:
| Every built-in prototype object has the Object prototype object, which
| is the initial value of the expression Object.prototype (15.2.3.1), as
| the value of its internal [[Prototype]] property, except the Object
| prototype object itself.
I see a lot of irrelevance. It is coming not from the standard, but from
you.
Again, my point is that Function.prototype is a function that accepts
any number of arguments and returns undefined.
One word snips like "Fallacy," "No," "Wishful thinking," "Wrong,"
"Irrelevant," all the while being totally wrong, each and every time, is
irrelevant. Dragging VK into this is irrelevant.
| This assessment is mostly based on the fact that the versions of the
| implementations the features require can be considered obsolete because
| the user agents known to implement them can be considered obsolete (see
| the respective version information for details). Note that this assessment
| is likely to be subject to change as more implementations are evaluated.
| If taken as a recommendation for design decisions, it should be taken as
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| a light one.
^^^^^^^^^^^^
Saying that your advice should be "taken lightly" should not be
considered as anything other than a weak attempt at self-deprecating humor.
You have shown incompetence and unreliability several times in this
thread and have wasted a considerable amount of time in doing that.
1) Stating that Function.prototype implements construct; once with your
assigning undefined to window.onerror,
2) Stating that Function.prototype could not be reused everywhere
3) Stating that expecting a TypeError out of using Function.prototype in
a NewExpression was wrong.
4) Assigning window.onerror a value undefined and wondering why it
throws errors (then laughably calling me an idiot for that).
See below.
By contrast, `window' is actually a *host-defined* property which is
therefore going to be test subject for the *DOM* Support Matrix (I have only
included it in the ES Matrix for completeness, since it was documented as
being part of JavaScript for quite some time) before I consider not feature-
testing it.
Idiot. Assigning `undefined' there was unintentional. RTFT.
Let met get this straight. You had a bug, you couldn't figure it out on
your own, and now I'm an idiot?!
Idiot. The highlighting is automatically based on the information I could
enter so far. Which in this case is almost nothing, so ...
Suffice it to say that Function.prototype.prototype does refer to an Object
instance in JavaScript 1.8.2, and perhaps earlier versions, which, after
tests, is going to be documented accordingly.
I don't care. Looking at the one place you pointed (misled, really) the
reader to had wrong information and you couldn't be bothered to read the
manual when I pointed it out, so I had to do it for you.