Skip to content

Instantly share code, notes, and snippets.

@bnolan
Created June 7, 2010 23:45
Show Gist options
  • Save bnolan/429366 to your computer and use it in GitHub Desktop.
Save bnolan/429366 to your computer and use it in GitHub Desktop.
Instantiate: (klass) ->
ctor = window[klass]
if ctor instanceof Function
`new ctor`
else
throw "Could not construct class of type " + klass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment