-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[top-level-await] Implement spec fix for cycle root detection
There is a bug in the top-level await spec draft such that async strongly connected components are not always evaluated before their depending modules. See tc39/proposal-top-level-await#161 for full discussion and spec fix. Bug: v8:11376 Change-Id: I88bf06afb2e9a5d8d0b757de8276f1d1242a875e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2667772 Reviewed-by: Adam Klein <adamk@chromium.org> Reviewed-by: Camillo Bruni <cbruni@chromium.org> Commit-Queue: Shu-yu Guo <syg@chromium.org> Cr-Commit-Position: refs/heads/master@{#72508}
- Loading branch information
Showing
12 changed files
with
108 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
test/mjsunit/harmony/modules-import-rqstd-order-async-cycle.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright 2021 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// Flags: --harmony-top-level-await | ||
|
||
import "modules-skip-async-cycle-start.mjs" | ||
|
||
assertEquals(globalThis.test_order, [ | ||
'2', 'async before', 'async after', '1', | ||
'3', 'start', | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright 2021 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// Flags: --harmony-top-level-await | ||
|
||
import "modules-skip-async-cycle-2.mjs"; | ||
import "modules-skip-async-cycle-leaf.mjs"; | ||
|
||
if (globalThis.test_order === undefined) { | ||
globalThis.test_order = []; | ||
} | ||
globalThis.test_order.push('1'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright 2021 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// Flags: --harmony-top-level-await | ||
|
||
import "modules-skip-async-cycle-1.mjs"; | ||
|
||
if (globalThis.test_order === undefined) { | ||
globalThis.test_order = []; | ||
} | ||
globalThis.test_order.push('2'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright 2021 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// Flags: --harmony-top-level-await | ||
|
||
import "modules-skip-async-cycle-2.mjs"; | ||
|
||
if (globalThis.test_order === undefined) { | ||
globalThis.test_order = []; | ||
} | ||
globalThis.test_order.push('3'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright 2021 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// Flags: --harmony-top-level-await | ||
|
||
if (globalThis.test_order === undefined) { | ||
globalThis.test_order = []; | ||
} | ||
|
||
globalThis.test_order.push('async before'); | ||
await 0; | ||
globalThis.test_order.push('async after'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright 2021 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// Flags: --harmony-top-level-await | ||
|
||
import "modules-skip-async-cycle-1.mjs"; | ||
import "modules-skip-async-cycle-3.mjs"; | ||
|
||
if (globalThis.test_order === undefined) { | ||
globalThis.test_order = []; | ||
} | ||
globalThis.test_order.push('start'); |