Created
April 17, 2011 01:22
-
-
Save robotlolita/923661 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SomeObject() { | |
this.x = 0; | |
} | |
SomeObject.prototype = (function() { | |
return { foo: foo | |
, bar: bar } | |
function foo() { return bar() } /* function definition */ | |
function bar() { return foo() } | |
var x = function() { } /* function expression - never executes */ | |
})() | |
------------------------------------------------ | |
The order it is represented in the syntax tree: | |
function SomeObject() { | |
this.x = 0; | |
} | |
SomeObject.prototype = (function() { | |
var x | |
function foo() { return bar() } | |
function bar() { return foo() } | |
return { foo: foo, bar: bar } | |
x = function() { } | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment