diff --git a/src/eval.js b/src/eval.js index a20794d..3c72665 100644 --- a/src/eval.js +++ b/src/eval.js @@ -14,9 +14,6 @@ import { import {has_toplevel_await} from './find_definitions.js' -// external -import {patch_promise} from './patch_promise.js' - // TODO: fix error messages. For example, "__fn is not a function" /* @@ -399,12 +396,7 @@ export const eval_modules = ( } const set_promise_status = value => { - // TODO refactor, put is_status_requested inside status if(value instanceof Promise) { - if(value.is_status_requested) { - return value - } - value.is_status_requested = true // record stack for async calls, so expand calls works sync set_record_call() // TODO why we set status for wrapped value and not for wrapper? @@ -431,8 +423,7 @@ export const eval_modules = ( children = [] } const children_copy = children - if(value instanceof Promise && !value.is_status_requested) { - value.is_status_requested = true + if(value instanceof Promise) { value.then( v => { value.status = {ok: true, value: v} diff --git a/test/self_hosted_test.js b/test/self_hosted_test.js index 3593c03..aa30261 100644 --- a/test/self_hosted_test.js +++ b/test/self_hosted_test.js @@ -45,6 +45,7 @@ const adjust_path = path => { ) } +/* const load_external_modules = async state => { const urls = state.loading_external_imports_state.external_imports const results = await Promise.all( @@ -62,6 +63,7 @@ const load_external_modules = async state => { )) ) } +*/ const dir = load_dir('.') @@ -71,10 +73,14 @@ const i = test_initial_state( {}, // files {project_dir: dir, entrypoint: 'test/run.js'} ) -assert_equal(i.loading_external_imports_state != null, true) +/* +assert_equal(i.loading_external_imports_state != null, true) const external_imports = await load_external_modules(i) const loaded = COMMANDS.external_imports_loaded(i, i, external_imports) +*/ + +const loaded = i assert_equal(loaded.eval_modules_state != null, true) const s = loaded.eval_modules_state