[L] Change in dart/sdk[main]: [dart2wasm] Update JS exception catching

0 views
Skip to first unread message

Ömer Ağacan (Gerrit)

unread,
Feb 11, 2026, 4:42:06 AM (5 days ago) Feb 11
to Martin Kustermann, Srujan Gaddam, Nate Biggs, Commit Queue, dart2wasm-t...@google.com, rev...@dartlang.org
Attention needed from Martin Kustermann, Nate Biggs and Srujan Gaddam

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Martin Kustermann
  • Nate Biggs
  • Srujan Gaddam
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I23e73074729f740b90df2ca8b3c713fb39966556
Gerrit-Change-Number: 479640
Gerrit-PatchSet: 9
Gerrit-Owner: Ömer Ağacan <ome...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Nate Biggs <nate...@google.com>
Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
Gerrit-Reviewer: Ömer Ağacan <ome...@google.com>
Gerrit-Attention: Martin Kustermann <kuste...@google.com>
Gerrit-Attention: Nate Biggs <nate...@google.com>
Gerrit-Attention: Srujan Gaddam <sru...@google.com>
Gerrit-Comment-Date: Wed, 11 Feb 2026 09:42:01 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Nate Biggs (Gerrit)

unread,
Feb 11, 2026, 12:57:55 PM (5 days ago) Feb 11
to Ömer Ağacan, Martin Kustermann, Srujan Gaddam, Commit Queue, dart2wasm-t...@google.com, rev...@dartlang.org
Attention needed from Martin Kustermann, Srujan Gaddam and Ömer Ağacan

Nate Biggs voted and added 1 comment

Votes added by Nate Biggs

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Nate Biggs . resolved

Looks good, thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Martin Kustermann
  • Srujan Gaddam
  • Ömer Ağacan
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I23e73074729f740b90df2ca8b3c713fb39966556
Gerrit-Change-Number: 479640
Gerrit-PatchSet: 9
Gerrit-Owner: Ömer Ağacan <ome...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Nate Biggs <nate...@google.com>
Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
Gerrit-Reviewer: Ömer Ağacan <ome...@google.com>
Gerrit-Attention: Ömer Ağacan <ome...@google.com>
Gerrit-Attention: Martin Kustermann <kuste...@google.com>
Gerrit-Attention: Srujan Gaddam <sru...@google.com>
Gerrit-Comment-Date: Wed, 11 Feb 2026 17:57:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Martin Kustermann (Gerrit)

unread,
Feb 12, 2026, 4:24:18 AM (4 days ago) Feb 12
to Ömer Ağacan, Nate Biggs, Srujan Gaddam, Commit Queue, dart2wasm-t...@google.com, rev...@dartlang.org
Attention needed from Srujan Gaddam and Ömer Ağacan

Martin Kustermann voted and added 5 comments

Votes added by Martin Kustermann

Code-Review+1

5 comments

File pkg/dart2wasm/lib/code_generator.dart
Line 5229, Patchset 9 (Latest):/// JS exceptions are only caught as: `dynamic`, `Object`, `Object?`.
Martin Kustermann . unresolved
That's not entirely true I suspect. So if a user writes
```
try {
foo();
} on JSObject (err, stack) {
..
}
```
then we probably turn this (due to lowering of JS extension types to representation types)
```
try {
foo();
} on JSValue (err, stack) {
..
}
```
(The user cannot write this as `JSValue` is not exposed from `dart:*`, but user can implicitly type it by using the JS interop types)


Now the above code isn't portable across dart2js & dart2wasm, but it can still be written.

So maybe what the below should test is whether a `JSValue` is a subtype of `guard`. That will answer true for `JSValue`, `Object`, Dynamic`

File sdk/lib/_internal/wasm/lib/js_helper.dart
Line 784, Patchset 9 (Latest):class NullThrownFromJavaScriptException {
Martin Kustermann . unresolved

Should this `implement Exception` (just like the JS version)?

Line 791, Patchset 9 (Latest): NullThrownFromJavaScriptException.fromUndefined() : _isNull = false;
Martin Kustermann . unresolved

Consider making those const constructors.

File sdk/lib/_internal/wasm/lib/stack_trace_patch.dart
Line 12, Patchset 9 (Latest): JavaScriptStack(JS<WasmExternRef?>("() => new Error().stack"));
Martin Kustermann . unresolved

Consider moving this logic to `JavaScriptStack` to have it in one place:
```
static StackTrace get current => JavaScriptStack.current;
```

File tests/web/wasm/js_exceptions_test.dart
Line 210, Patchset 9 (Latest): } catch (_) {
Martin Kustermann . unresolved

If you catch anything here, then we will never get to the outer `try/catch`, right?

But it seems this was the intention of the test, see the docstring:
```
// Similar to `jsExceptionTypeTest1`, but the type test should succeed in a
// parent try-catch.
Future<void> jsExceptionTypeTest2() async {
```

Maybe this `jsExceptionTypeTest2` isn't adding any value anymore over `jsExceptionTypeTest1`?

Open in Gerrit

Related details

Attention is currently required from:
  • Srujan Gaddam
  • Ömer Ağacan
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I23e73074729f740b90df2ca8b3c713fb39966556
Gerrit-Change-Number: 479640
Gerrit-PatchSet: 9
Gerrit-Owner: Ömer Ağacan <ome...@google.com>
Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
Gerrit-Reviewer: Nate Biggs <nate...@google.com>
Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
Gerrit-Reviewer: Ömer Ağacan <ome...@google.com>
Gerrit-Attention: Ömer Ağacan <ome...@google.com>
Gerrit-Attention: Srujan Gaddam <sru...@google.com>
Gerrit-Comment-Date: Thu, 12 Feb 2026 09:24:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Ömer Ağacan (Gerrit)

unread,
Feb 12, 2026, 8:34:45 AM (4 days ago) Feb 12
to Martin Kustermann, Nate Biggs, Srujan Gaddam, Commit Queue, dart2wasm-t...@google.com, rev...@dartlang.org
Attention needed from Martin Kustermann, Nate Biggs and Srujan Gaddam

Ömer Ağacan added 4 comments

File pkg/dart2wasm/lib/code_generator.dart
Line 5229, Patchset 9:/// JS exceptions are only caught as: `dynamic`, `Object`, `Object?`.
Martin Kustermann . unresolved
That's not entirely true I suspect. So if a user writes
```
try {
foo();
} on JSObject (err, stack) {
..
}
```
then we probably turn this (due to lowering of JS extension types to representation types)
```
try {
foo();
} on JSValue (err, stack) {
..
}
```
(The user cannot write this as `JSValue` is not exposed from `dart:*`, but user can implicitly type it by using the JS interop types)


Now the above code isn't portable across dart2js & dart2wasm, but it can still be written.

So maybe what the below should test is whether a `JSValue` is a subtype of `guard`. That will answer true for `JSValue`, `Object`, Dynamic`

Ömer Ağacan

I thought we don't want to catch as JS types, because that would require type testing the caught JS values, and I guess dart2js can be a bit more relaxed in the type tests? (which would introduce incompatbilitiy between dart2js and dart2wasm)

This is also how I summarized the plan in the issue. It's possible that I got it wrong though.

Let's wait for @sru...@google.com's feedback here.

File sdk/lib/_internal/wasm/lib/js_helper.dart
Line 784, Patchset 9:class NullThrownFromJavaScriptException {
Martin Kustermann . resolved

Should this `implement Exception` (just like the JS version)?

Ömer Ağacan

Done

Line 791, Patchset 9: NullThrownFromJavaScriptException.fromUndefined() : _isNull = false;
Martin Kustermann . resolved

Consider making those const constructors.

Ömer Ağacan

Done

File sdk/lib/_internal/wasm/lib/stack_trace_patch.dart
Line 12, Patchset 9: JavaScriptStack(JS<WasmExternRef?>("() => new Error().stack"));
Martin Kustermann . resolved

Consider moving this logic to `JavaScriptStack` to have it in one place:
```
static StackTrace get current => JavaScriptStack.current;
```

Ömer Ağacan

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Martin Kustermann
  • Nate Biggs
  • Srujan Gaddam
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: I23e73074729f740b90df2ca8b3c713fb39966556
    Gerrit-Change-Number: 479640
    Gerrit-PatchSet: 10
    Gerrit-Owner: Ömer Ağacan <ome...@google.com>
    Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
    Gerrit-Reviewer: Nate Biggs <nate...@google.com>
    Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
    Gerrit-Reviewer: Ömer Ağacan <ome...@google.com>
    Gerrit-Attention: Martin Kustermann <kuste...@google.com>
    Gerrit-Attention: Nate Biggs <nate...@google.com>
    Gerrit-Attention: Srujan Gaddam <sru...@google.com>
    Gerrit-Comment-Date: Thu, 12 Feb 2026 13:34:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Martin Kustermann <kuste...@google.com>
    unsatisfied_requirement
    open
    diffy

    Ömer Ağacan (Gerrit)

    unread,
    Feb 12, 2026, 8:37:48 AM (4 days ago) Feb 12
    to Martin Kustermann, Nate Biggs, Srujan Gaddam, Commit Queue, dart2wasm-t...@google.com, rev...@dartlang.org
    Attention needed from Martin Kustermann, Nate Biggs and Srujan Gaddam

    Ömer Ağacan added 1 comment

    File tests/web/wasm/js_exceptions_test.dart
    Line 210, Patchset 9: } catch (_) {
    Martin Kustermann . unresolved

    If you catch anything here, then we will never get to the outer `try/catch`, right?

    But it seems this was the intention of the test, see the docstring:
    ```
    // Similar to `jsExceptionTypeTest1`, but the type test should succeed in a
    // parent try-catch.
    Future<void> jsExceptionTypeTest2() async {
    ```

    Maybe this `jsExceptionTypeTest2` isn't adding any value anymore over `jsExceptionTypeTest1`?

    Ömer Ağacan

    Good point, I'm also not sure what this is testing. I wonder if it could be testing nested `try-catch`s with yields in between?

    Gerrit-Comment-Date: Thu, 12 Feb 2026 13:37:43 +0000
    unsatisfied_requirement
    open
    diffy

    Martin Kustermann (Gerrit)

    unread,
    Feb 12, 2026, 8:52:21 AM (4 days ago) Feb 12
    to Ömer Ağacan, Nate Biggs, Srujan Gaddam, Commit Queue, dart2wasm-t...@google.com, rev...@dartlang.org
    Attention needed from Nate Biggs, Srujan Gaddam and Ömer Ağacan

    Martin Kustermann voted and added 1 comment

    Votes added by Martin Kustermann

    Code-Review+1

    1 comment

    File pkg/dart2wasm/lib/code_generator.dart
    Line 5229, Patchset 9:/// JS exceptions are only caught as: `dynamic`, `Object`, `Object?`.
    Martin Kustermann . unresolved
    That's not entirely true I suspect. So if a user writes
    ```
    try {
    foo();
    } on JSObject (err, stack) {
    ..
    }
    ```
    then we probably turn this (due to lowering of JS extension types to representation types)
    ```
    try {
    foo();
    } on JSValue (err, stack) {
    ..
    }
    ```
    (The user cannot write this as `JSValue` is not exposed from `dart:*`, but user can implicitly type it by using the JS interop types)


    Now the above code isn't portable across dart2js & dart2wasm, but it can still be written.

    So maybe what the below should test is whether a `JSValue` is a subtype of `guard`. That will answer true for `JSValue`, `Object`, Dynamic`

    Ömer Ağacan

    I thought we don't want to catch as JS types, because that would require type testing the caught JS values, and I guess dart2js can be a bit more relaxed in the type tests? (which would introduce incompatbilitiy between dart2js and dart2wasm)

    This is also how I summarized the plan in the issue. It's possible that I got it wrong though.

    Let's wait for @sru...@google.com's feedback here.

    Martin Kustermann

    We want users to use `} on Object catch (o) { if (o.isJSAny) { ... } else { ... }}` to ensure their code works across dart2js & dart2wasm.

    That doesn't mean one cannot write `} on JSObject catch (o) { ... }`. There were talks about adding lints for that, but users could still write the code and it would compile.

    If we wanted to make this a compile-time error, then it would be a possibly breaking language change.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Nate Biggs
    • Srujan Gaddam
    • Ömer Ağacan
    Submit Requirements:
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: sdk
      Gerrit-Branch: main
      Gerrit-Change-Id: I23e73074729f740b90df2ca8b3c713fb39966556
      Gerrit-Change-Number: 479640
      Gerrit-PatchSet: 10
      Gerrit-Owner: Ömer Ağacan <ome...@google.com>
      Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
      Gerrit-Reviewer: Nate Biggs <nate...@google.com>
      Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
      Gerrit-Reviewer: Ömer Ağacan <ome...@google.com>
      Gerrit-Attention: Ömer Ağacan <ome...@google.com>
      Gerrit-Attention: Nate Biggs <nate...@google.com>
      Gerrit-Attention: Srujan Gaddam <sru...@google.com>
      Gerrit-Comment-Date: Thu, 12 Feb 2026 13:52:15 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Ömer Ağacan <ome...@google.com>
      Comment-In-Reply-To: Martin Kustermann <kuste...@google.com>
      satisfied_requirement
      open
      diffy

      Ömer Ağacan (Gerrit)

      unread,
      Feb 12, 2026, 9:21:19 AM (4 days ago) Feb 12
      to Martin Kustermann, Nate Biggs, Srujan Gaddam, Commit Queue, dart2wasm-t...@google.com, rev...@dartlang.org
      Attention needed from Martin Kustermann, Nate Biggs and Srujan Gaddam

      Ömer Ağacan added 1 comment

      File tests/web/wasm/js_exceptions_test.dart
      Line 210, Patchset 9: } catch (_) {
      Martin Kustermann . resolved

      If you catch anything here, then we will never get to the outer `try/catch`, right?

      But it seems this was the intention of the test, see the docstring:
      ```
      // Similar to `jsExceptionTypeTest1`, but the type test should succeed in a
      // parent try-catch.
      Future<void> jsExceptionTypeTest2() async {
      ```

      Maybe this `jsExceptionTypeTest2` isn't adding any value anymore over `jsExceptionTypeTest1`?

      Ömer Ağacan

      Good point, I'm also not sure what this is testing. I wonder if it could be testing nested `try-catch`s with yields in between?

      Ömer Ağacan

      I updated this test to rethrow in the inner handler and catch again in the outer handler. Then test the both the inner handler and the outer handler catches as expected.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Martin Kustermann
      • Nate Biggs
      • Srujan Gaddam
      Submit Requirements:
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: sdk
        Gerrit-Branch: main
        Gerrit-Change-Id: I23e73074729f740b90df2ca8b3c713fb39966556
        Gerrit-Change-Number: 479640
        Gerrit-PatchSet: 10
        Gerrit-Owner: Ömer Ağacan <ome...@google.com>
        Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
        Gerrit-Reviewer: Nate Biggs <nate...@google.com>
        Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
        Gerrit-Reviewer: Ömer Ağacan <ome...@google.com>
        Gerrit-Attention: Martin Kustermann <kuste...@google.com>
        Gerrit-Attention: Nate Biggs <nate...@google.com>
        Gerrit-Attention: Srujan Gaddam <sru...@google.com>
        Gerrit-Comment-Date: Thu, 12 Feb 2026 14:21:14 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        unsatisfied_requirement
        open
        diffy

        Ömer Ağacan (Gerrit)

        unread,
        Feb 13, 2026, 5:48:42 AM (3 days ago) Feb 13
        to Martin Kustermann, Nate Biggs, Srujan Gaddam, Commit Queue, dart2wasm-t...@google.com, rev...@dartlang.org
        Attention needed from Martin Kustermann, Nate Biggs and Srujan Gaddam

        Ömer Ağacan added 1 comment

        Patchset-level comments
        File-level comment, Patchset 11 (Latest):
        Ömer Ağacan . unresolved

        It looks like Chrome is not giving you the full stack trace with `new Error().stack` (it gives you some number of top frames, not the full thing), and with the refactoring we now have more frames when get the stack trace, which causes test failures because of the missing frames in the stack. I've created a thread with the V8 devs on this in the internal chat room.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Martin Kustermann
        • Nate Biggs
        • Srujan Gaddam
        Submit Requirements:
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: sdk
        Gerrit-Branch: main
        Gerrit-Change-Id: I23e73074729f740b90df2ca8b3c713fb39966556
        Gerrit-Change-Number: 479640
        Gerrit-PatchSet: 11
        Gerrit-Owner: Ömer Ağacan <ome...@google.com>
        Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
        Gerrit-Reviewer: Nate Biggs <nate...@google.com>
        Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
        Gerrit-Reviewer: Ömer Ağacan <ome...@google.com>
        Gerrit-Attention: Martin Kustermann <kuste...@google.com>
        Gerrit-Attention: Nate Biggs <nate...@google.com>
        Gerrit-Attention: Srujan Gaddam <sru...@google.com>
        Gerrit-Comment-Date: Fri, 13 Feb 2026 10:48:35 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        unsatisfied_requirement
        open
        diffy

        Ömer Ağacan (Gerrit)

        unread,
        Feb 13, 2026, 5:55:33 AM (3 days ago) Feb 13
        to Martin Kustermann, Nate Biggs, Srujan Gaddam, Commit Queue, dart2wasm-t...@google.com, rev...@dartlang.org
        Attention needed from Martin Kustermann, Nate Biggs and Srujan Gaddam

        Ömer Ağacan added 1 comment

        File pkg/dart2wasm/lib/code_generator.dart
        Line 5229, Patchset 9:/// JS exceptions are only caught as: `dynamic`, `Object`, `Object?`.
        Martin Kustermann . unresolved
        That's not entirely true I suspect. So if a user writes
        ```
        try {
        foo();
        } on JSObject (err, stack) {
        ..
        }
        ```
        then we probably turn this (due to lowering of JS extension types to representation types)
        ```
        try {
        foo();
        } on JSValue (err, stack) {
        ..
        }
        ```
        (The user cannot write this as `JSValue` is not exposed from `dart:*`, but user can implicitly type it by using the JS interop types)


        Now the above code isn't portable across dart2js & dart2wasm, but it can still be written.

        So maybe what the below should test is whether a `JSValue` is a subtype of `guard`. That will answer true for `JSValue`, `Object`, Dynamic`

        Ömer Ağacan

        I thought we don't want to catch as JS types, because that would require type testing the caught JS values, and I guess dart2js can be a bit more relaxed in the type tests? (which would introduce incompatbilitiy between dart2js and dart2wasm)

        This is also how I summarized the plan in the issue. It's possible that I got it wrong though.

        Let's wait for @sru...@google.com's feedback here.

        Martin Kustermann

        We want users to use `} on Object catch (o) { if (o.isJSAny) { ... } else { ... }}` to ensure their code works across dart2js & dart2wasm.

        That doesn't mean one cannot write `} on JSObject catch (o) { ... }`. There were talks about adding lints for that, but users could still write the code and it would compile.

        If we wanted to make this a compile-time error, then it would be a possibly breaking language change.

        Ömer Ağacan

        I still think that's not the intention with this change. If we allow JS types to be caught there will be discrepancies between dart2js and dart2wasm. Example:
        ```
        import 'dart:js_interop';
        import 'dart:typed_data';

        test() {
        throw Uint8List(10);
        }
        main() {
        try {
        test();
        } on JSUint8Array catch (e, st) {
        print("Caught exception: $e");
        }
        print("OK");
        }
        ```
        dart2js catches this exception, but dart2wasm won't.

        When you don't allow interop types in `on` you avoid these issues when a Dart type is an interop type in dart2js but not in dart2wasm.

        Gerrit-Comment-Date: Fri, 13 Feb 2026 10:55:29 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        unsatisfied_requirement
        open
        diffy

        Ömer Ağacan (Gerrit)

        unread,
        Feb 13, 2026, 7:05:11 AM (3 days ago) Feb 13
        to Martin Kustermann, Nate Biggs, Srujan Gaddam, Commit Queue, dart2wasm-t...@google.com, rev...@dartlang.org
        Attention needed from Martin Kustermann, Nate Biggs and Srujan Gaddam

        Ömer Ağacan added 1 comment

        Patchset-level comments
        Ömer Ağacan . unresolved

        It looks like Chrome is not giving you the full stack trace with `new Error().stack` (it gives you some number of top frames, not the full thing), and with the refactoring we now have more frames when get the stack trace, which causes test failures because of the missing frames in the stack. I've created a thread with the V8 devs on this in the internal chat room.

        Ömer Ağacan

        I updated d8 invocations with the right flag to capture more frames, Chrome invocations left.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Martin Kustermann
        • Nate Biggs
        • Srujan Gaddam
        Submit Requirements:
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: sdk
        Gerrit-Branch: main
        Gerrit-Change-Id: I23e73074729f740b90df2ca8b3c713fb39966556
        Gerrit-Change-Number: 479640
        Gerrit-PatchSet: 12
        Gerrit-Owner: Ömer Ağacan <ome...@google.com>
        Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
        Gerrit-Reviewer: Nate Biggs <nate...@google.com>
        Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
        Gerrit-Reviewer: Ömer Ağacan <ome...@google.com>
        Gerrit-Attention: Martin Kustermann <kuste...@google.com>
        Gerrit-Attention: Nate Biggs <nate...@google.com>
        Gerrit-Attention: Srujan Gaddam <sru...@google.com>
        Gerrit-Comment-Date: Fri, 13 Feb 2026 12:05:06 +0000
        unsatisfied_requirement
        open
        diffy

        Ömer Ağacan (Gerrit)

        unread,
        Feb 13, 2026, 8:05:09 AM (3 days ago) Feb 13
        to Martin Kustermann, Nate Biggs, Srujan Gaddam, Commit Queue, dart2wasm-t...@google.com, rev...@dartlang.org
        Attention needed from Martin Kustermann, Nate Biggs and Srujan Gaddam

        Ömer Ağacan added 1 comment

        Patchset-level comments
        File-level comment, Patchset 11:
        Ömer Ağacan . resolved

        It looks like Chrome is not giving you the full stack trace with `new Error().stack` (it gives you some number of top frames, not the full thing), and with the refactoring we now have more frames when get the stack trace, which causes test failures because of the missing frames in the stack. I've created a thread with the V8 devs on this in the internal chat room.

        Ömer Ağacan

        I updated d8 invocations with the right flag to capture more frames, Chrome invocations left.

        Ömer Ağacan

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Martin Kustermann
        • Nate Biggs
        • Srujan Gaddam
        Submit Requirements:
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: sdk
        Gerrit-Branch: main
        Gerrit-Change-Id: I23e73074729f740b90df2ca8b3c713fb39966556
        Gerrit-Change-Number: 479640
        Gerrit-PatchSet: 13
        Gerrit-Owner: Ömer Ağacan <ome...@google.com>
        Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
        Gerrit-Reviewer: Nate Biggs <nate...@google.com>
        Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
        Gerrit-Reviewer: Ömer Ağacan <ome...@google.com>
        Gerrit-Attention: Martin Kustermann <kuste...@google.com>
        Gerrit-Attention: Nate Biggs <nate...@google.com>
        Gerrit-Attention: Srujan Gaddam <sru...@google.com>
        Gerrit-Comment-Date: Fri, 13 Feb 2026 13:05:04 +0000
        unsatisfied_requirement
        open
        diffy

        Martin Kustermann (Gerrit)

        unread,
        Feb 13, 2026, 2:27:14 PM (3 days ago) Feb 13
        to Ömer Ağacan, Nate Biggs, Srujan Gaddam, Commit Queue, dart2wasm-t...@google.com, rev...@dartlang.org
        Attention needed from Nate Biggs, Srujan Gaddam and Ömer Ağacan

        Martin Kustermann voted and added 1 comment

        Votes added by Martin Kustermann

        Code-Review+1

        1 comment

        File pkg/dart2wasm/lib/code_generator.dart
        Martin Kustermann

        Well, the way I think about this is the same as I think about `is` tests:

        Users can write `Object object; if (object is Uint8List) {}` and will probably get `true` in dart2js and `false` in dart2wasm iff `object` is `JSUint8Array`. (Yes, users should not do that, they should rather write e.g. `if (object.isA<JSUint8Array>) {}` instead which will work for both)

        So the same logic applies in try/catch: Users should use `on Object` but if they don't and isntead use `on JSUint8Array` they may get different behavior -- just like in the `is` tests.

        So we get the same uniformity or differences in `is` and `} on catch () {`.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Nate Biggs
        • Srujan Gaddam
        • Ömer Ağacan
        Submit Requirements:
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: sdk
          Gerrit-Branch: main
          Gerrit-Change-Id: I23e73074729f740b90df2ca8b3c713fb39966556
          Gerrit-Change-Number: 479640
          Gerrit-PatchSet: 13
          Gerrit-Owner: Ömer Ağacan <ome...@google.com>
          Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
          Gerrit-Reviewer: Nate Biggs <nate...@google.com>
          Gerrit-Reviewer: Srujan Gaddam <sru...@google.com>
          Gerrit-Reviewer: Ömer Ağacan <ome...@google.com>
          Gerrit-Attention: Ömer Ağacan <ome...@google.com>
          Gerrit-Attention: Nate Biggs <nate...@google.com>
          Gerrit-Attention: Srujan Gaddam <sru...@google.com>
          Gerrit-Comment-Date: Fri, 13 Feb 2026 19:27:07 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages