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

sinon

Package Overview
Dependencies
Maintainers
3
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.0 to 1.17.1

pkg/sinon-1.17.1.js

8

Changelog.txt

@@ -0,3 +1,9 @@

1.17.1 / 2015-09-26
==================
1.7.0 / 2015-09-22
* Fix #851: Do not attempt to re-stub constructors
* Fix #847: Ensure walk invokes accessors directly on target
* Run tests in node 4.1.x also
1.17.0 / 2015-09-22
==================

@@ -4,0 +10,0 @@

@@ -57,2 +57,3 @@ /**

propOwner !== Object.prototype &&
prop !== "constructor" &&
typeof sinon.getPropertyDescriptor(propOwner, prop).value === "function"

@@ -59,0 +60,0 @@ ) {

32

lib/sinon/walk.js

@@ -8,13 +8,3 @@ /**

function makeApi(sinon) {
/* Public: walks the prototype chain of an object and iterates over every own property
* name encountered. The iterator is called in the same fashion that Array.prototype.forEach
* works, where it is passed the value, key, and own object as the 1st, 2nd, and 3rd positional
* argument, respectively. In cases where Object.getOwnPropertyNames is not available, walk will
* default to using a simple for..in loop.
*
* obj - The object to walk the prototype chain for.
* iterator - The function to be called on each pass of the walk.
* context - (Optional) When given, the iterator will be called with this object as the receiver.
*/
function walk(obj, iterator, context) {
function walkInternal(obj, iterator, context, originalObj) {
var proto, prop;

@@ -35,3 +25,5 @@

Object.getOwnPropertyNames(obj).forEach(function (k) {
iterator.call(context, obj[k], k, obj);
var target = typeof Object.getOwnPropertyDescriptor(obj, k).get === "function" ?
originalObj : obj;
iterator.call(context, target[k], k, target);
});

@@ -41,6 +33,20 @@

if (proto) {
walk(proto, iterator, context);
walkInternal(proto, iterator, context, originalObj);
}
}
/* Public: walks the prototype chain of an object and iterates over every own property
* name encountered. The iterator is called in the same fashion that Array.prototype.forEach
* works, where it is passed the value, key, and own object as the 1st, 2nd, and 3rd positional
* argument, respectively. In cases where Object.getOwnPropertyNames is not available, walk will
* default to using a simple for..in loop.
*
* obj - The object to walk the prototype chain for.
* iterator - The function to be called on each pass of the walk.
* context - (Optional) When given, the iterator will be called with this object as the receiver.
*/
function walk(obj, iterator, context) {
return walkInternal(obj, iterator, context, obj);
}
sinon.walk = walk;

@@ -47,0 +53,0 @@ return sinon.walk;

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

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

/**
* Sinon.JS 1.16.1, 2015/09/22
* Sinon.JS 1.16.1, 2015/09/12
*

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

/**
* Sinon.JS 1.17.0, 2015/09/22
* Sinon.JS 1.17.0, 2015/09/25
*

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

/**
* Sinon.JS 1.17.0, 2015/09/22
* Sinon.JS 1.17.1, 2015/09/26
*

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

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

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