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 1.17.6 to 1.17.7

pkg/sinon-1.17.7.js

8

Changelog.txt
v1.17.7 / 2016-12-31
==================
* Fix #1026: stub watch method on object
* Fix invalid test for "does not walk the same property twice"
* Fix spying/stubbing on *etter methods
* restoring *etters does not invoke the getter #1124
v1.17.6 / 2016-09-19

@@ -3,0 +11,0 @@ ==================

8

lib/sinon/spy.js

@@ -34,7 +34,11 @@ /**

if (types) {
// A new descriptor is needed here because we can only wrap functions
// By passing the original descriptor we would end up trying to spy non-function properties
var descriptor = {};
var methodDesc = sinon.getPropertyDescriptor(object, property);
for (var i = 0; i < types.length; i++) {
methodDesc[types[i]] = spy.create(methodDesc[types[i]]);
descriptor[types[i]] = spy.create(methodDesc[types[i]]);
}
return sinon.wrapMethod(object, property, methodDesc);
return sinon.wrapMethod(object, property, descriptor);
}

@@ -41,0 +45,0 @@

@@ -106,3 +106,4 @@ /**

// when using hasOwn.call on objects from other frames.
var owned = object.hasOwnProperty ? object.hasOwnProperty(property) : hasOwn.call(object, property);
var owned = (object.hasOwnProperty && object.hasOwnProperty === hasOwn) ?
object.hasOwnProperty(property) : hasOwn.call(object, property);

@@ -171,5 +172,13 @@ if (hasES5Support) {

// this only supports ES5 getter/setter, for ES3.1 and lower
// __lookupSetter__ / __lookupGetter__ should be integrated
if (hasES5Support) {
var checkDesc = sinon.getPropertyDescriptor(object, property);
if (checkDesc.value === method) {
object[property] = wrappedMethod;
}
// Use strict equality comparison to check failures then force a reset
// via direct assignment.
if (object[property] === method) {
} else if (object[property] === method) {
object[property] = wrappedMethod;

@@ -176,0 +185,0 @@ }

@@ -24,3 +24,3 @@ /**

Object.getOwnPropertyNames(obj).forEach(function (k) {
if (!seen[k]) {
if (seen[k] !== true) {
seen[k] = true;

@@ -27,0 +27,0 @@ var target = typeof Object.getOwnPropertyDescriptor(obj, k).get === "function" ?

{
"name": "sinon",
"description": "JavaScript test spies, stubs and mocks.",
"version": "1.17.6",
"version": "1.17.7",
"homepage": "http://sinonjs.org/",

@@ -6,0 +6,0 @@ "author": "Christian Johansen",

/**
* Sinon.JS 1.17.6, 2016/09/19
* Sinon.JS 1.17.7, 2016/12/31
*

@@ -4,0 +4,0 @@ * @author Christian Johansen (christian@cjohansen.no)

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

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