From 3d2722cb3a8c8b4ee3ea43a136853519a93b29bf Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 3 Mar 2021 14:43:26 +0800 Subject: [PATCH] feat:use log to hint --- doric-js/bundle/doric-vm.js | 18 ++++++++++++++++-- doric-js/index.debug.ts | 12 ++++++++---- doric-js/lib/index.debug.js | 18 ++++++++++++++++-- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/doric-js/bundle/doric-vm.js b/doric-js/bundle/doric-vm.js index 4d3a422c..923e71be 100644 --- a/doric-js/bundle/doric-vm.js +++ b/doric-js/bundle/doric-vm.js @@ -4410,13 +4410,27 @@ global$1.nativeLog = (type, msg) => { } }; global$1.nativeRequire = () => { - console.error("Do not call nativeRequire here"); + console.error("nativeRequire", new Error().stack); + console.error("Do not call here in debugging"); return false; }; global$1.nativeBridge = () => { - console.error("Do not call nativeBridge here"); + console.error("nativeBridge", new Error().stack); + console.error("Do not call here in debugging"); return false; }; +global$1.Envrionment = new Proxy({}, { + get: (target, p, receiver) => { + console.error("Environment Getter", new Error().stack); + console.error("Do not call here in debugging"); + return undefined; + }, + set: (target, p, v, receiver) => { + console.error("Environment Setter", new Error().stack); + console.error("Do not call here in debugging"); + return Reflect.set(target, p, v, receiver); + } +}); exports.AnimationSet = AnimationSet; exports.BOTTOM = BOTTOM; diff --git a/doric-js/index.debug.ts b/doric-js/index.debug.ts index baac0869..1b6d9bf2 100644 --- a/doric-js/index.debug.ts +++ b/doric-js/index.debug.ts @@ -196,22 +196,26 @@ global.nativeLog = (type: string, msg: string) => { } global.nativeRequire = () => { - console.error("In debugger,do not support call nativeRequire here", new Error().stack); + console.error("nativeRequire", new Error().stack); + console.error("Do not call here in debugging"); return false; } global.nativeBridge = () => { - console.error("In debugger,do not support call nativeBridge here", new Error().stack); + console.error("nativeBridge", new Error().stack); + console.error("Do not call here in debugging"); return false; } global.Envrionment = new Proxy({}, { get: (target, p, receiver) => { - console.error("In debugger,do not support get Environment's value here", new Error().stack) + console.error("Environment Getter", new Error().stack); + console.error("Do not call here in debugging"); return undefined }, set: (target, p, v, receiver) => { - console.error("In debugger,do not support set Environment's value here", new Error().stack) + console.error("Environment Setter", new Error().stack) + console.error("Do not call here in debugging"); return Reflect.set(target, p, v, receiver); } }) diff --git a/doric-js/lib/index.debug.js b/doric-js/lib/index.debug.js index e04002cd..40290862 100644 --- a/doric-js/lib/index.debug.js +++ b/doric-js/lib/index.debug.js @@ -202,11 +202,25 @@ global.nativeLog = (type, msg) => { } }; global.nativeRequire = () => { - console.error("Do not call nativeRequire here"); + console.error("nativeRequire", new Error().stack); + console.error("Do not call here in debugging"); return false; }; global.nativeBridge = () => { - console.error("Do not call nativeBridge here"); + console.error("nativeBridge", new Error().stack); + console.error("Do not call here in debugging"); return false; }; +global.Envrionment = new Proxy({}, { + get: (target, p, receiver) => { + console.error("Environment Getter", new Error().stack); + console.error("Do not call here in debugging"); + return undefined; + }, + set: (target, p, v, receiver) => { + console.error("Environment Setter", new Error().stack); + console.error("Do not call here in debugging"); + return Reflect.set(target, p, v, receiver); + } +}); export * from './index';