apply suggestion and fix bug
This commit is contained in:
parent
3546632bbf
commit
5c7773c7bb
|
@ -23,9 +23,7 @@ if (IS_DEV || IS_REPORTER) {
|
||||||
var logger = new Logger("Tracer", "#FFD166");
|
var logger = new Logger("Tracer", "#FFD166");
|
||||||
}
|
}
|
||||||
|
|
||||||
const Noop = () => { };
|
export const beginTrace = !(IS_DEV || IS_REPORTER) ? () => { } :
|
||||||
|
|
||||||
export const beginTrace = !(IS_DEV || IS_REPORTER) ? Noop :
|
|
||||||
function beginTrace(name: string, ...args: any[]) {
|
function beginTrace(name: string, ...args: any[]) {
|
||||||
if (name in traces) {
|
if (name in traces) {
|
||||||
throw new Error(`Trace ${name} already exists!`);
|
throw new Error(`Trace ${name} already exists!`);
|
||||||
|
|
|
@ -115,7 +115,7 @@ export function proxyInner<T = any>(
|
||||||
|
|
||||||
// Avoid binding toString if the inner value is null.
|
// 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
|
// 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);
|
proxy.toString = innerValue.toString.bind(innerValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue