From 5c7773c7bb99cea0dbb8776f9a32da3c088a1a93 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sun, 18 Aug 2024 17:00:34 -0300 Subject: [PATCH] apply suggestion and fix bug --- src/debug/Tracer.ts | 4 +--- src/utils/proxyInner.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/debug/Tracer.ts b/src/debug/Tracer.ts index be65cd54b..37ea4cc05 100644 --- a/src/debug/Tracer.ts +++ b/src/debug/Tracer.ts @@ -23,9 +23,7 @@ if (IS_DEV || IS_REPORTER) { var logger = new Logger("Tracer", "#FFD166"); } -const Noop = () => { }; - -export const beginTrace = !(IS_DEV || IS_REPORTER) ? Noop : +export const beginTrace = !(IS_DEV || IS_REPORTER) ? () => { } : function beginTrace(name: string, ...args: any[]) { if (name in traces) { throw new Error(`Trace ${name} already exists!`); diff --git a/src/utils/proxyInner.ts b/src/utils/proxyInner.ts index fdb7dda57..90576d1b0 100644 --- a/src/utils/proxyInner.ts +++ b/src/utils/proxyInner.ts @@ -115,7 +115,7 @@ export function proxyInner( // Avoid binding toString if the inner value is null. // This can happen if we are setting the inner value as another instance of proxyInner, which will cause that proxy to instantly evaluate and throw an error - if (typeof innerValue === "function" && innerValue[SYM_PROXY_INNER_VALUE] == null) { + if (typeof innerValue === "function" && innerValue[SYM_PROXY_INNER_VALUE] != null) { proxy.toString = innerValue.toString.bind(innerValue); } }