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
{{ message }}
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.
The module tests don't make sense. They will always fail, even in environments supporting ES6 modules:
import/export statements are allowed only in top-level scope so new Function('export var a = 1') will always fail.
import/export are only allowed in modules, not scripts; in browsers JS code will be able to be loaded as a module via <script type="module" src="path.js"><script>, in Node it's not fully clear yet. In any case, those tests will need to be run in a different way then every other one.
For import {a} from 'b' to not fail the environment needs to first be able to resolve the module 'b'.
To sum up, the tests in their current form don't really make any sense, they will always fail for multiple reasons so they should be removed.
The text was updated successfully, but these errors were encountered:
What I'm saying is that the current tests are only creating an illusion of
testing; you might as well hardcode false in their results as that's what's
effectively happening anyway.
Generic tests would require a standard way of loading JS code in module
mode.
If it turns out there is no way to parse modules inside non-modules, we may load a module to set the test to true. But I think eventually the tests will probably just infer module support by checking for the system loader API. For now it's a known issue.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The module tests don't make sense. They will always fail, even in environments supporting ES6 modules:
import
/export
statements are allowed only in top-level scope sonew Function('export var a = 1')
will always fail.import
/export
are only allowed in modules, not scripts; in browsers JS code will be able to be loaded as a module via<script type="module" src="path.js"><script>
, in Node it's not fully clear yet. In any case, those tests will need to be run in a different way then every other one.import {a} from 'b'
to not fail the environment needs to first be able to resolve the module'b'
.To sum up, the tests in their current form don't really make any sense, they will always fail for multiple reasons so they should be removed.
The text was updated successfully, but these errors were encountered: