Comparing version 1.17.1 to 1.17.2
@@ -0,1 +1,7 @@ | ||
1.17.2 / 2015-10-21 | ||
================== | ||
* Fix #867: Walk properties only once | ||
1.17.1 / 2015-09-26 | ||
@@ -2,0 +8,0 @@ ================== |
@@ -8,3 +8,3 @@ /** | ||
function makeApi(sinon) { | ||
function walkInternal(obj, iterator, context, originalObj) { | ||
function walkInternal(obj, iterator, context, originalObj, seen) { | ||
var proto, prop; | ||
@@ -25,5 +25,8 @@ | ||
Object.getOwnPropertyNames(obj).forEach(function (k) { | ||
var target = typeof Object.getOwnPropertyDescriptor(obj, k).get === "function" ? | ||
originalObj : obj; | ||
iterator.call(context, target[k], k, target); | ||
if (!seen[k]) { | ||
seen[k] = true; | ||
var target = typeof Object.getOwnPropertyDescriptor(obj, k).get === "function" ? | ||
originalObj : obj; | ||
iterator.call(context, target[k], k, target); | ||
} | ||
}); | ||
@@ -33,3 +36,3 @@ | ||
if (proto) { | ||
walkInternal(proto, iterator, context, originalObj); | ||
walkInternal(proto, iterator, context, originalObj, seen); | ||
} | ||
@@ -49,3 +52,3 @@ } | ||
function walk(obj, iterator, context) { | ||
return walkInternal(obj, iterator, context, obj); | ||
return walkInternal(obj, iterator, context, obj, {}); | ||
} | ||
@@ -52,0 +55,0 @@ |
{ | ||
"name": "sinon", | ||
"description": "JavaScript test spies, stubs and mocks.", | ||
"version": "1.17.1", | ||
"version": "1.17.2", | ||
"homepage": "http://sinonjs.org/", | ||
@@ -6,0 +6,0 @@ "author": "Christian Johansen", |
/** | ||
* Sinon.JS 1.16.1, 2015/09/12 | ||
* Sinon.JS 1.16.1, 2015/09/22 | ||
* | ||
@@ -4,0 +4,0 @@ * @author Christian Johansen (christian@cjohansen.no) |
/** | ||
* Sinon.JS 1.17.0, 2015/09/25 | ||
* Sinon.JS 1.17.0, 2015/10/21 | ||
* | ||
@@ -49,24 +49,21 @@ * @author Christian Johansen (christian@cjohansen.no) | ||
*/ | ||
/*eslint-disable strict, no-inner-declarations, no-unused-vars*/ | ||
if (typeof window !== "undefined") { | ||
function setTimeout() {} | ||
function clearTimeout() {} | ||
function setImmediate() {} | ||
function clearImmediate() {} | ||
function setInterval() {} | ||
function clearInterval() {} | ||
function Date() {} | ||
/*eslint-disable no-func-assign, no-inner-declarations, no-unused-vars, strict*/ | ||
function setTimeout() {} | ||
function clearTimeout() {} | ||
function setImmediate() {} | ||
function clearImmediate() {} | ||
function setInterval() {} | ||
function clearInterval() {} | ||
function Date() {} | ||
// Reassign the original functions. Now their writable attribute | ||
// should be true. Hackish, I know, but it works. | ||
/*global sinon*/ | ||
setTimeout = sinon.timers.setTimeout; | ||
clearTimeout = sinon.timers.clearTimeout; | ||
setImmediate = sinon.timers.setImmediate; | ||
clearImmediate = sinon.timers.clearImmediate; | ||
setInterval = sinon.timers.setInterval; | ||
clearInterval = sinon.timers.clearInterval; | ||
Date = sinon.timers.Date; // eslint-disable-line no-native-reassign | ||
} | ||
/*eslint-enable no-inner-declarations*/ | ||
// Reassign the original functions. Now their writable attribute | ||
// should be true. Hackish, I know, but it works. | ||
/*global sinon*/ | ||
setTimeout = sinon.timers.setTimeout; | ||
clearTimeout = sinon.timers.clearTimeout; | ||
setImmediate = sinon.timers.setImmediate; | ||
clearImmediate = sinon.timers.clearImmediate; | ||
setInterval = sinon.timers.setInterval; | ||
clearInterval = sinon.timers.clearInterval; | ||
Date = sinon.timers.Date; // eslint-disable-line no-native-reassign | ||
@@ -86,12 +83,9 @@ /** | ||
*/ | ||
/*eslint-disable strict*/ | ||
if (typeof window !== "undefined") { | ||
function XMLHttpRequest() {} // eslint-disable-line no-unused-vars, no-inner-declarations | ||
/*eslint-disable no-func-assign, strict*/ | ||
function XMLHttpRequest() {} // eslint-disable-line no-unused-vars, no-inner-declarations | ||
// Reassign the original function. Now its writable attribute | ||
// should be true. Hackish, I know, but it works. | ||
/*global sinon*/ | ||
XMLHttpRequest = sinon.xhr.XMLHttpRequest || undefined; | ||
} | ||
/*eslint-enable strict*/ | ||
// Reassign the original function. Now its writable attribute | ||
// should be true. Hackish, I know, but it works. | ||
/*global sinon*/ | ||
XMLHttpRequest = sinon.xhr.XMLHttpRequest || undefined; | ||
/** | ||
@@ -105,11 +99,8 @@ * Helps IE run the fake XDomainRequest. By defining global functions, IE allows | ||
*/ | ||
/*eslint-disable strict*/ | ||
if (typeof window !== "undefined") { | ||
function XDomainRequest() {} // eslint-disable-line no-unused-vars, no-inner-declarations | ||
/*eslint-disable no-func-assign, strict*/ | ||
function XDomainRequest() {} // eslint-disable-line no-unused-vars, no-inner-declarations | ||
// Reassign the original function. Now its writable attribute | ||
// should be true. Hackish, I know, but it works. | ||
/*global sinon*/ | ||
XDomainRequest = sinon.xdr.XDomainRequest || undefined; | ||
} | ||
/*eslint-enable strict*/ | ||
// Reassign the original function. Now its writable attribute | ||
// should be true. Hackish, I know, but it works. | ||
/*global sinon*/ | ||
XDomainRequest = sinon.xdr.XDomainRequest || undefined; |
/** | ||
* Sinon.JS 1.17.1, 2015/09/26 | ||
* Sinon.JS 1.17.2, 2015/10/21 | ||
* | ||
@@ -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
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
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
33614
1330556
11
10