can-construct-super
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -43,6 +43,14 @@ /* global require, module */ | ||
// Check if we're overwriting an existing function | ||
addTo[name] = isFunction(val) && isFunction(base[name]) && fnTest.test(val) ? | ||
getSuper(base, name, val) : val; | ||
var baseDescriptor = Object.getOwnPropertyDescriptor(base, name); | ||
var baseValue = baseDescriptor && baseDescriptor.value; | ||
Object.defineProperty(addTo, name, { | ||
value: isFunction(val) && isFunction(baseValue) && fnTest.test(val) ? | ||
getSuper(base, name, val) : val, | ||
configurable: true, | ||
enumerable: true, | ||
writable: true | ||
}); | ||
}; | ||
module.exports = Construct; |
{ | ||
"name": "can-construct-super", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Provides a reference to the prototypal parent using this._super in can-construct objects", | ||
@@ -5,0 +5,0 @@ "main": "can-construct-super", |
@@ -96,1 +96,19 @@ /* global require, test, stop, start, expect, equal, Promise */ | ||
QUnit.test("setters not invoked on extension (#9)", function(){ | ||
var extending = true; | ||
var Base = Construct.extend("Base",{ | ||
set something(value){ | ||
QUnit.ok(!extending, "set not called when not extending"); | ||
}, | ||
get something(){ | ||
QUnit.ok(!extending, "get not called when not extending"); | ||
} | ||
}); | ||
Base.extend("Extended",{ | ||
something: "value" | ||
}); | ||
extending = false; | ||
new Base().something = "foo"; | ||
}); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
12063
169