Skip to content

m.[[CycleRoot]] can be null in GatherAvailableAncestors #3766

@allstarschh

Description

@allstarschh
// main.js
import {} from from "./tla.js";
import {} from from "./throw.js';

// tla.js
await 1;

// throw.js
throw 1;

Evaluate(main.js)

  1. InnerModuleEvaluation(main.js)
    1. InnerModuleEvaluation(tla.js)
      1. module(tla.js).[[AsyncEvaluationOrder]] += 1
      2. add module(main.js) to module(tla.js).[[AsyncParentModules]]
    2. InnerModuleEvalation(throw.js)
      1. module(throw.js).ExecuteModule() // throws
      2. returns Abrupt completion
  2. Exit InnerModuleEvaluation(main.js) with abrupt completion

as of now, the module(main.js).[[CycleRoot]] is still null as InnerModuleEvaluation(main.js) exits abnormally.

Then

  1. AsyncModuleExecutionFulfilled(tla.js)
  2. GatherAvailableAncestors(tla.js)
  3. for each m in module.[[AsyncParentModules]] // main.js
  4. access m.[[CycleRoot]] --> still null

GatherAvailableAncestors

Step 1.a. If execList does not contain m and m.[[CycleRoot]].[[EvaluationError]] is empty

Both Spidermonkey and V8 have fixed this in their implementations
SM fix

V8 fix

CCing @nicolo-ribaudo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions