feat:fix debugger error when call context before connect to device
This commit is contained in:
@@ -147,6 +147,7 @@ function initNativeEnvironment(source) {
|
||||
});
|
||||
});
|
||||
}
|
||||
global.context = doric.jsObtainContext("FakeContext");
|
||||
const entryHooks = [];
|
||||
global.Entry = function () {
|
||||
var _a, _b, _c;
|
||||
@@ -168,7 +169,9 @@ global.Entry = function () {
|
||||
initNativeEnvironment(source).then(ret => {
|
||||
contextId = ret;
|
||||
console.log("debugging context id: " + contextId);
|
||||
global.context = doric.jsObtainContext(contextId);
|
||||
const realContext = doric.jsObtainContext(contextId);
|
||||
global.context.id = contextId;
|
||||
global.context = realContext;
|
||||
entryHooks.forEach(e => e(contextId));
|
||||
});
|
||||
return arguments[0];
|
||||
@@ -198,4 +201,10 @@ global.nativeLog = (type, msg) => {
|
||||
}
|
||||
}
|
||||
};
|
||||
global.nativeRequire = () => {
|
||||
console.error("Do not call nativeRequire here");
|
||||
};
|
||||
global.nativeBridge = () => {
|
||||
console.error("Do not call nativeBridge here");
|
||||
};
|
||||
export * from './index';
|
||||
|
Reference in New Issue
Block a user