Comparing version 1.17.0 to 1.17.1
@@ -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 @@ ) { |
@@ -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
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
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
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
1347276
46
33401
8
9