Skip to content

Commit

Permalink
Move Object.seal into the Class framework.
Browse files Browse the repository at this point in the history
  • Loading branch information
creationix committed Aug 19, 2010
1 parent bcb1fdd commit e459cb9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 2 additions & 0 deletions lib/class.js
Expand Up @@ -32,6 +32,8 @@ var Class = module.exports = Object.create(Object.prototype, {
new: {value: function () { new: {value: function () {
var obj = Object.create(this); var obj = Object.create(this);
if (obj.initialize) obj.initialize.apply(obj, arguments); if (obj.initialize) obj.initialize.apply(obj, arguments);
// Lock the object down
Object.seal(obj);
return obj; return obj;
}} }}
}); });
2 changes: 0 additions & 2 deletions lib/nstore.js
Expand Up @@ -25,8 +25,6 @@ var nStore = module.exports = Class.extend({
this.dbLength = 0; this.dbLength = 0;
this.busy = false; this.busy = false;
this.filterFn = null; this.filterFn = null;
// We don't want any other properties on this object that aren't initialized here
Object.seal(this);
this.loadDatabase(callback); this.loadDatabase(callback);
}, },


Expand Down
3 changes: 0 additions & 3 deletions lib/queue.js
Expand Up @@ -8,9 +8,6 @@ var Queue = module.exports = Class.extend({
this.tail = []; this.tail = [];
this.head = Array.prototype.slice.call(arguments); this.head = Array.prototype.slice.call(arguments);
this.offset = 0; this.offset = 0;
// Lock the object down
Object.seal(this);
return this;
}, },
shift: function shift() { shift: function shift() {
if (this.offset === this.head.length) { if (this.offset === this.head.length) {
Expand Down

0 comments on commit e459cb9

Please sign in to comment.