dart-sdk/sdk/lib/_internal
Lasse R.H. Nielsen f0aeebd0e7 Make all platforms return null from Error.stackTrace until thrown.
The web platforms used to invent a spurious stack trace when reading
`Error.stackTrace` before the object was thrown.
They now return `null` instead, if there is no underlying JS error object,
matching specified behavior.

Fixed bugs in async error throwing in dart2wasm:
* `throw` in an async function did not set the stack trace on an error.
  Now calls `Error._throw` instead of just a direct Wasm "throw".
* `async*` functions did not capture the stack trace of a throw
  that ended the function body, which means it called
  `StreamController.addError` with only one argument.
  That then resused the stack trace from an `Error` throw instead
  of the correct stack trace.

Added tests.

Change-Id: I1d9fa8d9e18076a7fe28254b60b950866cd550a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354021
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-02-27 23:01:06 +00:00
..
js_dev_runtime Make all platforms return null from Error.stackTrace until thrown. 2024-02-27 23:01:06 +00:00
js_runtime Make all platforms return null from Error.stackTrace until thrown. 2024-02-27 23:01:06 +00:00
js_shared [js_dev_runtime] dart format --fix 2024-01-30 20:41:20 +00:00
sdk_library_metadata [dart2js] Convert some collections of const ints to enums 2024-02-23 19:52:50 +00:00
vm [VM/Service] - Launch dds from vmservice code instead of dartdev code 2024-02-22 06:22:12 +00:00
vm_shared/lib [dart2wasm] Duplicate VM's convert patch for dart2wasm targets 2023-10-18 06:39:59 +00:00
wasm [dart2wasm] Work around V8/Chrome bug that swallows exceptions from rethrows 2024-02-27 14:00:32 +00:00
wasm_js_compatibility/lib [dart:js_interop] Move JS types to extension types 2023-12-06 21:59:58 +00:00
allowed_experiments.json Reland "Expire 3.0.0 experiment flags." 2023-11-17 13:10:01 +00:00
fix_data.yaml