From 893d474e2e242e7ac13468651fa918109204633c Mon Sep 17 00:00:00 2001 From: ehmicky Date: Wed, 12 Jun 2019 10:00:00 +0200 Subject: [PATCH] Rename variable --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index d3f113c..4f22cec 100644 --- a/index.js +++ b/index.js @@ -13,14 +13,14 @@ const changePrototype = (to, from) => { const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\n${fromBody}`; -const toStringDescriptors = Object.getOwnPropertyDescriptor(Function.prototype, 'toString'); +const toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString'); const toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name'); const changeToString = (to, from, name) => { const withName = name === '' ? '' : `with ${name.trim()}() `; const newToString = wrappedToString.bind(null, withName, from.toString()); Object.defineProperty(newToString, 'name', toStringName); - Object.defineProperty(to, 'toString', {...toStringDescriptors, value: newToString}); + Object.defineProperty(to, 'toString', {...toStringDescriptor, value: newToString}); }; // If `to` has properties that `from` does not have, remove them