add necessary function for worker envrionment

Signed-off-by: y00576111 <yaojian16@huawei.com>
Change-Id: I72e11ea7a3e3998fd3798e52642534046940edb8
This commit is contained in:
y00576111 2021-09-27 14:13:38 +08:00
parent e2f341bfcb
commit 6c3874cdb3

View File

@ -742,6 +742,12 @@ void JsiDeclarativeEngine::RegisterInitWorkerFunc()
return;
}
instance->InitConsoleModule(arkNativeEngine);
std::vector<uint8_t> buffer((uint8_t *)_binary_jsEnumStyle_abc_start, (uint8_t *)_binary_jsEnumStyle_abc_end);
auto stateMgmtResult = arkNativeEngine->RunBufferScript(buffer);
if (stateMgmtResult == nullptr) {
LOGE("init worker error");
}
};
OHOS::CCRuntime::Worker::WorkerCore::RegisterInitWorkerFunc(initWorkerFunc);
}