Commit graph

7 commits

Author SHA1 Message Date
Ömer Sinan Ağacan 6de879e0f5 [dart2wasm] Fix exception handling in async functions
Fixes #55347.

Change-Id: I9ced2a4c06e6cb9714dc47e3661f5582c70cdeb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361063
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-04-05 14:23:00 +00:00
Robert Nystrom 9789e9d7a0 Migrate "e" and "f" directory language tests off @compile-error.
The "@compile-error" comment is an old not-great way of defining static
error tests.

See: https://github.com/dart-lang/sdk/issues/45634
Change-Id: Idf9012cb8c213b523d1c8bb827e530e0d2cf6609
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296407
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2023-04-20 20:49:17 +00:00
Aske Simon Christensen 7a63ff2604 [dart2wasm] Fix reversal of break labels crossing finally.
The block starts and ends for the entry points to the finally block
instances corresponding to break paths were emitted in the same order,
causing the jump targets to be reversed.

Change-Id: Ifc8a6b6320ba7341140606c98333f5825d2228ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283042
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-02-15 10:24:08 +00:00
Erik Ernst 3b74c305fd Update syntax_test to avoid expecting new syntax to be a syntax error
New language features made `futureOr(null) = 1` a syntactically
correct pattern assignment, so it should not be expected to cause a
syntax error. This CL changes that test case such that it is still an
assignment to a syntactically correct function invocation, but not a
correct pattern assignment (so it's again a syntax error).

Added more tests with similar properties: The 3.0 grammar causes some
test cases to be wrong, and this CL makes changes such that they will
continue to test "the same thing" as far as possible in the new
language.

Change-Id: Ie0166f1a599ffeebfd352f4fadc01abc0950bd0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279169
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-01-19 14:44:36 +00:00
Chloe Stefantsova a46de1c30c [cfe] Add implicit null-check on throw
Throwing `null` is not supported in sound null safety. This change
inserts an implicit `as Object` cast that result in a TypeError, rather
than a NullThrownError, in sound mode.

Closes https://github.com/dart-lang/sdk/issues/49198

TEST=Covered by the existing tests

Change-Id: I041baf95becd2df1b940fdff7cde398a4e391ee7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247546
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-12-12 00:48:13 +00:00
Lasse Reichstein Holst Nielsen 765c9c3a8e Make tests not assume catch(e) gives e type dynamic.
See #41558

Bug: http://dartbug.com/41558
Change-Id: I8980ad6e0d240c917f36ec4f9fcf2091fb61a4b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143819
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-05-05 09:57:23 +00:00
Robert Nystrom 74ef393e6d Migrate language_2/exception to NNBD.
Change-Id: I0f758fce0af79be77b2fc885afcc3bd17d9fb55e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142701
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-04-07 22:13:46 +00:00