From 9e3db953e163cd336ab25a208779767298f539c7 Mon Sep 17 00:00:00 2001 From: Morgan Roderick Date: Mon, 8 Oct 2018 19:58:20 +0200 Subject: [PATCH] Fix lint violations for block-scoped-var --- lib/sinon/util/core/wrap-method.js | 4 ++-- test/issues/issues-test.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/sinon/util/core/wrap-method.js b/lib/sinon/util/core/wrap-method.js index 975842ecc..811b95444 100644 --- a/lib/sinon/util/core/wrap-method.js +++ b/lib/sinon/util/core/wrap-method.js @@ -49,7 +49,7 @@ module.exports = function wrapMethod(object, property, method) { } } - var error, wrappedMethod, i; + var error, wrappedMethod, i, wrappedMethodDesc; function simplePropertyAssignment() { wrappedMethod = object[property]; @@ -64,7 +64,7 @@ module.exports = function wrapMethod(object, property, method) { if (hasES5Support) { var methodDesc = (typeof method === "function") ? {value: method} : method; - var wrappedMethodDesc = getPropertyDescriptor(object, property); + wrappedMethodDesc = getPropertyDescriptor(object, property); if (!wrappedMethodDesc) { error = new TypeError("Attempted to wrap " + (typeof wrappedMethod) + " property " + diff --git a/test/issues/issues-test.js b/test/issues/issues-test.js index 0997ae431..3b5854510 100644 --- a/test/issues/issues-test.js +++ b/test/issues/issues-test.js @@ -138,8 +138,10 @@ describe("issues", function () { } } + var oldWatch; + try { // eslint-disable-line no-restricted-syntax - var oldWatch = Object.prototype.watch; + oldWatch = Object.prototype.watch; if (typeof Object.prototype.watch !== "function") { Object.prototype.watch = function rolex() {}; // eslint-disable-line no-extend-native