kangax wrote:
> Thomas 'PointedEars' Lahn wrote:
>> kangax wrote:
>>> Thomas 'PointedEars' Lahn wrote:
>>>> `function() { ... }' is a proper expression (see below). You need the
>>>> additional parentheses only if the /FunctionExpression/ is part of a
>>>> /CallExpression/.
>>> Where did you get that from?
>>>
>>> CallExpression:
>>> MemberExpression Arguments
>>>
>>> MemberExpression:
>>> FunctionExpression
>>>
>>> FunctionExpression:
>>> function Identifier opt ( FormalParameterListopt ){ FunctionBody }
>>>
>>> Arguments:
>>> ()
>>>
>>> `function(){}()` (i.e. /FunctionExpression/ as part of /CallExpression/)
>>> looks perfectly valid to me. I don't see why one would need additional
>>> parenthesis here, except for clarity/convention.
>> Parantheses are not needed when the CallExpression is produced only through
^^^^^^^^^^^
>> AssignmentExpression, but they are needed when CallExpression is produced
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Only through /AssignmentExpression/? What about these cases? I don't see
> /AssignmentExpression/'s here:
>
>
> (function(){
> ...
> return function(){}();
> ^^^^^^^^^^^^^^
> ...
> })();
>
> typeof function(){}();
> ^^^^^^^^^^^^^^
Those are ExpressionStatements.
>> through ExpressionStatement.
^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> [...] the prototype chain of an object is not defined indirectly through
>> the instance-constructor-prototype relationship but directly through the
>> internal [[Prototype]] property which is set on creation of the object.
> [...]
>> Maybe I will modify my inheritance method accordingly.
>
> I am surprised to hear you're not reusing "dummy" function in
> "clone"/"inherit"/"beget", as explained and recommended by Cornford as
> far back as few years ago (don't have link to his post at the moment).
Probably I overlooked it then, too.
>> For the figure, I have used the property names from the OP's
>> <news:fd42b071-d246-476b-85fe->
>> to indicate object indentity.
>>
>> I have tried to stay as less confusing as possible. Arrows with "solid"
>> lines indicate normal object references, while arrows with "dotted" lines
>> indicate the prototype chain (which boils down to object references as well
>> but cannot be modified in a standards-compliant way; see below).
>>
>> I hope it makes any sense (fixed-width font required, of course):
>
> Yep. Makes perfect sense after careful observation.
Thanks, but you wouldn't have needed to quote it in full (although it
demonstrates that it can even be quoted

)
>> [...]
>> Benjy: The proprietary `__proto__' property of JavaScript™ objects allows
>> direct access to the internal [[Prototype]] property. Objects in other
>> ECMAScript implementations don't have it.¹
>
> WebKit-based environments have had `__proto__` for a while now.
Unfortunately, Safari doesn't run "at home" (where I wrote that article).
Something in it is incompatible with WINE or vice-versa. Hence the footnote.
> Blackberry's proprietary implementation had it too, las time I checked
> (not sure if they are using webkit).
However, your statement is not supported by the documentation¹.
If there was another ECMAScript implementation to consider, that would be
rather important for me to know at this point. As I have not access to a
BlackBerry, and the documentation¹ doesn't appear to help here², could you
please provide the value of navigator.userAgent or other information which
might provide some insight as to that?
¹ <http://na.blackberry.com/eng/deliverables/8861/Overview_790346_11.jsp>
² However, it lead me to use mozplugger after all. Works like a charm
> Also, FF3.5 has (soon-to-be-standard)
^^^^^^^^^^^^^^^^^^^^^
We'll see. So far it is only a *working draft*.
> ES5's `Object.getPrototypeOf`, probably as a replacement for proprietary
> `__proto__`.
Good to know, thanks. One wonders, though, when ES 5 would draw
considerable attention by other vendors so that this would become
a really useful fact.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16