feat:fix debugger error when call context before connect to device

This commit is contained in:
pengfei.zhou
2021-03-02 18:19:35 +08:00
committed by osborn
parent 1af0600001
commit f22e0ccf9a
3 changed files with 35 additions and 3 deletions

View File

@@ -4347,6 +4347,7 @@ function initNativeEnvironment(source) {
});
});
}
global$1.context = jsObtainContext("FakeContext");
const entryHooks = [];
global$1.Entry = function () {
var _a, _b, _c;
@@ -4368,7 +4369,9 @@ global$1.Entry = function () {
initNativeEnvironment(source).then(ret => {
contextId = ret;
console.log("debugging context id: " + contextId);
global$1.context = jsObtainContext(contextId);
const realContext = jsObtainContext(contextId);
global$1.context.id = contextId;
global$1.context = realContext;
entryHooks.forEach(e => e(contextId));
});
return arguments[0];
@@ -4398,6 +4401,12 @@ global$1.nativeLog = (type, msg) => {
}
}
};
global$1.nativeRequire = () => {
console.error("Do not call nativeRequire here");
};
global$1.nativeBridge = () => {
console.error("Do not call nativeBridge here");
};
exports.AnimationSet = AnimationSet;
exports.BOTTOM = BOTTOM;