Created
June 29, 2015 11:52
-
-
Save anupj/641fda3d43456e0cc263 to your computer and use it in GitHub Desktop.
Revisions
-
anupj revised this gist
Jun 29, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ // Copied from Effective Javascript (by David Herman) // Item 31: Prefer Object.getPrototypeOf to __proto__ // For JS environments that do not provide the ES5 API, it is easy to implement // in terms of __proto__ -
anupj created this gist
Jun 29, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ // Copied from Effective Javascript (by David Herman // Item 31: Prefer Object.getPrototypeOf to __proto__ // For JS environments that do not provide the ES5 API, it is easy to implement // in terms of __proto__ if (typeof Object.getPrototypeOf === "undefined" ) { Object.getPrototypeOf = function(obj) { var t = typeof obj; if (!obj || (t !== "object" && t != "function")) { throw new TypeError("not an object"); } return obj.__proto__; }; }