So, we can remove casts in a few places.
Change-Id: I3ffa0e081633560f51a72327fd8fdd9e02ac46ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354380
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Instead of directly printing all `print()`s from Dart to the console,
we allow the prints to be intercepted - by specifying a `dartPrint()`
function.
=> This will fix our test infrastructure, which will now recognize
async tests as being asynchronous and waits until the async test
is actually done with testing.
=> This will also make the test infrastructure report all prints
of a test when the test fails (it reports DOM, prints, various other
events)
=> Test failure output of `tools/test.py -n dart2js-*-{firefox,chrome}`
will become actually useful, containing printed errors & stack traces.
This is similar to what dart2js does in
sdk/lib/_internal/js_runtime/lib/js_primitives.dart
Related Issue: https://github.com/dart-lang/sdk/issues/54973
Change-Id: Ibd935fd2d0b15d1b6e444214c4556a65034957dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354100
Reviewed-by: Ömer Ağacan <omersa@google.com>
It reduces FluteCounter
* 2.5% in unoptimized mode
* 0.8% in optimzed mode (and similar when gzip'ed)
Change-Id: If4852d66e8c214754f68e4d134960e8b622d20fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354023
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
* We migrate the `dart:developer` implementation of dart2js to
static interop.
* We make dart2wasm use the same implementation as dart2js.
Closes https://github.com/dart-lang/sdk/issues/54991
Change-Id: I7873edc7e804500c8eca878367d9045c98a1c2e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354101
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
`unsupported` brings in a lot of transitive deps, which is undesirable
here as `type_labeler` will become a dep of `package:vm` because it's
used in error reporting of the FFI transformations.
R=johnniwinther@google.com
Change-Id: Icf6eef6f57bb67c83a9d998cc800ed747b2682e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354220
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Change-Id: Ibec8a8dbe627b57253aaa0ec4a91f1c408fe282a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354240
Commit-Queue: Jonas Termansen <sortie@google.com>
Auto-Submit: Jonas Termansen <sortie@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
This fixes a serious (but somewhat rare) bug where a line comment in a
switch expression might eat subsequent cases. See:
https://github.com/dart-lang/dart_style/issues/1404
There are no other formatting changes.
Change-Id: I7a1cb751c76abcd0507113635aab3f866a798364
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354063
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Adds a conditional impact that represents that impact if the replacement node is added to the kernel AST. This is a soundness fix for conditional impacts as the replacement node might have a different set of impacts than the "source".
It's worth noting that the only way this could lead to an incorrect compilation for protobufs is if *every* metadata field was erased. The impact of each "source" is a superset of the impact for every "replacement" node.
This code is new and behind a flag so this bug certainly won't have been visible to anyone.
Change-Id: Ifa3cb7d6b9aa46221c736a1566aa79d73f99917c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353940
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Also include 'stackTrace' for all MacroImplementationExceptionImpl.
I reverted the same instance for type alias, we don't do it in general.
These instances do change as we run macros, e.g. append annotations.
Change-Id: I5a9f03722ba19ef5a4aada88fb044779327305bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354064
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This covers a failure in language/macros/json/json_serializable_diagnostics_test.dart
Change-Id: I751a58db6316ef2d9bb42533e279ab5fa49d1fd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354042
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
The checking for loops did not normalize the first entry, causing the
expectation to be read twice in case of a loop, and the test to fail.
Simplify a little by checking when adding to the "already seen" set.
R=brianwilkerson@google.com
Change-Id: I1862f98051fc5e4f867fdf0d9b1b0884b99610ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353681
Reviewed-by: William Hesse <whesse@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Today, each boolean requires 1 byte. With this implementation all booleans on a class combined require between one and three bytes, depending on which ones are set.
This may or may not actually be worthwhile, please push back if you think it's not :). I can't tell much difference running real macros.
Change-Id: Ie9fac0497f0d4571c5f1314009ec9d7c474b073c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352562
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
`dart:mirrors` is not supported in AOT mode.
Bug: https://github.com/dart-lang/co19/issues/2546
Change-Id: I2b0d42df911c6f185e72239f4786a87c535de535
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353522
Reviewed-by: Siva Annamalai <asiva@google.com>
Auto-Submit: Sergey Grekhov <sgrekhov22@gmail.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
We don't implement typedef declarations, but it was silent.
It took me some time to discover why JsonSerializable just did not work.
Change-Id: I76d26ad90267d9a2b0e4df772158b04dab2342fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This removes an expensive type check for `is GlobalKey` in flutter code
where the `GlobalKey` has non-trivial bound.
abstract class GlobalKey<T extends State<StatefulWidget>> { ... }
Change-Id: Ia685c0b528fdfe93d7a50685d2ba38b216277e15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353740
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Similarly, use patterns for element text printer.
This makes the test a little more declarative.
Change-Id: I179973c3e226b19409665bf4f738e6ba36b42467
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353803
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
In my head "raw" means without markers.
So, the previous naming was confusing.
Change-Id: I54d366cb406f7ba5487ae0bb2a7f800b2fccea84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352985
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>