Permalink
Browse files

Don't bother with the .constructor.prototpe trick.

It breaks things and we don't really need it.
  • Loading branch information...
1 parent 22bfe18 commit 446d3fd8441720a100065d2b7e75638aa874f9b9 @creationix committed Aug 19, 2010
Showing with 0 additions and 4 deletions.
  1. +0 −4 lib/class.js
View
@@ -4,10 +4,6 @@ var Class = module.exports = Object.create(Object.prototype, {
// Implement extend for easy prototypal inheritance
extend: {value: function extend(obj) {
if (obj === undefined) return Object.create(this);
- // Hook back so the constructor function still works like classical if needed
- if (typeof obj.constructor === 'function') {
- Object.defineProperty(obj.constructor, "prototype", {value: obj});
- }
obj.__proto__ = this;
Object.freeze(obj); // Lock the prototype to enforce no changes
return obj;

0 comments on commit 446d3fd

Please sign in to comment.