Permalink
Browse files

Move Object.seal into the Class framework.

  • Loading branch information...
creationix committed Aug 19, 2010
1 parent bcb1fdd commit e459cb953d08398feade618e80befb95483de8a0
Showing with 2 additions and 5 deletions.
  1. +2 −0 lib/class.js
  2. +0 −2 lib/nstore.js
  3. +0 −3 lib/queue.js
View
@@ -32,6 +32,8 @@ var Class = module.exports = Object.create(Object.prototype, {
new: {value: function () {
var obj = Object.create(this);
if (obj.initialize) obj.initialize.apply(obj, arguments);
+ // Lock the object down
+ Object.seal(obj);
return obj;
}}
});
View
@@ -25,8 +25,6 @@ var nStore = module.exports = Class.extend({
this.dbLength = 0;
this.busy = false;
this.filterFn = null;
- // We don't want any other properties on this object that aren't initialized here
- Object.seal(this);
this.loadDatabase(callback);
},
View
@@ -8,9 +8,6 @@ var Queue = module.exports = Class.extend({
this.tail = [];
this.head = Array.prototype.slice.call(arguments);
this.offset = 0;
- // Lock the object down
- Object.seal(this);
- return this;
},
shift: function shift() {
if (this.offset === this.head.length) {

0 comments on commit e459cb9

Please sign in to comment.