Andy,
It should be:
function foo () { return { // bar: function ( x ) { bar: function ( x, y ) { return x + y; } }; }
NOT
function foo () { return { // bar: function ( x ) { bar: function ( x, y ) { return x + y; }, <-- comma indicates that this key/value pair should be followed by at least one more in this object }; }
Your browser may have parsed it, I dunno. I didn't try it. But with an editor that relies on regular expressions to match syntax, something as small as this would probably throw it off.
Michael
On Mar 6, 2007, at 2:24 PM, Andy Armstrong wrote:
On 6 Mar 2007, at 21:21, Michael Jackson wrote:
Ha ha...now I KNOW you're an idiot. First, learn javascript. Your syntax is WRONG.
Actually his syntax is just fine. What did you think was wrong with it?
[18:51] andy $ js js> js> function foo () { return { // bar: function ( x ) { bar: function ( x, y ) { return x + y; }, }; } js> x = foo() [object Object] js> x.bar(1, 2) 3
-- Andy Armstrong, hexten.net
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate