收紧移动事件注入边界
要求 Expo 壳事件注入先校验共享 HostBridge 事件名 保留统一 message script 的 origin 和 source 约束 同步移动壳事件注入边界记录
This commit is contained in:
@@ -1110,7 +1110,13 @@ for (const snippet of [
|
||||
|
||||
for (const snippet of [
|
||||
'type HostBridgeEventName',
|
||||
'isHostBridgeEventName',
|
||||
'function buildHostBridgeEventScript(event: HostBridgeEventName, payload: unknown)',
|
||||
'if (!isHostBridgeEventName(event))',
|
||||
'throw new Error(`unsupported HostBridge event ${event}`)',
|
||||
'return buildHostBridgeMessageScript({',
|
||||
'(event: HostBridgeEventName, payload: unknown)',
|
||||
'buildHostBridgeEventScript(event, payload)',
|
||||
]) {
|
||||
if (!shellAppSource.includes(snippet)) {
|
||||
throw new Error(`mobile shell HostBridge event injection missing ${snippet}`);
|
||||
|
||||
Reference in New Issue
Block a user