debug context id acquire from file

This commit is contained in:
王劲鹏 2019-11-22 16:33:59 +08:00
parent 2ecde80fbd
commit a4d5eb770f

View File

@ -16,10 +16,12 @@
import * as doric from './src/runtime/sandbox' import * as doric from './src/runtime/sandbox'
import * as WebSocket from 'ws' import * as WebSocket from 'ws'
const WebSocketClient = require('ws') const WebSocketClient = require('ws')
const fs = require('fs')
let context = process.cwd() + '/build/context'
const contextId = fs.readFileSync(context, { encoding: 'utf8' })
console.log(contextId)
let global = new Function('return this')() let global = new Function('return this')()
global.doric = doric global.doric = doric
const contextId = "1"
global.context = doric.jsObtainContext(contextId) global.context = doric.jsObtainContext(contextId)
global.Entry = doric.jsObtainEntry(contextId) global.Entry = doric.jsObtainEntry(contextId)