(bundle)
| 52 | } |
| 53 | |
| 54 | function createNativeContractScript(bundle) { |
| 55 | return ` |
| 56 | const done = arguments[arguments.length - 1]; |
| 57 | const platformMap = globalThis.Observable.prototype.map; |
| 58 | ${bundle} |
| 59 | const runContract = (${runExtensionKernelContract.toString()}); |
| 60 | const expectedCases = ${JSON.stringify(extensionKernelCaseNames)}; |
| 61 | |
| 62 | void runContract({ |
| 63 | ObservableCtor: globalThis.Observable, |
| 64 | platformMap, |
| 65 | symbols: globalThis.__rxjsExtensionKernelPilot, |
| 66 | }).then( |
| 67 | (completedCases) => { |
| 68 | try { |
| 69 | if (globalThis.Observable[Symbol.for('rxjs.observable.polyfill.info.v1')] !== undefined) { |
| 70 | throw new Error('The native kernel mode selected an RxJS-marked fallback'); |
| 71 | } |
| 72 | if (JSON.stringify(completedCases) !== JSON.stringify(expectedCases)) { |
| 73 | throw new Error('The native kernel mode did not complete every case'); |
| 74 | } |
| 75 | done({ completedCases, constructorName: globalThis.Observable.name, markedAsRxjsFallback: false }); |
| 76 | } catch (error) { |
| 77 | done({ error: error?.stack ?? String(error) }); |
| 78 | } |
| 79 | }, |
| 80 | (error) => done({ error: error?.stack ?? String(error) }) |
| 81 | ); |
| 82 | `; |
| 83 | } |
| 84 | |
| 85 | async function runNativeContract() { |
| 86 | const [config, browserLock, bundle] = await Promise.all([readConfig(), readBrowserLock(), buildBrowserBundle()]); |
no test coverage detected