mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 21:14:28 -08:00
rename run_window -> app_window
This commit is contained in:
8
src/effects.js
vendored
8
src/effects.js
vendored
@@ -9,10 +9,10 @@ import {
|
||||
import {current_cursor_position} from './calltree.js'
|
||||
import {exec, FILES_ROOT} from './index.js'
|
||||
|
||||
// Imports in the context of `run_window`, so global variables in loaded
|
||||
// Imports in the context of `app_window`, so global variables in loaded
|
||||
// modules refer to that window's context
|
||||
const import_in_run_window = url => {
|
||||
return new globalThis.run_window.Function('url', `
|
||||
const import_in_app_window = url => {
|
||||
return new globalThis.app_window.Function('url', `
|
||||
return import(url)
|
||||
`)(url)
|
||||
}
|
||||
@@ -23,7 +23,7 @@ const load_external_imports = async state => {
|
||||
}
|
||||
const urls = state.loading_external_imports_state.external_imports
|
||||
const results = await Promise.allSettled(
|
||||
urls.map(u => import_in_run_window(
|
||||
urls.map(u => import_in_app_window(
|
||||
/^\w+:\/\//.test(u)
|
||||
? // starts with protocol, import as is
|
||||
u
|
||||
|
||||
Reference in New Issue
Block a user