replace system timer with doric timer when debug
This commit is contained in:
parent
8ee5d24912
commit
a8ffd31c8a
@ -3749,6 +3749,10 @@ let context = process.cwd() + '/build/context';
|
||||
const contextId = fs.readFileSync(context, { encoding: 'utf8' });
|
||||
console.log("debugging context id: " + contextId);
|
||||
let global$2 = new Function('return this')();
|
||||
global$2.setTimeout = global$2.doricSetTimeout;
|
||||
global$2.setInterval = global$2.doricSetInterval;
|
||||
global$2.clearTimeout = global$2.doricClearTimeout;
|
||||
global$2.clearInterval = global$2.doricClearInterval;
|
||||
global$2.doric = doric;
|
||||
global$2.context = jsObtainContext(contextId);
|
||||
global$2.Entry = jsObtainEntry(contextId);
|
||||
|
@ -15,12 +15,19 @@
|
||||
*/
|
||||
import * as doric from './src/runtime/sandbox'
|
||||
import * as WebSocket from 'ws'
|
||||
|
||||
const WebSocketClient = require('ws')
|
||||
const fs = require('fs')
|
||||
let context = process.cwd() + '/build/context'
|
||||
const contextId = fs.readFileSync(context, { encoding: 'utf8' })
|
||||
console.log("debugging context id: " + contextId)
|
||||
|
||||
let global = new Function('return this')()
|
||||
global.setTimeout = global.doricSetTimeout
|
||||
global.setInterval = global.doricSetInterval
|
||||
global.clearTimeout = global.doricClearTimeout
|
||||
global.clearInterval = global.doricClearInterval
|
||||
|
||||
global.doric = doric
|
||||
global.context = doric.jsObtainContext(contextId)
|
||||
global.Entry = doric.jsObtainEntry(contextId)
|
||||
|
@ -21,6 +21,10 @@ let context = process.cwd() + '/build/context';
|
||||
const contextId = fs.readFileSync(context, { encoding: 'utf8' });
|
||||
console.log("debugging context id: " + contextId);
|
||||
let global = new Function('return this')();
|
||||
global.setTimeout = global.doricSetTimeout;
|
||||
global.setInterval = global.doricSetInterval;
|
||||
global.clearTimeout = global.doricClearTimeout;
|
||||
global.clearInterval = global.doricClearInterval;
|
||||
global.doric = doric;
|
||||
global.context = doric.jsObtainContext(contextId);
|
||||
global.Entry = doric.jsObtainEntry(contextId);
|
||||
|
Reference in New Issue
Block a user