It seems that there's some fiddliness when writing error handling
lambdas in strong mode.
async_await_sync_completer_test: The lambda was implicitly trying to
return the result of a throw, which was Never. I've switched it to this
syntax, which implicitly returns Null instead.
stream_iterator_test: The error handler needs to return a Bool, for
compatibility with the Future.
I'm open to suggestions for cleaner fixes to these bugs.
Change-Id: Ifc646a965d4b435512277da96ffb5e0b429114cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141164
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
The idea is to pass a SendPort as an optional parameter to
ServerStarter.start(), and if present, key server behavior around
behaving well as an isolate.
Bug: https://github.com/dart-lang/sdk/issues/41056
Change-Id: Ifc6ac2fefcf6aae8bce712e470524d1c06fa2ba6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140373
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
- Avoid unnecessary type checks.
- Convert comment syntax to actual generic method syntax.
- Cleanup some type Strings from the JS foreign interface.
- Use var on LHS more consistently.
Performance optimizations can be seen in the ArrayLoop
benchmarks with the highest being ArrayLoop.pseudopoly.forEach
with a 34.15% improvement.
These changes also avoid a large performance regression when
we unfork and the array contains legacy or nullable types.
Change-Id: I88e21a7b0d36d9bb9ba1b0e8ba24326f2b2c8229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140760
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Saw in crash logs:
NoSuchMethodError: NoSuchMethodError: The getter 'type' was called on null.
Receiver: null
Tried calling: type
at Object.noSuchMethod (dart:core )
at ErrorVerifier._checkForWrongTypeParameterVarianceInMethod (error_verifier.dart:5002 )
at ErrorVerifier.visitMethodDeclaration (error_verifier.dart:973 )
at MethodDeclarationImpl.accept (ast.dart:6978 )
Change-Id: I17b3db0d537827e34c4cc63a9ebdf1ecbda455f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141023
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
initMouseEvent uses this conversion to call the native function,
and it is allowed for the EventTarget to be null in the native
call.
Change-Id: I345e82fa00f4cca72e15f713cd7a271d306b7d37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141040
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
```
737f055d0a1cfb348178dbde6bd13f06704bf6d4 Fix NPE during language version analysis (#2398)
```
Change-Id: I83a3110a64e8db9c576a5a52d53688ea392e1b33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141060
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
This can remove flakiness of the test, the approval status will be NonUtf8Output.
Change-Id: Ie911547481ed0421632a54a3a74ce93984656948
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141123
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This should have tests, but I (or someone else) need to do some data
mining to figure out the correct relevance values and hence the correct
ordering to test for.
Change-Id: I7782d7b7e13ff38a785c445cd0d6fc82a388a6aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141000
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
So far the unboxing support in TFA disabled unboxing for natives and
relied on TFA inferring entrypoint parameters to be nullable (and
therefore boxed).
Though the added support for unboxing return values missed to explicitly
disable unboxing for return values of entry points.
=> This CL fixes that.
This is also a preparation for NNBD when parameters to entry points are not
necessarily nullable anymore.
Change-Id: Ia80a6acc8e803732b81665ebab14a9bfa720be22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140866
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Once again, test suggestions are welcome.
Change-Id: I470825a0ef51f555977bdc86192cc38bd718519a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140943
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This reverts commit a225178919.
Reason for revert: This seems to remove useful info from the stack trace. Will revert, then hopefully land an improved version.
Original change's description:
> Trim not useful bottoms off of the non/nullability stack traces
>
> Change-Id: I2f7bfab13fd3d70c5cbdbb10ce14a8a91f8c7a60
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140000
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Paul Berry <paulberry@google.com>
TBR=paulberry@google.com,mfairhurst@google.com,srawlins@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I9a2fb07e387d57394242b694e27456333f2cf2b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140908
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Change-Id: I6288838fe5dea2cb7b8e0d79ee90d09c91496769
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140901
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Nullability of left hand side in type test was checked too early, i.e. before
handling FutureOr on the right hand side.
The following tests began passing (in strong mode):
standalone/io/addlatexhash_test was fixed (RuntimeError -> Pass)
standalone/io/file_output_stream_test was fixed (RuntimeError -> Pass)
standalone/io/file_stream_test was fixed (RuntimeError -> Pass)
standalone/io/file_system_async_links_test was fixed (RuntimeError -> Pass)
standalone/io/file_system_links_test was fixed (RuntimeError -> Pass)
standalone/io/file_write_only_test was fixed (RuntimeError -> Pass)
standalone/io/pipe_server_test/0 was fixed (RuntimeError -> Pass)
standalone/io/pipe_server_test/1 was fixed (RuntimeError -> Pass)
standalone/io/pipe_server_test/2 was fixed (RuntimeError -> Pass)
standalone/io/pipe_server_test/3 was fixed (RuntimeError -> Pass)
standalone/io/pipe_server_test/4 was fixed (RuntimeError -> Pass)
standalone/io/pipe_server_test/5 was fixed (RuntimeError -> Pass)
standalone/io/stream_pipe_test/0 was fixed (RuntimeError -> Pass)
standalone/io/stream_pipe_test/1 was fixed (RuntimeError -> Pass)
standalone/io/stream_pipe_test/2 was fixed (RuntimeError -> Pass)
standalone/io/stream_pipe_test/3 was fixed (RuntimeError -> Pass)
Change-Id: I855328f101382cf5f1af9119b396aa9d0cb14e40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140776
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Previously, null check hints were only affecting the behavior of
EdgeBuilder, which meant that we handled simple cases like:
int f(int/*?*/ x) => x/*!*/;
(because the EdgeBuilder wouldn't build an edge from the type of `x`
to the return type of `f`, so the return type of `f` would be
non-nullable int, and hence the FixBuilder would insert a `!` in order
to prevent an error).
But if there were some *other* reason for the destination type to be
nullable, then no `!` would get inserted.
This CL adds explicit logic to the FixBuilder to ensure that a `/*!*/`
hint causes a `!` to be inserted whether it's necessary or not.
Change-Id: I283bb9793d8d01408333f5b56562286bf19d8773
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140904
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
The only purpose of these interfaces was to enforce an artificial
separation of concerns between the methods of Variables used by
NodeBuilder and EdgeBuilder; this separation was never really very
useful, and it's getting in the way of adding features to FixBuilder.
It seems better to just use the Variables class directly everywhere.
Change-Id: I7b9c6c08c09a466bbcc1e3f72f9aa05db0d1a7b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140884
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
This change fixes a couple of types in dart:convert and dart:io
implementation. Previously, non-nullable types were used where
null is actually allowed.
Stack traces where casting null to those types failed:
type 'Null' is not a subtype of type 'Object'
_ChunkedJsonParser.result (dart:convert-patch/convert_patch.dart:523)
_JsonStringDecoderSink.close (dart:convert-patch/convert_patch.dart:1491)
decode (file:///b/s/w/ir/cache/builder/sdk/tests/lib/convert/chunked_conversion_json_decode1_test.dart:88)
main (file:///b/s/w/ir/cache/builder/sdk/tests/lib/convert/chunked_conversion_json_decode1_test.dart:182)
type 'Null' is not a subtype of type 'Object'
_Link.createSync (dart:io/link.dart:197)
testCreateLinkRecursiveSync (file:///b/s/w/ir/cache/builder/sdk/tests/standalone/io/create_recursive_test.dart:62)
main (file:///b/s/w/ir/cache/builder/sdk/tests/standalone/io/create_recursive_test.dart:14)
Change-Id: I2a52ff037927339df1148655189cc053acea4432
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140804
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
The changes are mainly:
- Add a brief intro section.
- Fix indentation to make Markdown happy. In particular, +4 is needed
for nested lists to format correctly.
- Do a little copy-editing on the text. Mostly changing future tense to
present tense.
- Merge the two dart2js sections together.
- Change some inline links to reference links since those are a little
easier on the eyes.
Change-Id: I72f4d3a4f74d7b83afa8d02dd95589aeddc613d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140771
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>