Skip to content

Instantly share code, notes, and snippets.

@creationix
Created February 27, 2010 21:29
Show Gist options
  • Save creationix/316969 to your computer and use it in GitHub Desktop.
Save creationix/316969 to your computer and use it in GitHub Desktop.
function nodeFactory() {
function toStringFactory(data) { return function toString() {
// TODO: Implement
}}
function compileFactory(data) { return function compile() {
// TODO: Implement
}}
return {
BaseNode: function (data) {
return {
toString: toStringFactory(data),
compile: compileFactory(data)
}
},
ForNode: function (data) {
return {
toString: function () {
// Override toString
}
compile: compileFactory(data)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment