(script: ScriptRunResource)
| 319 | } |
| 320 | |
| 321 | async runScript(script: ScriptRunResource) { |
| 322 | const exec = this.execScriptMap.get(script.uuid); |
| 323 | // 如果正在运行,先释放 |
| 324 | if (exec) { |
| 325 | await this.stopScript(script.uuid); |
| 326 | } |
| 327 | const metadataStr = getMetadataStr(script.code) || ""; |
| 328 | const userConfigStr = getUserConfigStr(script.code) || ""; |
| 329 | const userConfig = parseUserConfig(userConfigStr); |
| 330 | const loadScript = { |
| 331 | ...script, |
| 332 | metadataStr, |
| 333 | userConfigStr, |
| 334 | userConfig, |
| 335 | } as ScriptLoadInfo; |
| 336 | return this.execScript(loadScript, { execOnce: true }); |
| 337 | } |
| 338 | |
| 339 | valueUpdate(data: ValueUpdateDataEncoded) { |
| 340 | // runtime/valueUpdate |
no test coverage detected