mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 08:51:20 -08:00
test(dpip): [PKG-DPIP-02] reproduce window races and DOM rollback failures
This commit is contained in:
1 parent
efbbdb4782
commit
202351934b
13 files changed
+574
-13
No files matched your search
@@ -188,7 +188,7 @@ export function dpipEnvironment(implementation, settings = {}) {
|
||||
}
|
||||
const context = vm.createContext({ window, document, console: { warn: (...args) => warnings.push(args) }, module: { exports: {} } })
|
||||
context.exports = context.module.exports
|
||||
const evaluate = () => vm.runInContext(implementation.code, context, { timeout: 5000 })
|
||||
const evaluate = () => vm.runInContext(`(() => { ${implementation.code}\n })()`, context, { timeout: 5000 })
|
||||
evaluate()
|
||||
return {
|
||||
factory: context.module.exports.default || context.module.exports,
|
||||
|
||||
Reference in new issue
Block a user