From b3e847b46a7c34a553b9c3f2649688839ba0b220 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Sat, 15 Aug 2020 13:48:14 -0400 Subject: [PATCH] autofix --- src/004-base/000-proxies.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/004-base/000-proxies.js b/src/004-base/000-proxies.js index d28b2503a69..5d9da3f6190 100644 --- a/src/004-base/000-proxies.js +++ b/src/004-base/000-proxies.js @@ -1,7 +1,7 @@ (function() { const readOnlySymbol = Symbol("readonly proxy"); globalThis.createReadonlyProxy = function(target) { - if (target == null) return target; //intentionally == + if (target == null) { return target; } // intentionally == if (target[readOnlySymbol]) { return target; } if (_.isArray(target)) { return new Proxy(target, { @@ -10,9 +10,9 @@ const val = o[prop]; if (typeof val === 'function') { if (['push', 'unshift', 'pop'].includes(prop)) { - return function () { + return function() { throw Error("Cannot modify a readonly array"); - } + }; } return val.bind(target); } @@ -44,7 +44,7 @@ }; const cheaterSymbol = Symbol("cheating proxy"); globalThis.createCheatProxy = function(target) { - if (target == null) return target; //intentionally == + if (target == null) { return target; } // intentionally == if (target[cheaterSymbol]) { return target; } if (_.isArray(target)) { return new Proxy(target, { @@ -53,12 +53,12 @@ const val = o[prop]; if (typeof val === 'function') { if (['push', 'unshift', 'pop'].includes(prop)) { - return function (el) { + return function(el) { const retval = Array.prototype[prop].apply(o, arguments); - //Make sure we set cheater after calling the function - State.variables.cheater = 1;//Can't use `V` because it probably points to a proxy. + // Make sure we set cheater after calling the function + State.variables.cheater = 1;// Can't use `V` because it probably points to a proxy. return retval; - } + }; } return val.bind(target); } @@ -66,12 +66,12 @@ }, set:function(o, prop, value) { o[prop] = value; - State.variables.cheater = 1;//Can't use `V` because it probably points to a proxy. + State.variables.cheater = 1;// Can't use `V` because it probably points to a proxy. return true; }, deleteProperty:function(o, prop) { delete o[prop]; - State.variables.cheater = 1;//Can't use `V` because it probably points to a proxy. + State.variables.cheater = 1;// Can't use `V` because it probably points to a proxy. return true; } }); -- GitLab