can-construct
Advanced tools
Comparing version 3.5.1 to 3.5.2
@@ -279,1 +279,17 @@ QUnit = require('steal-qunit'); | ||
}); | ||
QUnit.test("enumerability", function(){ | ||
var Parent = Construct.extend("Parent", {}); | ||
var child = new Parent(); | ||
child.foo = "bar"; | ||
var props = {}; | ||
for(var prop in child) { | ||
props[prop] = true; | ||
} | ||
QUnit.deepEqual(props, { | ||
foo: true | ||
}, "only has ownProps"); | ||
}); |
@@ -137,2 +137,10 @@ "use strict"; | ||
} | ||
}, | ||
defineNonEnumerable = function(obj, prop, value) { | ||
Object.defineProperty(obj, prop, { | ||
configurable: true, | ||
writable: true, | ||
enumerable: false, | ||
value: value | ||
}); | ||
}; | ||
@@ -690,3 +698,3 @@ /** | ||
// Make sure our prototype looks nice. | ||
Constructor.prototype.constructor = Constructor; | ||
defineNonEnumerable(Constructor.prototype, "constructor", Constructor); | ||
// Call the class `setup` and `init` | ||
@@ -815,3 +823,3 @@ var t = [_super_class].concat(Array.prototype.slice.call(arguments)), | ||
*/ | ||
Construct.prototype.setup = function () {}; | ||
defineNonEnumerable(Construct.prototype, function () {}); | ||
/** | ||
@@ -876,4 +884,4 @@ * @function can-construct.prototype.init init | ||
*/ | ||
Construct.prototype.init = function () {}; | ||
defineNonEnumerable(Construct.prototype, "init", function () {}); | ||
module.exports = namespace.Construct = Construct; |
{ | ||
"name": "can-construct", | ||
"version": "3.5.1", | ||
"version": "3.5.2", | ||
"description": "easy constructor functions", | ||
@@ -5,0 +5,0 @@ "homepage": "http://canjs.com", |
47252
1159