Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sinon

Package Overview
Dependencies
Maintainers
4
Versions
208
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sinon - npm Package Compare versions

Comparing version 9.0.0 to 9.0.1

lib/sinon/util/.DS_Store

5

CHANGELOG.md
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 @@ ==================

2

lib/sinon/default-behaviors.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc