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

Add test for TLA DFS invariant #2989

Merged
merged 1 commit into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (C) 2021 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
await 0;
globalThis.test262 = 'async';
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (C) 2021 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
import './dfs-invariant-async_FIXTURE.js';
globalThis.test262 += ':direct-1';
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (C) 2021 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
import './dfs-invariant-async_FIXTURE.js';
globalThis.test262 += ':direct-2';
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (C) 2021 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
import './dfs-invariant-direct-1_FIXTURE.js';
globalThis.test262 += ':indirect';
40 changes: 40 additions & 0 deletions test/language/module-code/top-level-await/dfs-invariant.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (C) 2021 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Parent completion orderings match the synchronous module behavior
info: |
6.2.4 AsyncModuleExecutionFulfilled ( module )

[...]
5. Let _execList_ be a new empty List.
6. Perform ! GatherAsyncParentCompletions(_module_, _execList_).
7. Let _sortedExecList_ be a List of elements that are the elements of
_execList_, in the order in which they had their [[AsyncEvaluating]]
fields set to *true* in InnerModuleEvaluation.
8. Assert: All elements of _sortedExecList_ have their [[AsyncEvaluating]]
field set to *true*, [[PendingAsyncDependencies]] field set to 0 and
[[EvaluationError]] field set to *undefined*.
[...]

Dependency graph for this test:

dfs-invariant.js
.-----------------------------------+-------.
| | v
| | dfs-invariant-indirect_FIXTURE.js
| .---|----------------------'
v v v
dfs-invariant-direct-1_FIXTURE.js dfs-invariant-direct-2_FIXTURE.js
'--------. .--------'
v v
dfs-invariant-async_FIXTURE.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love when you make these <3

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                ,------------------. ->  @rwaldron  --.
@jugglinmike -> | dfs-invariant.js |                  +-> Test262
                '------------------' -> @guybedford --'

esid: sec-moduleevaluation
flags: [module]
features: [top-level-await, globalThis]
---*/

import './dfs-invariant-direct-1_FIXTURE.js';
import './dfs-invariant-direct-2_FIXTURE.js';
import './dfs-invariant-indirect_FIXTURE.js';

assert.sameValue(globalThis.test262, 'async:direct-1:direct-2:indirect');