You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Testing in Chrome 80, the promise gets rejected with an Error: Cannot import module from an inactive browsing context. but it's possible that may vary depending on JS engine and/or iframe sandbox attribute support.
Dynamic import() works via a "function-like" keyword, not an actual call to a built-in function (e.g. it's like if or catch, rather than like eval or isNaN). We are unable to block keywords through shadowing (i.e. Function('import', "") throws just like var yield = return; would).
Evel'ing this successfully returns a Promise:
Testing in Chrome 80, the promise gets rejected with an
Error: Cannot import module from an inactive browsing context.
but it's possible that may vary depending on JS engine and/or iframe sandbox attribute support.Dynamic
import()
works via a "function-like" keyword, not an actual call to a built-in function (e.g. it's likeif
orcatch
, rather than likeeval
orisNaN
). We are unable to block keywords through shadowing (i.e.Function('import', "")
throws just likevar yield = return;
would).Even the Agoric/realms-shim ends up having to munge incoming source on account of this very issue: https://github.com/Agoric/realms-shim/blob/025d975da12c8033022c271e5d99a3810066dfa4/src/sourceParser.js#L31
The text was updated successfully, but these errors were encountered: