From 4a95bf74b033b049dc88e0135cd461402cf98b3b Mon Sep 17 00:00:00 2001 From: nim-ka Date: Wed, 29 Dec 2021 23:52:48 -0500 Subject: [PATCH] . --- out.js | 6 ++++-- proto.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/out.js b/out.js index 5f4cef8..89dfa06 100644 --- a/out.js +++ b/out.js @@ -601,6 +601,8 @@ class Node { } } +let warned = false + Object.defineProperty(Object.prototype, "copyDeep", { value: function() { return JSON.parse(JSON.stringify(this)) @@ -686,9 +688,9 @@ Object.defineProperties(Array.prototype, { }, pushUniq: { value: function(...vals) { - if (!this.warned) { + if (!warned) { console.warn("You should probably use a Set") - this.warned = true + warned = true } return this.push(...vals.uniq().sub(this)) diff --git a/proto.js b/proto.js index 0f3310b..0522dc8 100644 --- a/proto.js +++ b/proto.js @@ -1,3 +1,5 @@ +let warned = false + Object.defineProperty(Object.prototype, "copyDeep", { value: function() { return JSON.parse(JSON.stringify(this)) @@ -83,9 +85,9 @@ Object.defineProperties(Array.prototype, { }, pushUniq: { value: function(...vals) { - if (!this.warned) { + if (!warned) { console.warn("You should probably use a Set") - this.warned = true + warned = true } return this.push(...vals.uniq().sub(this))