Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import defer test bugs #4416

Open
woess opened this issue Mar 4, 2025 · 2 comments
Open

import defer test bugs #4416

woess opened this issue Mar 4, 2025 · 2 comments
Assignees

Comments

@woess
Copy link
Contributor

woess commented Mar 4, 2025

While implementing support for import defer, I think I've found the following bugs in the import-defer tests:

  1. language/import/import-defer/evaluation-top-level-await/flattening-order/main.js:
    The test expects "5" twice. I don't see how that could happen, the second (last) "5" should be removed:
  2. language/import/import-defer/errors/get-self-while-defer-evaluating/main.js:
    I don't see how the assertion can pass before the evaluation trigger (ns.foo). The lines probably just need to be swapped?
    import defer * as ns from "./dep_FIXTURE.js";
    assert(globalThis["error on ns.foo"] instanceof TypeError, "ns.foo while evaluating throws a TypeError");
    ns.foo;
  3. language/import/import-defer/errors/module-throws/defer-import-after-evaluation.js:
    In order for assert.sameValue(err1, err2) to be pass, both imported modules need to produce the same error (they don't). So I guess the import in import-defer-throws_FIXTURE.js was supposed to import throws_FIXTURE.js rather than itself, i.e.:
-import defer * as ns from "./import-defer-throws_FIXTURE.js";
+import defer * as ns from "./throws_FIXTURE.js";
  1. language/import/import-defer/deferred-namespace-object/exotic-object-behavior.js:
    verifyProperty(ns, "foo", {
    value: 1,
    writable: true,
    enumerable: true,
    configurable: false,
    });

    This one's tricky: While the test is technically verifying the correct thing, I believe verifyProperty cannot be used in this case because it not only checks the property descriptor but also tries to verify actual writability by setting a new value, but module namespace exotic object properties aren't truly writable in the sense that writes (aka [[Set]], [[DefineOwnProperty]]) don't have any effect/don't succeed.
@nicolo-ribaudo
Copy link
Member

Thank you! All of these seem like bugs indeed.

@takikawa Given that you were running these tests in WebKit, did you happen to find these bugs too?

@nicolo-ribaudo nicolo-ribaudo self-assigned this Mar 4, 2025
@takikawa
Copy link
Contributor

takikawa commented Mar 9, 2025

@nicolo-ribaudo These all did fail on WebKit too (and are currently set to expected fail), but I think at least for 1 & 3 it's because it was masked by other bugs in WebKit module loading.

For 2 & 4 I think I just didn't catch the bugs, for 2 it does pass after making the proposed change. I can test 4 if there's a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants