From 3c218ecc53aa9113baecc87da7ec4eb454978d17 Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Tue, 27 Feb 2024 14:00:32 +0000 Subject: [PATCH] [dart2wasm] Work around V8/Chrome bug that swallows exceptions from `rethrow`s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue https://g-issues.chromium.org/issues/327155548 Change-Id: I7babc0bcfad3e4351af08ce3accb61db6260d86b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354227 Reviewed-by: Ömer Ağacan Reviewed-by: William Hesse --- sdk/lib/_internal/wasm/lib/internal_patch.dart | 14 ++++++++++++-- tests/co19/co19-dart2wasm.status | 11 ----------- tests/language/language_dart2wasm.status | 11 ----------- 3 files changed, 12 insertions(+), 24 deletions(-) diff --git a/sdk/lib/_internal/wasm/lib/internal_patch.dart b/sdk/lib/_internal/wasm/lib/internal_patch.dart index 967a0be3a69..15e955957a3 100644 --- a/sdk/lib/_internal/wasm/lib/internal_patch.dart +++ b/sdk/lib/_internal/wasm/lib/internal_patch.dart @@ -92,7 +92,12 @@ void _invokeCallback(void Function() callback) { } catch (e, s) { print(e); print(s); - rethrow; + // FIXME: Chrome/V8 bug makes errors from `rethrow`s not being reported to + // `window.onerror`. Please change this back to `rethrow` once the chrome + // bug is fixed. + // + // https://g-issues.chromium.org/issues/327155548 + throw e; } } @@ -103,7 +108,12 @@ void _invokeCallback1(void Function(dynamic) callback, dynamic arg) { } catch (e, s) { print(e); print(s); - rethrow; + // FIXME: Chrome/V8 bug makes errors from `rethrow`s not being reported to + // `window.onerror`. Please change this back to `rethrow` once the chrome + // bug is fixed. + // + // https://g-issues.chromium.org/issues/327155548 + throw e; } } diff --git a/tests/co19/co19-dart2wasm.status b/tests/co19/co19-dart2wasm.status index afc7e0783c4..73cfa1f467a 100644 --- a/tests/co19/co19-dart2wasm.status +++ b/tests/co19/co19-dart2wasm.status @@ -16,18 +16,7 @@ LibTest/isolate/*: SkipByDesign # dart:isolate is not supported. LibTest/mirrors/*: SkipByDesign # dart:mirrors is not supported. [ $compiler == dart2wasm && $runtime == chrome ] -Language/Expressions/Function_Invocation/async_generator_invokation_t04: SkipSlow # Issue(http://dartbug.com/55025) -Language/Expressions/Function_Invocation/async_generator_invokation_t08: SkipSlow # Issue(http://dartbug.com/55025) Language/Expressions/Function_Invocation/async_generator_invokation_t10: SkipSlow # Issue(http://dartbug.com/55025) -Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A01_t07: SkipSlow # Issue(http://dartbug.com/55025) -Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A03_t04: SkipSlow # Issue(http://dartbug.com/55025) -Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A03_t05: SkipSlow # Issue(http://dartbug.com/55025) Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_A03_t03: SkipSlow # Issue(http://dartbug.com/55025) Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_A03_t07: SkipSlow # Issue(http://dartbug.com/55025) -Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_A03_t08: SkipSlow # Issue(http://dartbug.com/55025) -Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_A03_t09: SkipSlow # Issue(http://dartbug.com/55025) Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_A03_t11: SkipSlow # Issue(http://dartbug.com/55025) -Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_A03_t12: SkipSlow # Issue(http://dartbug.com/55025) -Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_A03_t14: SkipSlow # Issue(http://dartbug.com/55025) -Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_A03_t15: SkipSlow # Issue(http://dartbug.com/55025) -Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_A03_t16: SkipSlow # Issue(http://dartbug.com/55025) diff --git a/tests/language/language_dart2wasm.status b/tests/language/language_dart2wasm.status index a0216d2141e..7918e2c2dc5 100644 --- a/tests/language/language_dart2wasm.status +++ b/tests/language/language_dart2wasm.status @@ -9,17 +9,6 @@ number/web_int_literals_test: SkipByDesign # WASM has real integers. vm/*: SkipByDesign # Tests for the VM. [ $compiler == dart2wasm && $runtime == chrome ] -async_star/async_star_await_for_test: SkipSlow # Issue(http://dartbug.com/55025) -async_star/async_star_cancel_test: SkipSlow # Issue(http://dartbug.com/55025) -async_star/async_star_invalid_test/03: SkipSlow # Issue(http://dartbug.com/55025) -async_star/async_star_test: SkipSlow # Issue(http://dartbug.com/55025) -async_star/cancel_and_throw_in_finally_test: SkipSlow # Issue(http://dartbug.com/55025) -async_star/cancel_test: SkipSlow # Issue(http://dartbug.com/55025) -async_star/error_test: SkipSlow # Issue(http://dartbug.com/55025) -async_star/no_cancel2_test: SkipSlow # Issue(http://dartbug.com/55025) -async_star/no_cancel_test: SkipSlow # Issue(http://dartbug.com/55025) -async_star/regression_fisk_test: SkipSlow # Issue(http://dartbug.com/55025) -async_star/throw_in_catch_test: SkipSlow # Issue(http://dartbug.com/55025) async_star/yield_test: SkipSlow # Issue(http://dartbug.com/55025) async_star/yieldstar_test: SkipSlow # Issue(http://dartbug.com/55025)