From 2a16350c2bae9a8eb70667042ff511130332a3d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Sat, 18 Jan 2020 11:46:07 +0800 Subject: [PATCH] inject global environment --- doric-js/bundle/doric-vm.js | 8 ++++++++ doric-js/index.debug.ts | 9 +++++++++ doric-js/lib/index.debug.js | 8 ++++++++ 3 files changed, 25 insertions(+) diff --git a/doric-js/bundle/doric-vm.js b/doric-js/bundle/doric-vm.js index 1499ef3c..9c7a66e3 100644 --- a/doric-js/bundle/doric-vm.js +++ b/doric-js/bundle/doric-vm.js @@ -3752,6 +3752,14 @@ let global$2 = new Function('return this')(); global$2.doric = doric; global$2.context = jsObtainContext(contextId); global$2.Entry = jsObtainEntry(contextId); +global$2.Environment = { + 'platform': 'debugger', + 'platformVersion': '1.0', + 'appName': '', + 'appVersion': '', + 'screenWidth': 0, + 'screenHeight': 0 +}; // dev kit client const devClient = new WebSocketClient('ws://localhost:7777'); devClient.on('open', function open() { diff --git a/doric-js/index.debug.ts b/doric-js/index.debug.ts index 71efb893..f971f09b 100644 --- a/doric-js/index.debug.ts +++ b/doric-js/index.debug.ts @@ -25,6 +25,15 @@ global.doric = doric global.context = doric.jsObtainContext(contextId) global.Entry = doric.jsObtainEntry(contextId) +global.Environment = { + 'platform': 'debugger', + 'platformVersion': '1.0', + 'appName': '', + 'appVersion': '', + 'screenWidth': 0, + 'screenHeight': 0 +} + // dev kit client const devClient = new WebSocketClient('ws://localhost:7777') devClient.on('open', function open() { diff --git a/doric-js/lib/index.debug.js b/doric-js/lib/index.debug.js index 09ce236b..0fd07a04 100644 --- a/doric-js/lib/index.debug.js +++ b/doric-js/lib/index.debug.js @@ -24,6 +24,14 @@ let global = new Function('return this')(); global.doric = doric; global.context = doric.jsObtainContext(contextId); global.Entry = doric.jsObtainEntry(contextId); +global.Environment = { + 'platform': 'debugger', + 'platformVersion': '1.0', + 'appName': '', + 'appVersion': '', + 'screenWidth': 0, + 'screenHeight': 0 +}; // dev kit client const devClient = new WebSocketClient('ws://localhost:7777'); devClient.on('open', function open() {