Commit graph

9085 commits

Author SHA1 Message Date
Srujan Gaddam dae60008ab DOM script changes to handle nnbd
-Adds field for type nullability for IDL operations
-Adds field for conversions to reflect input and output type nullability
--based on implementation
-Corrects generic object types to include nullability
-Changes 'any' types to dynamics
-Adds nullability to types in various operations
-Converts finals and non-initialized non-nullable fields to getters and
setters
--TODO: convert these to native instead of JS inline
-Modifies nullability for annotations and removes annotations from
setters

Change-Id: Iab19830fd1d7f37b170a4da8672f922c3f9b0863
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132967
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-07 01:05:14 +00:00
Srujan Gaddam 3776313e65 Change dart:html templates to generate null-safe code
Introduces NULLASSERT token and NNBD condition to allow code to
conditionally compile with NNBD.

Change-Id: Ib71e439f32c793e69b66c328cd7c9900358d886e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134045
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-06 23:18:24 +00:00
Sigmund Cherem eb54b5bb9b Formatting changes to dart:_native_type_data to make dart2js and ddc more similar.
Mostly changes to the comment syntax, removing optional `new`, and using the
same kind of quotes on strings.

Change-Id: Ia6d7f38523312f67cfa30cd30cef994759d40ef1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134480
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-02-05 19:34:59 +00:00
Sigmund Cherem 20745941ad [ddc,dart2js] make dart:typed_data the same in dart2js and ddc and opt-in to null safety.
Change-Id: If325a2ea11afef1d784fd01830999d5a4c9d4daf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134049
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2020-02-05 19:29:10 +00:00
Ben Konyi 763bcae067 Reland "[ VM / Service ] Added getClientName, setClientName and requireResumeApproval RPCs"
This reverts commit 37f4a44a27.

Reason for revert: Relanding after infra issues cleared

Original change's description:
> Revert "[ VM / Service ] Added `getClientName`, `setClientName` and `requireResumeApproval` RPCs"
> 
> This reverts commit 48808f7dce.
> 
> Reason for revert: Unable to approve failures.
> 
> Original change's description:
> > [ VM / Service ] Added `getClientName`, `setClientName` and `requireResumeApproval` RPCs
> > 
> > Add support for naming VM service clients which allows for resume
> > permissions to be set for all clients of the same name. If a client
> > name requires resume approval, an isolate won't be resumed until all
> > clients which require resume approval have called the `resume` RPC.
> > 
> > Resume approvals can be set for the following pause events:
> > - PauseOnStart
> > - PausePostRequest (issued after `reloadSources(pause: true)`)
> > - PauseOnExit
> > 
> > Change-Id: I7dde3d8aaeccfcf47fa84f1f92159846f1560e16
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133621
> > Commit-Queue: Ben Konyi <bkonyi@google.com>
> > Reviewed-by: Siva Annamalai <asiva@google.com>
> > Reviewed-by: Gary Roumanis <grouma@google.com>
> 
> TBR=jacobr@google.com,bkonyi@google.com,rmacnak@google.com,asiva@google.com,grouma@google.com
> 
> Change-Id: I8e60416ad8cbec9ad93f4e34e9bf9af5a516c6dc
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134465
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=jacobr@google.com,bkonyi@google.com,rmacnak@google.com,asiva@google.com,grouma@google.com

Change-Id: Ibd9d831774e5c4dd500da026f41b173589a9aefd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134415
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-02-05 18:14:39 +00:00
Jonas Termansen fddbc53a64 [nnbd] Reland backporting socket option semantics from NNBD dart:io.
The Socket class will now throw a SocketException if the socket has been
destroyed or upgraded to a secure socket upon setting or getting socket
options.

The NNBD migration required making subtle changes to some dart:io
semantics in order to provide a better API. This change backports one of
these semantic changes to the unmigrated SDK so any issues can be
discovered now instead of blocking the future SDK unfork.

Change-Id: If7029f8b42fd4b05cfb79eb439c09dc206dd3b92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134328
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2020-02-05 14:26:09 +00:00
Jake Macdonald 12b5e23084 Revert "[dart:io] Backport semantic changes from the dart:io NNBD migration."
This reverts commit 4cd6243d77.

Reason for revert: Breaks anything using the bazel_worker package (which is used for modular compilation with build_runner).  https://travis-ci.org/dart-lang/build/jobs/645748778

Original change's description:
> [dart:io] Backport semantic changes from the dart:io NNBD migration.
> 
> The NNBD migration required making subtle changes to some dart:io
> semantics in order to provide a better API. This change backports these
> semantic changes to the unmigrated SDK so any issues can be discovered
> now instead of blocking the future SDK unfork.
> 
> The Process class will now throw a StateError if the process is detached
> upon accessing the stdin, stdout, stderr, and exitCode getters.
> 
> The Socket class will now throw a SocketException if the socket has been
> destroyed or upgraded to a secure socket upon setting or getting socket
> options.
> 
> Change-Id: I956fd07e713e51ebd479ebbfe4790d8d2fdf0744
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133989
> Commit-Queue: Jonas Termansen <sortie@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

TBR=sortie@google.com,lrn@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I744662fcd14ca232bf44a584bb6f3974d48da69a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134361
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2020-02-05 10:03:47 +00:00
Ben Konyi 37f4a44a27 Revert "[ VM / Service ] Added getClientName, setClientName and requireResumeApproval RPCs"
This reverts commit 48808f7dce.

Reason for revert: Unable to approve failures.

Original change's description:
> [ VM / Service ] Added `getClientName`, `setClientName` and `requireResumeApproval` RPCs
> 
> Add support for naming VM service clients which allows for resume
> permissions to be set for all clients of the same name. If a client
> name requires resume approval, an isolate won't be resumed until all
> clients which require resume approval have called the `resume` RPC.
> 
> Resume approvals can be set for the following pause events:
> - PauseOnStart
> - PausePostRequest (issued after `reloadSources(pause: true)`)
> - PauseOnExit
> 
> Change-Id: I7dde3d8aaeccfcf47fa84f1f92159846f1560e16
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133621
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Gary Roumanis <grouma@google.com>

TBR=jacobr@google.com,bkonyi@google.com,rmacnak@google.com,asiva@google.com,grouma@google.com

Change-Id: I8e60416ad8cbec9ad93f4e34e9bf9af5a516c6dc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134465
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-02-05 01:13:17 +00:00
Mayank Patke 450924a8cd [dart2js] Remove typedefs from backend.
Change-Id: Ia170535b5d35d97003cff93acbf33cb3fe75725f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134206
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-02-05 01:09:47 +00:00
Ben Konyi 48808f7dce [ VM / Service ] Added getClientName, setClientName and requireResumeApproval RPCs
Add support for naming VM service clients which allows for resume
permissions to be set for all clients of the same name. If a client
name requires resume approval, an isolate won't be resumed until all
clients which require resume approval have called the `resume` RPC.

Resume approvals can be set for the following pause events:
- PauseOnStart
- PausePostRequest (issued after `reloadSources(pause: true)`)
- PauseOnExit

Change-Id: I7dde3d8aaeccfcf47fa84f1f92159846f1560e16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133621
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
2020-02-05 00:02:17 +00:00
Sigmund Cherem d798004ba3 [ddc,dart2js] remove web patches for dart:cli
Since dart:cli is not in the libraries.yaml/json for ddc and dart2js, imports to
it are not allowed on web code. The patch files were not needed and can be
removed.

Change-Id: I46acf8a540f4b2d0a2aa7dcc50b572adab564b68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134048
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-02-04 23:32:47 +00:00
Jonas Termansen 4cd6243d77 [dart:io] Backport semantic changes from the dart:io NNBD migration.
The NNBD migration required making subtle changes to some dart:io
semantics in order to provide a better API. This change backports these
semantic changes to the unmigrated SDK so any issues can be discovered
now instead of blocking the future SDK unfork.

The Process class will now throw a StateError if the process is detached
upon accessing the stdin, stdout, stderr, and exitCode getters.

The Socket class will now throw a SocketException if the socket has been
destroyed or upgraded to a secure socket upon setting or getting socket
options.

Change-Id: I956fd07e713e51ebd479ebbfe4790d8d2fdf0744
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133989
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-02-03 15:10:45 +00:00
Sigmund Cherem 07675de0c0 Fix type error within _EventStream.onData
The constructor was wrapping the onData handler to hide the type-mismatch. This
copies the same logic to the onData handler.

In non-nnbd code this code was not exercised. The migration of dart:async
made this code reachable on our tests. That's because Stream.first used to
do:

  var subscription;
  this.listen(() => ... cancel subscription here, ...)

it now avoids making subscription nullable by registering the onData handler
later:

  var subscrition = stream.listen(null, ...);
  subscription.onData(() => ... cancel subscription here);

This change fixes the following 6 html tests under nnbd:
html/history_test/history/history
html/transferables_test
html/transition_event_test
html/websocket_test
html/worker_test/functional/functional
html/xhr_test


Change-Id: I095ea8d545e65b047504af0367586884bba84d72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134120
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-02-02 05:58:24 +00:00
Zichang Guo 91a3ea89c8 Revert "[dart:io] Stop forcing lower case on HttpHeaders"
This reverts commit b2b7337ad4.

Reason for revert: flutter build broke!!

Original change's description:
> [dart:io] Stop forcing lower case on HttpHeaders
> 
> This is a breaking change. Request: https://github.com/dart-lang/sdk/issues/33501
> 
> HttpHeaders use lowercase by default for all headers, since it is supposed to be case insensitive. Some servers incorrectly treat case as significant, however, and expect headers with capitalization or in uppercase. The current implementation forces headers to be lower cases when adding values. Users cannot even manually modify the headers.
> 
> This change removes this restriction here so that users can modify the headers to whatever form they want. The new behavior is backwards compatible except if class was implemented. All headers inside http.dart are written as lower cases, adding values to HttpHeaders is still receiving lower cases input.
> 
> The other cl (https://dart-review.googlesource.com/c/http_multi_server/+/121411) migrates multi_headers.dart to be compatible with this change.
> 
> Bug: https://github.com/dart-lang/sdk/issues/33501
> Change-Id: I6f7f2ef907b229773c283140c07f2de4cd500981
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119100
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

TBR=whesse@google.com,sortie@google.com,lrn@google.com,zichangguo@google.com

Change-Id: I4d4299393ad6549b250053df8823e726855e2baf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/33501
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134102
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-01-31 22:32:22 +00:00
Mayank Patke a5cfdf6586 [dart2js] Use flags to choose between legacy/NNBD in RTI.
Change-Id: I42705320aabcdfecc12098f40ca16a2c623a1033
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134091
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-01-31 20:04:52 +00:00
Mayank Patke 023f286772 [dart2js] Update generic function subtyping.
We now test bounds for mutual subtyping rather than structural equality
up to renaming of bound type variables and equating all top types.

Change-Id: I7dd23a3211a1631e463ea90c3173f3deae46ca23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134042
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-31 18:33:02 +00:00
Zichang Guo b2b7337ad4 [dart:io] Stop forcing lower case on HttpHeaders
This is a breaking change. Request: https://github.com/dart-lang/sdk/issues/33501

HttpHeaders use lowercase by default for all headers, since it is supposed to be case insensitive. Some servers incorrectly treat case as significant, however, and expect headers with capitalization or in uppercase. The current implementation forces headers to be lower cases when adding values. Users cannot even manually modify the headers.

This change removes this restriction here so that users can modify the headers to whatever form they want. The new behavior is backwards compatible except if class was implemented. All headers inside http.dart are written as lower cases, adding values to HttpHeaders is still receiving lower cases input.

The other cl (https://dart-review.googlesource.com/c/http_multi_server/+/121411) migrates multi_headers.dart to be compatible with this change.

Bug: https://github.com/dart-lang/sdk/issues/33501
Change-Id: I6f7f2ef907b229773c283140c07f2de4cd500981
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119100
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-01-31 17:08:52 +00:00
Zichang Guo 0ed9f7179d [vm] seperate error and unknown types for getStdioHandletype
Infer other types as kPipe which is sync with Win platform.

Bug: https://github.com/dart-lang/sdk/issues/40354
Change-Id: I8bf40a143573685833a689ff2c724a421b308234
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133623
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-01-31 17:07:22 +00:00
Jonas Termansen f6e0200523 [nnbd] Migrate dart:io to NNBD.
The Process class will now throw a StateError if the process is detached
upon accessing the stdin, stdout, stderr, and exitCode getters.

The Socket class will now throw a SocketException if the socket has been
destroyed or upgraded to a secure socket upon setting or getting socket
options.

Bug: https://github.com/dart-lang/sdk/issues/40040
Change-Id: I68e22873932c68a3fac549c0f742dd49d0a60dfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133060
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-01-30 15:46:08 +00:00
Martin Kustermann 37d562d2a4 [vm/async] Ensure --lazy-async-stacks also works inside custom zones with error handlers
Issue https://github.com/dart-lang/sdk/issues/37668

Change-Id: Ib7fb8299fbc8b7f73e154414f37451a488297a67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133583
Auto-Submit: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2020-01-29 11:17:50 +00:00
Srujan Gaddam 7db61c6b01 Changing the dart:html generator scripts to generate null-safe/nnbd code
Change-Id: I4a8b097b126864366076b1e73cf3e0296600380e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128376
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-01-29 00:20:42 +00:00
Zichang Guo 06fa701c95 [http] fix hanging when parser failed to parser body of response/request
* Some cleanups on http parser.
* When parsing body of the http response/request, errors should not go to _controller, where it is paused. This leads to hanging.
* Fix another bug: (byte < 0x30 && 0x39 < byte)

Bug: https://github.com/dart-lang/sdk/issues/40132

Change-Id: Iaf3fb6a409c92889f50b86220a2c6c2318012c47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132964
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-01-28 23:43:42 +00:00
jonahwilliams 96ff3276f4 [vmservice] allow fallback on port bind failure
Work towards https://github.com/flutter/flutter/issues/46724

Background:

on the latest versions of iOS today, we have to use mdns to discover the observatory port and authentication code. For a variety of reasons this can fail, leaving us with no way to connect.

An alternative approach is to specify the observatory port and disable the authentication code. If binding to this port fails, however, we would still like to attempt connecting with mdns.

Overview:

This adds a new flag to the dart SDK, --enable-service-port-fallback. This amends the behavior of the vmservice with a specified port. After failing to bind 3 times to a non-zero port, update the port selection to 0.

Results:

Tested locally two dart VMs with the same specified port:

```
jonahwilliams@jonahwilliams0:~/Documents/engine/src/out/host_debug_unopt$ ./dart --enable-service-port-fallback --observe=8080 example.dart
Observatory server failed to start after 1 tries
Falling back to automatic port selection

vm-service: isolate(2785434094928835)  'main' has no debugger attached and is paused at exit.  Connect to Observatory to debug.
Observatory listening on http://127.0.0.1:45663/62A5IHjmv9E=/
```
Change-Id: I582ab402a457330928e5b490f9718fcd52b56720
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133434
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
2020-01-28 23:36:14 +00:00
Arun 3efd623849 Fixes failure of x86_64 builds for android
This fixes #39838

Closes https://github.com/dart-lang/sdk/pull/40328
https://github.com/dart-lang/sdk/pull/40328

GitOrigin-RevId: 3794c3875cc2c2a5ab6360ed3a86eb2ada3114e1
Change-Id: Iebc8927b9d758c3d1ec36f038819276abb0091c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133401
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-01-27 14:21:26 +00:00
Jonah Williams cdeb9a7a8c Revert "[vmservice] allow fallback on port bind failure"
This reverts commit 6ff7e9ebad.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [vmservice] allow fallback on port bind failure
> 
> Work towards https://github.com/flutter/flutter/issues/46724
> 
> Background:
> 
> on the latest versions of iOS today, we have to use mdns to discover the observatory port and authentication code. For a variety of reasons this can fail, leaving us with no way to connect.
> 
> An alternative approach is to specify the observatory port and disable the authentication code. If binding to this port fails, however, we would still like to attempt connecting with mdns.
> 
> Overview:
> 
> This adds a new flag to the dart SDK, --enable-service-port-fallback. This amends the behavior of the vmservice with a specified port. After failing to bind once to a non-zero port, update the port selection to 0.
> 
> Results:
> 
> Tested locally two dart VMs with the same specified port:
> 
> ```
> jonahwilliams@jonahwilliams0:~/Documents/engine/src/out/host_debug_unopt$ ./dart --enable-service-port-fallback --observe=8080 example.dart
> Observatory server failed to start after 1 tries
> Falling back to automatic port selection
> vm-service: isolate(2785434094928835)  'main' has no debugger attached and is paused at exit.  Connect to Observatory to debug.
> Observatory listening on http://127.0.0.1:45663/62A5IHjmv9E=/
> ```
> 
> Change-Id: I371583edcb603325428f1cb760992e39b9f3b6dc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130441
> Commit-Queue: Jonah Williams <jonahwilliams@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,jonahwilliams@google.com

Change-Id: I337b2d549e33ef9c616c276a48ce894a14b1c317
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133327
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
2020-01-24 21:47:34 +00:00
jonahwilliams 6ff7e9ebad [vmservice] allow fallback on port bind failure
Work towards https://github.com/flutter/flutter/issues/46724

Background:

on the latest versions of iOS today, we have to use mdns to discover the observatory port and authentication code. For a variety of reasons this can fail, leaving us with no way to connect.

An alternative approach is to specify the observatory port and disable the authentication code. If binding to this port fails, however, we would still like to attempt connecting with mdns.

Overview:

This adds a new flag to the dart SDK, --enable-service-port-fallback. This amends the behavior of the vmservice with a specified port. After failing to bind once to a non-zero port, update the port selection to 0.

Results:

Tested locally two dart VMs with the same specified port:

```
jonahwilliams@jonahwilliams0:~/Documents/engine/src/out/host_debug_unopt$ ./dart --enable-service-port-fallback --observe=8080 example.dart
Observatory server failed to start after 1 tries
Falling back to automatic port selection
vm-service: isolate(2785434094928835)  'main' has no debugger attached and is paused at exit.  Connect to Observatory to debug.
Observatory listening on http://127.0.0.1:45663/62A5IHjmv9E=/
```

Change-Id: I371583edcb603325428f1cb760992e39b9f3b6dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130441
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-24 20:28:15 +00:00
Alexander Aprelev 1960cef002 [io/file_watcher] Unregister watched pathId when handle is closed.
When file watching stream reports an error, it will close the handle too after sending "closed" event out to the listeners. Listener should not attempt to do anything with that handle(kept as pathId in the listener). In particular it should not attempt to call that handle to unwatch when user of the listener requested to cancel the listener.

Further fixes for https://github.com/flutter/flutter/issues/46616

Change-Id: Iccc100e294b11d3999ad68e775ef1ceb1d7a5efb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133180
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Zichang Guo <zichangguo@google.com>
2020-01-24 18:19:14 +00:00
Lasse Reichstein Holst Nielsen a0a0580a56 Update iterator.dart to fully spec moveNext()
The `moveNext` docs should contain all the information necessary to implement it. There is otherwise no mention that this method is also used to set `current` to the initial element.

Closes https://github.com/dart-lang/sdk/pull/39676
https://github.com/dart-lang/sdk/pull/39676

GitOrigin-RevId: c921486f7e104d7fad5b10ba2744f01b0a814dbc
Change-Id: I06736889c6e904e17027f27b7c5831eff495ce1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127455
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-01-24 16:17:29 +00:00
Lasse R.H. Nielsen fc3af737c7 Update typed-data constructor documentation.
Make it explicit that the allocating constructors allocate precisly the
needed amount of bytes.

Fixes #40261

Bug: http://dartbug.com/40261
Change-Id: I059a9e3e387fee116e2221a0761557aedc948aee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132844
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-24 09:53:26 +00:00
Clement Skau da1e42a11c [SDK] Fixes async* stack unwinding.
For `foo() async* {}` frames we find the "caller" by finding out
what closure is registered as listener on the _AsyncStreamController.

There can be two cases:

a) The caller does a regular `foo().listen((_) {})`:
  The stack trace will have the closure as the caller and unwinding stops.

b) The caller uses 'await for (... foo())':
  In this case the listener will be a StreamIterator.

This CL changes our unwinding code to get the awaiter of `await it.moveNext()`.


Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: I13f76025a15682aaf55fd968088fc2059982d842
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132841
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-24 09:04:56 +00:00
Alexander Aprelev 2d0f2d6991 [io/file_watching] Skip unwatching if listener has been closed already.
Attempt to unwatch closed handle results in crash.

Fixes https://github.com/flutter/flutter/issues/46616

Change-Id: Ia7f9fdea4782300e775ef91712754b462bba1ded
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133082
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-01-23 20:53:49 +00:00
Ryan Macnak 3aabdc8d23 [test] Run some service tests in AOT.
Tests involving breakpoints, stepping, evaluation or coverage are expected to fail.
Tests involving introspection, heap analysis, extensions, timeline events or profiling are expected to pass.

 - Fix crash when `debugger` is called.
 - Fix crash when metrics are queried.
 - Replace unnecessary use of `eval` with `invoke`, allowing more tests to run on AOT, AppJIT and simulators.

Bug: https://github.com/dart-lang/sdk/issues/40274
Bug: https://github.com/dart-lang/sdk/issues/40275
Change-Id: I3023af7cbfda745238c487d9a3a3a99e56a30244
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132942
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-23 17:52:40 +00:00
Ryan Macnak b07b710b93 [lib] Be explicit about the type parameter for positional argument lists.
Widen `reflect` and `setField` to accept dynamic. `Object` will soon no longer be a top type, and dynamic is more consistent with other reflective inputs and `reflectee`.

Bug: https://github.com/dart-lang/sdk/issues/40045
Change-Id: Ic1e3a26aaea5de078cc616846cb52417c7975d11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132720
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-22 21:36:03 +00:00
Lasse R.H. Nielsen 0c71fb2d95 Add new constructors to TypedData classes.
The new constructor creates a view of a (sub range) of the elements of another TypedData object.
It works for both typed lists and ByteData.

The advantage over the .view constructors is that it handles other views properly, including their
offsetInBytes in the start computation, which it is easy to forget to do when you call

  SomethingList.view(other.buffer)

directly, and that constructor cannot compensate for the information because it only existed on the object
that the buffer was extracted from, not on the buffer itself.

Change-Id: I8abafbf2a81a32ea67f5d4c0f65dcfea08b49bb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127321
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-01-22 14:39:48 +00:00
Lasse R.H. Nielsen 98bafeeb3a Include [AssertionError.message] in [AssertionError.toString] value.
Fixes #40245
BUG= http://dartbug.com/40245

Change-Id: Ice1e9ff2cd37d32a16918ca2464d2637203361ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132640
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-01-21 14:18:32 +00:00
Vijay Menon 5a5f4010d5 [js] cleanup old dart:js / js_util files
These files have been moved to standard locations in earlier CLs to prep for NNBD migration.
We'll need to cleanup Flutter and internal references to these files before landing this CL.

Change-Id: I965c2395f3ccf88e5628e5f4e24d28be81b15b39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131841
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-21 14:06:32 +00:00
Alex dae1a28884 Fix: Typo in elementAt() method description
Closes https://github.com/dart-lang/sdk/pull/39981
https://github.com/dart-lang/sdk/pull/39981

GitOrigin-RevId: aae2ce577ec133a9c604182e1531be5604f2a81a
Change-Id: Ied889bd8bede949f727e867913dee7df25f2aa14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130182
Reviewed-by: Michael Thomsen <mit@google.com>
2020-01-21 12:13:16 +00:00
David e7b1392b02 Fix documentation for Stream.isEmpty
Closes #38510
https://github.com/dart-lang/sdk/pull/38510

GitOrigin-RevId: 108733d588e2188039ec5ae498c56658977cd0d6
Change-Id: I0e3a6dc2f8a2cce79f25fc93c0465858b7da25bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118375
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-01-20 10:59:12 +00:00
asiva 7e6939643d [VM/patch libraries] - Fix analyzer errors/warnings.
Change-Id: Ia3a7df0801df3b17685df0389a299acb4134d972
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132307
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-18 02:37:08 +00:00
Mayank Patke d7784dd889 [dart2js] Fix typo: handleIdentifer -> handleIdentifier.
Also add util for `!==`.

Change-Id: Ic93b542a08db25ec93846a47ea46f8b48d65a71f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131960
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-01-16 21:55:08 +00:00
Michael Thomsen 49c55ffd85 Update the API docs readme
This updates the readme, which is shown at https://api.dart.dev/

Closes https://github.com/dart-lang/sdk/pull/40187
https://github.com/dart-lang/sdk/pull/40187

GitOrigin-RevId: b02e01d5097d9f45ad8627f103ee5591af3c1f05
Change-Id: Ic1f66fa0bb539f13f1c0c117d9d74b5ac26f6617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131980
Reviewed-by: Kathy Walrath <kathyw@google.com>
Commit-Queue: Kathy Walrath <kathyw@google.com>
2020-01-16 21:23:09 +00:00
Stephen Adams b099832be9 [js_runtime] Check Rti on JSArray is from same program
Bug: 40152

Change-Id: Ie54192e61dc255c02483142b606ab0a31e28a0b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131902
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-01-16 19:45:03 +00:00
jonahwilliams db0665223c [sdk] remove (hopefully) dead type checks
Update/Remove checks of the form:

ReturnType methodName(Type type) {
  if (type is! Type) throw ArgumentError(...);
}

Post Dart 2 transition, these checks can now only account for the condition when type is null (though some are redundant with other null checks). Using "is" checks is unnecessary and likely adds a small overhead over a straight null check, in addition to a worse error message.

Since the nnbd SDK declares many of these types to be non-nullable, the checks can be entirely removed. In the regular, SDK I've replaced them with null checks. I'm not sure if this quite follows the intention of the nnbd_sdk.

Change-Id: Icccdd7d7eba4b6c9d08fbc9b6c127ce38cc0b78d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129986
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-01-16 17:03:56 +00:00
asiva 1564d596bb [VM/isolate] Migrate 'dart:isolate' and patch files for NNBD
Change-Id: I1e894815599d9b1dbb0551428eb7a679a23edd6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131483
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-15 18:09:04 +00:00
Vijay Menon 4a488b16b7 Reland "De-dup js_util between ddc and dart2js"
Fixes the original CL by restoring files temporarily needed by Flutter (until cleaned
up on Flutter side).

Change-Id: I2561339c797e1d5168646e59782ca0fcd10d79af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131582
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-15 02:08:04 +00:00
Ryan Macnak e0c366a3c8 [vm] Update dart:mirrors for Dart 3.
Also back-ports all non-type changes to the Dart 2 version for the sake of testing.

Bug: https://github.com/dart-lang/sdk/issues/40045
Change-Id: Idda6b6c5e8508efe4db79f27f41d0a2485b9f197
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131485
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-01-15 00:56:24 +00:00
Vijay Menon 43ceb5c6a2 Revert "De-dup js_util between ddc and dart2js"
This reverts commit 2a7789de18.

I forgot to revert the deleted files - this is breaking flutter hhh.  Will reland properly tomorrow.

TBR=sigmund@google.com

Change-Id: I76ff774e34167b3a35315dbf4883b22dd1499837
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131560
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-14 04:36:54 +00:00
Ben Konyi 83fba7bd54 [ VM ] Move vmservice_io code from runtime/bin to dart:_internal/vm/bin
Change-Id: I3966366268ac88c0bc3b639fc76ae543cde5653c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131502
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-01-14 01:42:14 +00:00
Stephen Adams 5169a52b2a Use @patch for List.of factory constructor
This will permit List.of to be specialize for the different platforms.

Change-Id: I63583566354625b683d0897da619fc8cd23d0b7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131281
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-01-14 00:17:33 +00:00
Vijay Menon 2a7789de18 De-dup js_util between ddc and dart2js
Change-Id: I2fc3e676eda71bfb1dce4844fa9a3d16d301fcac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131262
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-01-14 00:11:43 +00:00