Comparing version 9.0.0 to 9.0.1
9.0.1 / 2020-03-10 | ||
================== | ||
* Fix #2226: restore props defined on prototype chain by deleting | ||
9.0.0 / 2020-02-19 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -261,3 +261,3 @@ "use strict"; | ||
enumerable: true, | ||
configurable: isPropertyConfigurable(rootStub.rootObj, rootStub.propName) | ||
configurable: rootStub.shadowsPropOnPrototype || isPropertyConfigurable(rootStub.rootObj, rootStub.propName) | ||
}); | ||
@@ -264,0 +264,0 @@ |
@@ -194,3 +194,7 @@ "use strict"; | ||
function restorer() { | ||
Object.defineProperty(object, property, descriptor); | ||
if (descriptor.isOwn) { | ||
Object.defineProperty(object, property, descriptor); | ||
} else { | ||
delete object[property]; | ||
} | ||
} | ||
@@ -197,0 +201,0 @@ restorer.object = object; |
@@ -9,3 +9,3 @@ "use strict"; | ||
var hasOwnProperty = require("@sinonjs/commons").prototypes.object.hasOwnProperty; | ||
var isNonExistentOwnProperty = require("./util/core/is-non-existent-own-property"); | ||
var isNonExistentProperty = require("./util/core/is-non-existent-property"); | ||
var spy = require("./spy"); | ||
@@ -73,4 +73,4 @@ var extend = require("./util/core/extend"); | ||
if (isNonExistentOwnProperty(object, property)) { | ||
throw new TypeError("Cannot stub non-existent own property " + valueToString(property)); | ||
if (isNonExistentProperty(object, property)) { | ||
throw new TypeError("Cannot stub non-existent property " + valueToString(property)); | ||
} | ||
@@ -102,4 +102,5 @@ | ||
propName: property, | ||
shadowsPropOnPrototype: !actualDescriptor.isOwn, | ||
restore: function restore() { | ||
if (actualDescriptor !== undefined) { | ||
if (actualDescriptor !== undefined && actualDescriptor.isOwn) { | ||
Object.defineProperty(object, property, actualDescriptor); | ||
@@ -106,0 +107,0 @@ return; |
@@ -6,2 +6,3 @@ "use strict"; | ||
var descriptor; | ||
var isOwn = Boolean(object && Object.getOwnPropertyDescriptor(object, property)); | ||
@@ -11,3 +12,8 @@ while (proto && !(descriptor = Object.getOwnPropertyDescriptor(proto, property))) { | ||
} | ||
if (descriptor) { | ||
descriptor.isOwn = isOwn; | ||
} | ||
return descriptor; | ||
}; |
{ | ||
"name": "sinon", | ||
"description": "JavaScript test spies, stubs and mocks.", | ||
"version": "9.0.0", | ||
"version": "9.0.1", | ||
"homepage": "https://sinonjs.org/", | ||
@@ -61,4 +61,4 @@ "author": "Christian Johansen", | ||
"@sinonjs/fake-timers": "^6.0.0", | ||
"@sinonjs/formatio": "^5.0.0", | ||
"@sinonjs/samsam": "^5.0.1", | ||
"@sinonjs/formatio": "^5.0.1", | ||
"@sinonjs/samsam": "^5.0.3", | ||
"diff": "^4.0.2", | ||
@@ -85,3 +85,3 @@ "nise": "^4.0.1", | ||
"lint-staged": "^10.0.7", | ||
"markdownlint-cli": "^0.21.0", | ||
"markdownlint-cli": "^0.22.0", | ||
"mocha": "^6.2.0", | ||
@@ -88,0 +88,0 @@ "mochify": "^6.6.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4802811
53
56970
6
5
Updated@sinonjs/formatio@^5.0.1
Updated@sinonjs/samsam@^5.0.3