mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 21:14:28 -08:00
WIP
This commit is contained in:
@@ -26,8 +26,6 @@ const io_patch = (path, use_context = false) => {
|
||||
|
||||
const original = obj[method]
|
||||
obj[method] = function(...args) {
|
||||
|
||||
// TODO does it work? After we change for global cxt? Review all cxt usages
|
||||
if(cxt.io_cache_is_replay_aborted) {
|
||||
// Try to finish fast
|
||||
// TODO invoke callback to notify that code must be restarted?
|
||||
@@ -217,8 +215,6 @@ const io_patch = (path, use_context = false) => {
|
||||
obj[method].__original = original
|
||||
}
|
||||
|
||||
// TODO bare IO functions should not be exposed at all, to allow calling it
|
||||
// only from patched versions. Especially setInterval which can cause leaks
|
||||
export const apply_io_patches = () => {
|
||||
// TODO remove, only for dev
|
||||
// TODO test open_run_window
|
||||
@@ -235,7 +231,6 @@ export const apply_io_patches = () => {
|
||||
// replaying from cache
|
||||
io_patch(['clearTimeout'])
|
||||
|
||||
|
||||
// TODO patch setInterval to only cleanup all intervals on finish
|
||||
|
||||
const Date = cxt.window.Date
|
||||
|
||||
@@ -96,10 +96,6 @@ const do_run = function*(module_fns, cxt, io_cache){
|
||||
}
|
||||
|
||||
export const run = gen_to_promise(function*(module_fns, cxt, io_cache) {
|
||||
if(cxt.window != globalThis) {
|
||||
// TODO refactor, remove cxt.window
|
||||
throw new Error('illegal state')
|
||||
}
|
||||
const result = yield* do_run(module_fns, cxt, io_cache)
|
||||
|
||||
if(result.eval_cxt.io_cache_is_replay_aborted) {
|
||||
|
||||
Reference in New Issue
Block a user