Created
April 10, 2015 14:24
-
-
Save sonthonaxrk/5f055395803770beb730 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 JSONResourceCollection(source, Type) { | |
if (Type.prototype.isPrototypeOf(JSONResource.prototype)) { | |
this.Type = Type; | |
} else { | |
// this get's thrown | |
throw "The Type must be a subclass of JSONResource"; | |
} | |
} | |
JSONResourceCollection("http://example.com/", JSONResource); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment