We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8186280 commit 305fb6cCopy full SHA for 305fb6c
lib/sinon/sandbox.js
@@ -197,18 +197,15 @@ function Sandbox() {
197
};
198
199
sandbox.restoreContext = function restoreContext() {
200
- let injectedKeys = sandbox.injectedKeys;
201
- const injectInto = sandbox.injectInto;
202
-
203
- if (!injectedKeys) {
+ if (!sandbox.injectedKeys) {
204
return;
205
}
206
207
- forEach(injectedKeys, function (injectedKey) {
208
- delete injectInto[injectedKey];
+ forEach(sandbox.injectedKeys, function (injectedKey) {
+ delete sandbox.injectInto[injectedKey];
209
});
210
211
- injectedKeys = [];
+ sandbox.injectedKeys.length = 0;
212
213
214
function getFakeRestorer(object, property) {
0 commit comments