Imports and eval
# Allen Wirfs-Brock (12 years ago)
No and no. In ES6 eval parses the using the Script grammar goal symbol. Imports are not allowed in scripts, but only in modules.
# Juan Ignacio Dopazo (12 years ago)
That answer made me very happy. Thank you Allen!
Import/export declarations are designed to be static. However, eval() seems to break this invariant:
eval('import ' + foo + ' from ' + bar);Is this valid ES6 code? Should it be valid?
Import/export declarations are designed to be static. However, eval() seems to break this invariant: eval('import ' + foo + ' from ' + bar); Is this valid ES6 code? Should it be valid? Juan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140602/0687656a/attachment.html>