Commit graph

10063 commits

Author SHA1 Message Date
Lasse R.H. Nielsen 44baaf13b6 Allow code samples to *continue* a prior sample.
We have added more examples, and some of them uses the structure of:
````dart
/// ```dart
/// var x = something;
/// ```
/// and then you can also floo the thing
/// ```
/// x.floo(...);
/// ```
````

The following chunks of the same example can now be written as:

````dart
/// ```dart continued
/// x.floo(...);
/// ```
````

Change handling of imports,
and introduce a `top` template different from `none`.

The `none` template gets nothing for free.
The sample must be completely self-contained.
Is triggered by the sample containing a `library` declaration,
because we can't add anything before that.

The `top` template allows top-level declarations,
but does introduce automatic imports and "samples can expect"
code if the sample doesn't contain `import`s.
Is triggered by top-level declarations other than `library`.

Also some restructuring of the code to make this feature easier
to implement.

Change-Id: If2288147face01efad2ad656aa52183cb4c8b3bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221343
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2021-12-02 16:37:57 +00:00
Jukka-Pekka Siitonen 65a3e2eb4c Documentation update for Set class
New examples added, small updates to existing documentation

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

GitOrigin-RevId: 599777c3e6d53daef19f4af58161fb79b8db36f9
Change-Id: I905cf6a9249db553a5ec9b8657726589da66d888
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221403
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2021-12-02 15:58:49 +00:00
Jukka-Pekka Siitonen 922d2d8d7b Documentation update for Stopwatch
Added example for Stopwatch

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

GitOrigin-RevId: 51fd1a9567090f22b42f59114330b3ce1f1e7a10
Change-Id: I6a497b6b9cf7ab9c120572b6bfd7a551a2016f59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221402
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-12-02 15:41:32 +00:00
Daco Harkes 734eb8e891 [cfe/ffi] Support missing Abis in NativeTypeCfe
When ABI-specific integers are introduced, their mappings can be
partial. We need to account for this in the transformation and the code
we generate.

In the transformation, all sizes and offsets become nullable.
In the generated code we add `null` constants and a call to check
whether the value is not-null at runtime.

Note that with only this CL we can not generate nulls yet, because all
size and offset mappings are still complete.

TEST=pkg/front_end/testcases/nnbd/ffi*
TEST=tests/ffi*

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

Change-Id: I80d45f3f52001670bc0679a033f7daa22198d55e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221631
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-12-02 12:10:27 +00:00
Daco Harkes 663357209c [vm/ffi] Introduce Abi
This introduces the application binary interface (ABI) concept to
`dart:ffi` as a class with opaque instances.

We will use this for providing mappings for ABI-specific types.
Bug: https://github.com/dart-lang/sdk/issues/42563
Bug: https://github.com/dart-lang/sdk/issues/42816
Closes: https://github.com/dart-lang/sdk/issues/45254

Later, we might open up the contents of `Abi` if need be.

Some API design discussion notes:
https://github.com/dart-lang/sdk/issues/42563#issuecomment-981774001

TEST=tests/ffi/abi_test.dart

Change-Id: Iebf290fc12f37d6f4236432ddf27ab3e12bde06d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221627
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-12-01 19:19:37 +00:00
Ryan Macnak ae5def7b0d [test] Account for new locale string returned on macOS.
TEST=ci
Change-Id: I29bf54c8a75c016a11921ce78c60076009d347ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221720
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-12-01 00:22:45 +00:00
Brian Quinlan db9d61f3af Fix a bug where no error message was set for peer disconnects.
TEST=Manual. AFAIK, the cause of this error is the socket receiving a TCP RST from it's peer and, AFAIK, I can't do that from Dart.
Bug:  https://github.com/dart-lang/sdk/issues/47766
Change-Id: Ia423ee951b96bdb140c321fbc87b6bd59e39d84d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221222
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2021-11-30 23:20:16 +00:00
Gabriel Terwesten 02549a8bce [vm/ffi] Optimize Pointer<T>.asTypedList()
This change refactors `_asExternalTypedData` into multiple functions,
which are data type specific, e.g `_asExternalTypedDataInt8`.
These functions are implemented as recognized methods.
Argument checks have previously been performed in the removed
runtime entry implementation of `_asExternalTypedData.` These are
now handled in Dart.

TEST=tests/ffi/external_typed_data_test.dart

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

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

GitOrigin-RevId: 65763bddd06c633583b4adbf920c32c5a7a3720f
Change-Id: I703b350d89004ebe36e70eaa44dda1d9ebb050c7
Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,app-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221360
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-11-29 17:38:04 +00:00
Jukka-Pekka Siitonen d7e55c4d1b Documentation update for SplayTreeMap and SplayTreeSet
Code examples added for SplayTreeMap and SplayTree set, minor text updates.

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

GitOrigin-RevId: d043550a23da2699a84e360c20cf4915ae87d59f
Change-Id: I09dae91347ef66324056eaf12f26e4547b047817
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220483
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2021-11-26 15:41:16 +00:00
hacker1024 ede839fbf7 Mention Object.hashCode in the note about LinkedHashSet in the Set documentation
The note about `LinkedHashSet` in the `Set` documentation is a little misleading, and it can lead developers to implement `==` without `hashCode`, only to be confused when their set doesn't work correctly.

See this [StackOverflow question](https://stackoverflow.com/questions/69664073/dart-comparison-of-objects-within-a-list/69694646#69694646), for example.

This PR mentions `Object.hashCode` along with `Object.==` in the `Set` documentation explaining `LinkedHashSet`.

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

GitOrigin-RevId: 110a2d8181d4cdce90a576a7d0b5de523f0da6e6
Change-Id: Ic141383d5fa9fa2f9f733611df714041f783e1d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217861
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2021-11-26 14:29:23 +00:00
Stephen Adams 12dae45e5a [corelib] Properly check radix in BigInt.toRadixString.
Change-Id: Ieb1b541db3c35984f4a75b618f9df1c82f4d37da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221201
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-11-25 22:53:53 +00:00
Jukka-Pekka Siitonen a98368c250 Documentation update for LinkedHashMap
Added example code blocks for LinkedHashMap class and includes some minor textual updates to comments.

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

GitOrigin-RevId: 86bded093f3304169aa97d7d6d0e64932ad184be
Change-Id: I8aa18dc04fb67498277c214916a3076428244a00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220301
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-11-25 15:31:25 +00:00
Jukka-Pekka Siitonen 3875e69a79 Documentation update for LinkedHashSet
Example code added for LinkedHashSet and small text updates to file

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

GitOrigin-RevId: 4adb1a8de63d3f8fbefa8f3deaa488608f781e87
Change-Id: I4a3054b3cafbeebce54bebbf95a7536cc7d43545
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220521
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-11-25 15:27:33 +00:00
Jukka-Pekka Siitonen a39c72c02e Documentation update for LinkedList
Example code added for LinkedList

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

GitOrigin-RevId: 12abe1196e415eba4d04e4af664ce488e710a266
Change-Id: I00ae7d11ffbbe6d4efe746619794db456df7a4f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220522
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-11-25 15:26:21 +00:00
Jukka-Pekka Siitonen e2a81d790d Documentation update for ListQueue and Queue
Code examples added for queue usage

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

GitOrigin-RevId: 699fecc8d4f49755008d0e9e7aff59c5edec6642
Change-Id: Idc16e25fd19838e5d9c1c2b0917ba2776e8001c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220486
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-25 15:26:05 +00:00
Jukka-Pekka Siitonen 7467e15c43 Documentation update for HashMap
Added example codes for HashMap - small updates to description text.

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

GitOrigin-RevId: 807b2dd4b1d6d76089001105c2eb30149f59fa81
Change-Id: Iaf83fb38695e85663fe42035b64d0b4d82187ec5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220500
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-25 15:25:45 +00:00
Jukka-Pekka Siitonen 89e052ed2f Documentation update for HashSet
HashSet example code added, update to description of class and minor text updates

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

GitOrigin-RevId: 4ce6de9451f837ec362265082bae80d0587b7167
Change-Id: I6d67a40e20c3ae7894593250649ad4f53907a235
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220520
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-25 15:25:18 +00:00
Michal Terepeta 7d39d2dd51 Revert "[ VM / Service ] Omit private fields from service responses by default"
This reverts commit 75abd86407.

Reason for revert: Breaks internal tests (http://b/207612278)

Original change's description:
> [ VM / Service ] Omit private fields from service responses by default
>
> Service responses and events previously could include "private"
> properties, which have names starting with "_". This change removes
> these properties from service objects unless explicitly requested via a
> private parameter.
>
> See go/smaller-dart-vm-service-responses for response size reduction
> data.
>
> TEST=Existing service suite
>
> Change-Id: Ia65b14872e798eaa843f7d180c57721b82371d0b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221143
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

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

Change-Id: I0b015baadfcdf4211426efa9a92804b163f88649
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221280
Reviewed-by: Michal Terepeta <michalt@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
2021-11-25 10:28:33 +00:00
Ben Konyi 75abd86407 [ VM / Service ] Omit private fields from service responses by default
Service responses and events previously could include "private"
properties, which have names starting with "_". This change removes
these properties from service objects unless explicitly requested via a
private parameter.

See go/smaller-dart-vm-service-responses for response size reduction
data.

TEST=Existing service suite

Change-Id: Ia65b14872e798eaa843f7d180c57721b82371d0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221143
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-11-24 00:34:31 +00:00
Clement Skau 70488fc8f6 [vm] Elaborate on DartDev server error.
This change makes the error message consistent with a similar
message in sdk/lib/_internal/vm/bin/vmservice_server.dart.

Before:
  Could not start Observatory HTTP server

After:
  Could not start Observatory HTTP server:
  Invalid argument(s): A directory corresponding to fileSystemPath "/.../out/DebugX64/devtools" could not be found
  #0      createStaticHandler (package:shelf_static/src/static_handler.dart:50:5)
  [...]

Change-Id: Ie42d39d8c009b4ea403e1584a524567b3da20a45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220742
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-11-19 13:45:38 +00:00
Brian Quinlan 0e5f3f49c3 Fix an issue where rename on Windows would delete the target directory.
TEST=tests updated
Bug: https://github.com/dart-lang/sdk/issues/35217, https://github.com/dart-lang/sdk/issues/47633, https://github.com/dart-lang/sdk/issues/47634
Change-Id: I9582c76e8eb75548ba2d67205353de63d110c294
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219501
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-11-17 19:41:50 +00:00
Simon Binder 0d6c343196 [dart:io] Add overrides for stdio
Add overrides to control the `stdin`, `stdout` and `stderr` getters in
`dart:io`.

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

Change-Id: I6071ad0845df96f8508d2281a6c013f1745ca880
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219792
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-11-17 15:40:15 +00:00
Nicholas Shahan 86d6e30946 [ddc] Delete unused CastErrorImpl class
All uses were changed to TypeErrorImpl in
https://dart-review.googlesource.com/c/sdk/+/139490 but the class was
never cleaned up.

Change-Id: I20c0ca1661efda9a98d245e03a56342c6848c38f
Fixes: https://github.com/dart-lang/sdk/issues/41007
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220462
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-11-17 15:13:54 +00:00
Ben Butterworth 33dfe014ee Fix ZoneBinaryCallback documentation
There was a small mistake in the documentation, because it was copy-pasted from `ZoneUnaryCallback` and not fixed.

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

GitOrigin-RevId: 49599cdf2e89d7861378e56a71f69f4e0c47b53b
Change-Id: I621e71cc316798b88ad14f048b75f4fefc427441
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220136
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2021-11-14 23:56:04 +00:00
Riley Porter 11dc2f4ff6 [dart:html] Update Element.dataset documentation
Updates which characters are allowed in the dataset name based on
external documentation, and removes restriction on not allowing the
name to start with `xml`. These restrictions are not enforced in the
name parsing in `_DataAttributeMap`. Note, there is an additional
restriction in our docs which is inconsistent with external behavior
disallowing capital letters.

Change-Id: I4143503b17673be2e038df8647fef7c9ac09e9ba
Bug: https://github.com/dart-lang/sdk/issues/43295
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219180
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-11-12 01:00:41 +00:00
Lasse R.H. Nielsen f029e837d2 Update CHANGELOG/@Since of feature that didn't make 2.15.
Change-Id: Iee1ee36e3de040da2d2508938ba00a7faa1950c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219980
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-11 09:42:21 +00:00
Stephen Adams 8bbf5c9586 [js_runtime] Use Symbol for identityHashCode
Partial mitigation for #47595

Change-Id: I35bc2b80e5b85af5da0707577e4f67434e4b597f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219843
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-11-10 20:30:34 +00:00
Lasse R.H. Nielsen cb4c4f9ea9 Document isValidKey for {Linked,}Hash{Map,Set}.
Closes #26498, #26499

Bug: https://dartbug.com/26498
Change-Id: I9041d4f511d0a4dc8d1315d5c434c2975a43e619
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219780
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-11-10 18:39:27 +00:00
Jukka-Pekka Siitonen 8c74f563e0 Documentation update for JsonEncoder and JsonDecoder class
Added example codes for classes: JsonEncoder and JsonDecoder.
Added example codes for functions: jsonEncode and jsonDecode.

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

GitOrigin-RevId: c3015fb09cd72a3441b338a3266886ed262b03b3
Change-Id: I0a58c95e43421efca34ccda9d776454fddfbdb9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216200
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-10 10:49:24 +00:00
Jukka-Pekka Siitonen 3dd93b705a Documentation update for HtmlEscape and HtmlEscapeMode
Added examples for HtmlEscape and HtmlEscapeMode usage.
Small fixes to texts in file

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

GitOrigin-RevId: c6daa7477982d5a37cfe155780b4f00f8c688748
Change-Id: I82737c8570e31c8e39022c66636282ca776823be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218989
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-10 10:31:14 +00:00
Jukka-Pekka Siitonen 6e59dbc33a Documentation update for Base64Encoder and Base64Decoder
Added example codes for Base64Encoder and Base64Decoder

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

GitOrigin-RevId: 0e1825ea9d07e97e31db5946acf52548094acb0f
Change-Id: Id4ede13732bc8b9d334a3acaed50d48f2bee22e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219261
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-10 09:36:03 +00:00
Jukka-Pekka Siitonen 428d3e83a2 Documentation update for Latin1Encoder and Latin1Decoder
Example codes of usage added

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

GitOrigin-RevId: fcb498e68c2eda793dbec80f50809d1537f688de
Change-Id: I660191b7825d171617c7d27e42d8189c673da38e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219400
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-09 16:09:52 +00:00
Michael Thomsen f7af5c5256 Deprecate dartanalyzer command
Change-Id: I8d2fb8a5dbac0f81c8cad770ccfb2e3bbf2b0880
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219702
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-11-09 13:23:42 +00:00
Jukka-Pekka Siitonen 07cd8ddd5a Documentation update for AsciiDecoder and AsciiEncoder
Example codes added for AsciiDecoder and AsciiEncoder

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

GitOrigin-RevId: fd3a4cfb1ea92c9c47815fcad688da965496cc61
Change-Id: I63c685013edc913c0783621bfe53635e35e741b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219260
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-09 11:59:15 +00:00
Jukka-Pekka Siitonen 93c2aad57d Documentation update for LineSplitter
Adding example of usage

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

GitOrigin-RevId: e2509b50cf4a7285a2ad1aa4435ab5dc178eb634
Change-Id: I1cd79309799d8361c359c4e5194473bc4e46463b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219280
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-09 11:45:13 +00:00
Jukka-Pekka Siitonen 56035a7df0 Documentation update for Utf8Encoder and Utf8Decoder
Examples for Utf8Encoder and Utf8Decoder usage.
Some small text updates done.

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

GitOrigin-RevId: 8fa368882dc4ebcea69faae86bada1fe0ad77fa5
Change-Id: I5fa545128bdbec7b27a1bc35c01d5764ddd2a432
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219281
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-09 11:30:33 +00:00
Lasse R.H. Nielsen 20e9582106 Add Error.throwWithStackTrace function which throws an error and stack.
Allows throwing an error with an existing stack trace, instead of always
creating a new stack traces.

Fixes #30741

Bug: https://github.com/dart-lang/sdk/issues/30741
TEST=corelib/error_throw_with_stacktrace_test.dart
Change-Id: Iea77b4a8eb5e0cab4cd0d75432d033256c9f79fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219522
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-11-08 15:51:32 +00:00
Nate Bosch 0309dc1be2 Inline _rootHandleUncaughtError
Change-Id: I835dad92d6b2fbc5e1c806a72d5775808514b79c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218063
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-11-08 14:22:12 +00:00
Riley Porter 2d67574d61 [dart:html] Clean up docs for Node insertBefore and insertAllBefore
Changes `refChild` to `child` to match parameter name and makes
`insertAllBefore` consistent with `insertBefore`. Also adds a
description of behavior given a null `child`.

Fixes: https://github.com/dart-lang/sdk/issues/46603
Change-Id: I280306018ee16fa9088d55110ef502f49ed1d66a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219122
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-11-05 20:58:23 +00:00
Martin Kustermann 6225f46b76 [vm/concurrency] Update documentation of SendPort.send to be more precise
In addition to making the documentation of [SendPort.send] more precise
by describing what objects are disallowed for sending objects between
isolates within the same isolate group, it also makes [Isolate.exit]
link to [SendPort.send].

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

TEST=Updates documentation only.

Change-Id: I9bc1d88faaf2b70589af5e56168976ba89a35558
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219080
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-11-03 22:07:03 +00:00
Daco Harkes ed39d3cae9 [vm/ffi] Expand Abis
This CL expands the ABIs in the FFI transform and VM from 3 groups to
18 individual ABIs in preparation of adding ABI-specific integer sizes
and structs.

This increases const lists with offsets in the kernel representation
from 3 to 18 elements. We do not expect significant size increases or
performance regressions from this. The constants are deduplicated in
Dart and the optimizer should optimize indexed lookups in const lists
away. However, landing this separately will enable us to verify that
assumption.

This also moves `Abi` to its own file and makes it an opaque class with
a predefined set of instances so that we do not depend on its internals.
That will enable us to keep `pkg/vm/lib/transformations/ffi/abi.dart`
consistent with the `Abi` abstraction to be introduced in `dart:ffi`
later for specifying ABI-specific integer sizes.

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

List of ABIs decided based on what's currently used (as Dart SDK target
platform, or Flutter target platform, or G3 target) and added
windows_arm64 in anticipation of
(https://github.com/flutter/flutter/issues/53120).
Excluded are macos_ia32 (https://github.com/dart-lang/sdk/issues/39810)
because we discontinued support; and windows_arm, fuchsia_arm,
fuchsia_ia32, ios_ia32, and macos_arm because these are
unlikely to be added.

TEST=pkg/front_end/testcases/*.expect
TEST=tests/ffi/*

Change-Id: I437707c18d8667490c063272a5f8a33d846e6061
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-x64-try,vm-ffi-android-debug-arm-try,vm-kernel-mac-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-ffi-android-debug-arm64c-try,vm-kernel-mac-release-arm64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-android-release-arm64c-try,vm-kernel-precomp-android-release-arm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217184
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-11-03 19:29:03 +00:00
Martin Kustermann dc7e082336 [vm/concurrency] Ensure rehashing of maps correctly resets [_deletedKeys]
When we rehash a linked hash map, we rebuild the index but keep the
existing data array. The [_deletedKeys] specifies the number of entries in the
[_index] which were marked as deleted. The Dart code that triggers
rehashing and initializes a new [_index] didn't initialize
[_deletedKeys].

=> We'll fix this in the Dart code and as a precaution also in the
   transitive object copy code.

Furthermore we add a missing optimization: In the example from the bug
report we shouldn't even have attempted to re-hash, because the maps
have only primitive keys (which do not rely on identity or user-defined
hashcodes).

=> We'll change the existing optimization to ignore deleted entries when
   determining whether a rehash is needed.

The rehashing code for Sets works differently and takes this already
into account.

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

TEST=vm/dart{,_2}/isolates/fast_object_copy_test

Change-Id: I3529ecbf500009ab0c72b98e6c427b8840a69371
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219000
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-11-03 13:36:35 +00:00
Brian Quinlan 5e990591b9 Fix a bug where windows would not currently follow symlinks in stat() calls.
Also clarify documentation.

TEST=Updated tests to cover stats() calls on symlinks.
Bug: https://github.com/dart-lang/sdk/issues/20389
Change-Id: I8555bacc2f83cad024ad8ef7c2f23aa97069ed2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218671
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2021-11-01 16:33:01 +00:00
Kevin Moore 74dea5d1bd _http: Fix final doc comment issues
Change-Id: Ie1ed719aca9b1f18240b811271ac952818d04c89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218664
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2021-10-29 18:02:10 +00:00
Michael Thomsen ae7c027f66 Add library doc comment to dart:cli
Needed to fix broken build:
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8832225116390642513/+/u/build_api_docs/stdout

Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try
Change-Id: I9d1b5a94781de4a4380aebf5ccbabbb0d31a75d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218420
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2021-10-28 10:23:50 +00:00
Kevin Moore 5e866bf841 Improve HTTP docs in dart:io
Recommend folks use pkg:shelf and/or pkg:http
Use async/await in code examples
Remove unneeded `new`

Change-Id: I87d192799cebd88fc0d11c03a7147848bc45efa2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217502
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
2021-10-27 18:55:17 +00:00
Michael Thomsen 1f392b39b5 Expand exit() docs
Change-Id: Ibb72fe6904db55e09d8737b5f8af50c4d6a0b167
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218140
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2021-10-27 13:55:17 +00:00
Michael Thomsen 83d1ad76ff Enable API docs for dart:cli
Clarify this is supported, but deprecated, and may get removed
in the future should we find a suitable replacement.

Bug: https://github.com/dart-lang/api.dart.dev/issues/81
Bug: https://github.com/dart-lang/sdk/issues/39390
Change-Id: I1304a0862986ae1b365a063ee75f0041341523f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214620
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-10-27 09:47:41 +00:00
Nicholas Shahan cc9353ac46 [ddc] Tag classes with names of static members
Temporarily add names of static members so they can be accessed by the
debugger. Eventually, these will be accessible through the symbol data
and should be removed from the compiled Javascript.

This increases the size of the compiled output by ~1% in a large
google3 application.

Names and types of static members were originally removed from the
compiled output in https://dart-review.googlesource.com/c/sdk/+/48455
because they are not needed for runtime correctness.


Change-Id: Idfd827ececec80d903586917676ec027e2a5a9e8
Issue: https://github.com/dart-lang/sdk/issues/40273
Issue: https://github.com/dart-lang/webdev/issues/1430
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217501
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-10-25 21:53:20 +00:00
Kevin Moore 913ca2a5d3 dart:_http: cleanup implementation of crypto
Remove unused members
Add return types to functions
Use Uint32List instead of List<int>

Change-Id: I0772467075978aabfa65c07eb4f457e5c7db2bff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217803
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2021-10-25 16:34:11 +00:00