Commit graph

73862 commits

Author SHA1 Message Date
Aske Simon Christensen bbcdc8dcff [benchmarks] Migrate Utf8Decode benchmark.
Change-Id: Idc5288c3df2e12e2a9d29c3102549531d46e4ff4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153081
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2020-07-01 16:53:11 +00:00
Alexander Markov 9ae1448ef0 [benchmarks] Add more test cases to ListCopy benchmarks.
This is the follow-up for the discussion on
https://dart-review.googlesource.com/c/sdk/+/152700

Change-Id: Ifeeafcdc312c4f7df7e0be1cc806b972b8c18078
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152709
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
2020-07-01 16:01:40 +00:00
Brian Wilkerson 8cc3d415e7 Integrate suggested changes from the PR to publish the docs
Please look this over carefully; all of your changes have been integrated,
but not all of the changes are yours. While itegrating your suggestions I
found a few more occurrances of 'is not' and 'are not' that I converted.
I also found a couple of other things that needed to be updated.

Change-Id: Iddaaa22d7e584506bc3c16606166771fd5a75caf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152942
Commit-Queue: Kathy Walrath <kathyw@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
2020-07-01 15:58:11 +00:00
Aske Simon Christensen d56c85f6f9 [benchmarks] Migrate RuntimeType benchmark.
Change-Id: I41e97ac2eb703ba3898bfa70ce8a60946d75ee70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153082
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2020-07-01 15:40:01 +00:00
Yurii Nakonechnyi 024f243cec [vm/ffi] Signature mismatch fix of Pointer::New()
Closes https://github.com/dart-lang/sdk/pull/42451

GitOrigin-RevId: aeb31b9c8ad47cf059966287118532a07377482f
Change-Id: I96e5c0f813a0a71e381c887ae4f94b5554d37772
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152105
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2020-07-01 15:12:31 +00:00
Paul Berry 63feed82e1 Rename FlowModel.removePromotedAll to .conservativeJoin.
This makes the implementation consistent with the spec text in
1ed6bab4cc.

Change-Id: Ie25b928c5aacb45a18e85c6f9196b5b55f083478
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152983
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-07-01 13:46:48 +00:00
Eric Dallo 6d3928554c Add lsp-dart to lsp_spec README
https://emacs-lsp.github.io/lsp-dart

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

GitOrigin-RevId: cfa8edf358669c3ec2324a726a848fbc548bb6a3
Change-Id: Icaa90cdbb462b51fae6c186fe7626ca6168b9599
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152820
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-07-01 13:15:22 +00:00
Johnni Winther 236f3f820d [cfe] Fix flow analysis in initializers
The handling of null shorting in the variable initializer interfered with
the declaration of the variable, making subsequent flow potentially
losing track of promotions.

Closes #42504

Change-Id: Idb17920ffe8746983825714f76160abcca54751b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152760
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-01 08:57:18 +00:00
Martin Kustermann 964497731c [vm/compiler] Remove seemingly unused function in precompiler
Change-Id: I4af05386c76a4c5a9b023254a0091a62ba60682f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152845
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-07-01 08:46:08 +00:00
Erik Ernst 1d264c53e4 Adjust nnbd tests that return voidy expressions
Change-Id: I3c9fb55e49630372d232d1dcf12ab323badac42a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152846
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-07-01 07:31:28 +00:00
Johnni Winther 7f1f32904c [cfe] Handle extension on nullable type
.. when the property already exist for the non-nullable type.

Change-Id: Ic083de134ea73592de4d68fb3ecc06ddf8398d65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152331
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-01 07:27:28 +00:00
Erik Ernst 41c9fb6a19 [CFE] Type infer aliased factory invocations.
This CL adds support for type inference on type aliased invocations of
factory constructors, redirected as well as non-redirected, and it adds
some tests using this feature.

Additionally, this CL resolves a couple of issues that arose when the
directory nonfunction_type_aliases was migrated to null-safety (by
means of two single line fixes, in 'usage*_test.dart').

Still missing: The shadow nodes should be eliminated in
_unaliasTypeAliasedConstructorInvocations and
_unaliasTypeAliasedFactoryInvocations, this will be done in a separate
CL.

Change-Id: Ic146bd16a02ca8f79c46b7df7c8dff7712f21189
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152740
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-07-01 07:19:08 +00:00
Johnni Winther cd1b375bbb [cfe] Handle ...?null
Closes #42304

Change-Id: Ia0c8eb101373bd5342e24e4303212997e4b2729f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152656
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-01 06:57:28 +00:00
Robert Nystrom bec128612c Add dart_internal to the null safety allowlist.
It always should have been there, but we just missed it.

Change-Id: Ie18203c96d065ac1bd58fba28d6dbcd657b18a72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152987
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-07-01 02:52:57 +00:00
Srujan Gaddam ff8f128a76 [dart:html] Update console interface
Closes https://github.com/dart-lang/sdk/issues/42213

Adds nullability to Console, adds missing methods and cleans
cleans existing ones up, and removes a stale template. Most
modifications are derived from https://console.spec.whatwg.org/
and the rest are derived from the MDN.

Change-Id: I26a099b15e53a4748afb61c7532bdbf64d7c4d6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151091
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-06-30 23:32:27 +00:00
Devon Carew fc1999de15 [dartdev] Implement --enable-experiments for dart run and dart pub run.
Related to https://github.com/dart-lang/sdk/issues/42339.

Change-Id: I3fdeee33dcad0ca031f483e2e3692be300392958
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152960
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-06-30 23:22:42 +00:00
Konstantin Shcheglov d49a98b866 Simplify FeatureComputer and improve for location before named arguments and with spaces.
Change-Id: Ie2b383078ab79ecc6ac9634f9f38534f0c22c707
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152989
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-30 23:17:37 +00:00
Konstantin Shcheglov 7ee4dd1be5 Prepare to publish analyzer 0.39.11 and _fe_analyzer_shared 5.0.0.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ia7cb0355c2595ba6f84f19f6f62b468ccd6d7d72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152986
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-30 23:14:37 +00:00
Konstantin Shcheglov db61737086 Simplify CompletionPerformance.
R=brianwilkerson@google.com

Change-Id: Iff0cf3b8b684f72d8a32b3fe4b9493295c11d59b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152985
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-30 22:45:27 +00:00
Konstantin Shcheglov 99cc566afc Clean up ArgumentList tests for FeatureComputer.
R=brianwilkerson@google.com

Change-Id: I50c880ba5e60b8a5ba4b80f0fe0da7097eb2cb9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152733
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-30 21:26:22 +00:00
Nate Bosch 25d6c349b9 Update to latest package:stack_trace
Fixes a bug parsing `data:` URIs from VM style stack frames.

Change-Id: I16ef95f0b7f0a7c97b9d30bf38ae766f3702f4c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152981
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2020-06-30 19:01:44 +00:00
Suraj Malhotra dbb4e7d7f3 [alln][fdio] Move //zircon/system/ulib/fdio to //sdk/lib/fdio
Bug: 54057
Change-Id: I190b6d44b483352287fb7c7f0e875b134b5e0316
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151809
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-06-30 18:59:34 +00:00
Alexander Markov e2e1820c33 Bump ABI version
Fixes https://github.com/dart-lang/sdk/issues/42516

Change-Id: Id6bd07ad1d8ea2e151b0d908edfc98f24dc3a791
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153001
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-06-30 18:33:54 +00:00
Nate Bosch d64cf16cf2 Avoid throwing an exception for hasTerminal
See https://github.com/dart-lang/test/issues/1261

Throwing and immediately catching an exception has negative implications
for debugging and pausing on thrown exceptions. The exception is not
needed provided we duplicate a small bit of knowledge - that the
function to retrieve terminal size would return a non-list.

Change-Id: Ic92f7c0480d58963e857c699aa0251eedeb3e627
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152922
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Zichang Guo <zichangguo@google.com>
2020-06-30 18:16:04 +00:00
Konstantin Shcheglov c0a7ee9b65 Issue 42007. Don't report UNNECESSARY_CAST when casting from a star to question type.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/42007
Change-Id: I1c7f353a4e5a18c028d2a1c746ec76c916fcaaa3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-30 17:59:44 +00:00
Konstantin Shcheglov c4503f0074 Use OperationPerformance to track performance in CompletionPerformance.
R=brianwilkerson@google.com

Change-Id: I50158512020be87b3c51363ed2e503c3df3cfaae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-30 17:44:54 +00:00
Alexander Markov e6cbfd71f1 [vm/corelib/nnbd] Fix null check in _GrowableList.length=
We should verify that element type is nullable every time length is
increased, not only when capacity is increased.

Fixes https://github.com/dart-lang/sdk/issues/42502

Change-Id: Id91c702a99028634da8c2d41ae0ceac521af2cf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152900
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-06-30 17:14:14 +00:00
Nicholas Shahan 97ba0acc72 [ddc] Check for a Never bound before normalizing
Change-Id: I3d2ab592d3f6fb0bb7c89974501240de7d67c9b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152185
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-06-30 17:13:14 +00:00
asiva b8adfa4ffc [Tests] : port remaining isolate tests for null safety.
- Some of the package config tests for isolates were not ported in the
  initial round, this CL ports these tests.
- lib_2/isolate/isolate_stress_test.dart is not ported as it is
  currently skipped for the VM and was probably intended to be a
  dart2js test.

Change-Id: I53c3641d2a83f2661ecdb8cd57a8c381234b06d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152940
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-06-30 17:04:44 +00:00
Paul Berry 22da8934ac Migration: properly handle extension override syntax.
There were two problems:

- EdgeBuilder wasn't handling the extension override syntax at all,
  causing a crash.

- FixBuilder wasn't overriding the behavior of
  ExtensionElement.extendedType, causing a star type to be used as a
  context for the target expression; this prevented the fix builder
  from realizing when it needed to insert `!` after the target
  expression.

Fixes #42455.

Bug: https://github.com/dart-lang/sdk/issues/42455
Change-Id: I5a9f66f83db73a796e72708022faefd527667e32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152941
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-30 16:00:47 +00:00
Daco Harkes 585fa217a1 [benchmarks/ffi] Migrate benchmarks to NNBD
Change-Id: I36568f4f4d59c0a337aab82b6ca15d40495cb269
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152850
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2020-06-30 14:44:27 +00:00
Daco Harkes f0851772e9 [benchmarks/ffi] Fix lints
Change-Id: I37fe24f122ed9da269be658b9f98b957ddfcb7fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152848
Reviewed-by: Clement Skau <cskau@google.com>
2020-06-30 14:44:27 +00:00
Aske Simon Christensen 0549295eb4 [vm/aot] Partition table selector IDs based on hierarchy connectedness.
Compared to assigning selector IDs purely by name, this improves the
packing of selector rows, reducing the in-memory size of the dispatch
table by typically around 20% (75k memory usage reduction for Flutter
Gallery on ARM64).

It also improved tree shaking of methods called (or rather, not called)
via dispatch table calls, reducing the total snapshot sizes of Flutter
benchmarks by up to 2.1% (Flutter Gallery: ARM 1.8%, ARM64 2.1%).

Fixes https://github.com/dart-lang/sdk/issues/40660
Fixes https://github.com/dart-lang/sdk/issues/41647

Change-Id: Ia9ecfb0818b301bcbad631c377f3910b0a5956de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152323
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-30 14:03:37 +00:00
Clement Skau 34dbe66e7d [SDK] Clean up tools/utils.py. Style; Py2/3 compatible;
- Imports __future__.print_function to make printing consistent and
  robust across Python versions.
- Removes do-nothing os.path.join()s.
- Replaces all " with ' for consistency.
- Further gathers all "consts" and helpers at the top.
- Replaces old-style modulo formatting operator with new-style .format().
- Removes redundant if-return-else-return patterns for readability.
- Parameterises several subprocess cwd instead of hardcoded values.
  This should make it easier to use with other paths (g3 builds).
- Adds decode()'ing to process output to convert bytes to strs.
  This stops json.dump crashing in Py3. As well as Golem crashing in gn.
- Style, formatting, etc., etc.

Change-Id: I2bd7136aa18b12c4b18d9260f1539f16630065a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152842
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2020-06-30 13:22:30 +00:00
Jonas Termansen 5001e461ea [benchmark] Test null safe options.
TBR=athom@google.com

Change-Id: Ic3ea7969ea486f646669e0cff6bb59385bc927c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151843
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-06-30 10:31:26 +00:00
Vyacheslav Egorov 96e8fa9cb5 [vm/compiler] Do not notify observers if we failed to create code.
CodeObservers don't expect to be notified with `null` code object.

Change-Id: I4ebbe021f827faf9e01b5b3c3734470433e14787
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152803
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-06-30 07:10:56 +00:00
Vyacheslav Egorov 49d733ebc3 [vm/aot] Fix handling of dynamic calls through getters
When discovering getters which might be potentially hit by a dynamic
call through a getter we need to ignore method extractors.

DispatchTableGenerator eagerly creates some of the method extractors
and these extractors were accidentally pulled in by
CheckForNewDynamicFunctions(): if there is an dynamic invocation
of `foo` in the program we would compile all getters `get:foo` 
because `x.foo()` might be a dynamic call-through-getter `x.foo.call()`.

However this logic should not apply to method extractors because
`x.foo(...)` would never hit an extractor for `foo`, it would
hit method `foo` itself.

Removes 15K (0.04%) of total uncompressed code size on a large 
internal application.

Issue https://github.com/dart-lang/sdk/issues/41647

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: I46e5f06fe4a3ee6efe61ed0f36675837a728e031
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152804
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2020-06-30 07:07:36 +00:00
Paul Berry 019755f77b Flow analysis: simplify marking of loop-assigned variables as not-unassigned
At the top of a loop, loop-assigned variables need to be marked as not
definitely unassigned, otherwise we will give incorrect results for
code like this:

```dart
f() {
  late int x;
  bool firstIteration = true;
  while (true) {
    if(firstIteration) {
      x = 0;
      firstIteration = false;
    } else {
      print(x); // BOGUS ERROR: x definitely unassigned
    }
  }
}
```

Previously, we were handling this by calling `joinUnassigned` at the
bottom of `removePromotedAll`, but it's simpler to just mark these
variables as not-unassigned while discarding promotions.  This change
will make the implementation more closely match spec changes I'll be
making shortly.

Change-Id: If50e28d20a75730aa5187a62ae5cac8690b0dfaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152861
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-30 02:46:26 +00:00
Regis Crelier 892f38259f Roll benchmarks-internal to 2d9d76e04ce0a997ad3eb4e5e320e89e727af8a5
Change-Id: I1b017ee2e61e9c58ed57de0e9a38d82874d65637
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152924
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-06-30 00:26:44 +00:00
Brian Wilkerson 3fe9867ae2 Add a fix for prefer_final_in_for_each (issue 42510)
Change-Id: Iebac9c2854eaf40dd7c177d5357172dfcafa6806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152618
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-29 19:20:23 +00:00
Brian Wilkerson 46a2fa6b99 Unify two error codes for diagnostics
Change-Id: I5714cec5e47b67e1a4be2f2895fa9cc96e869c45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152732
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-29 18:58:03 +00:00
Konstantin Shcheglov 12f1d68ee3 Move OperationPerformance out of Cider to use it wider.
Change-Id: I9e1669c650b23d02e645ef3b19bfd9e15c7f54ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152735
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2020-06-29 18:42:44 +00:00
Nicholas Shahan ee9dba1217 [ddc/dart2js] Add failure case when setting list length
NNBD spec states expanding the length of a list of non-nullable
elements should produce a runtime error.
https://github.com/dart-lang/language/blob/master/accepted/future-releases/nnbd/feature-specification.md#core-library-changes

Add private method `_setLengthUnsafe()` as a replacement for the
existing length setter to call internally when it is known to
be safe that skips the checks.

This breaks the corelib/list_test but it needs to be rewritten
pending a decision regarding the `ListMixin` implementation.
See: https://github.com/dart-lang/sdk/issues/42496

Issue: https://github.com/dart-lang/sdk/issues/39777
Change-Id: I081451227b332b68bb75bf08f3268e360bae090c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152423
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-06-29 18:39:43 +00:00
Zichang Guo f4a00be96e Update Duration.toString() description
This is a reland of https://dart-review.googlesource.com/c/sdk/+/151163.
The reported problem is a mismatch between actual behavior and
description. The original cl tried to fix the bahavior but it broke many
external users. Given the fact that the old behavior has been widely
accepted and used, updating comments might be the correct thing to do.

This cl will update the description of toString() to be sync with its
behavior.

Bug: https://github.com/dart-lang/sdk/issues/41737
Change-Id: I899a346647c268c2dd4e582f9a9f44a3d2286720
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152060
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-06-29 18:23:13 +00:00
Konstantin Shcheglov 76852100ea Test UNNECESSARY_CAST for FunctionType(s) and NullSafety.
R=brianwilkerson@google.com

Change-Id: I1e6cee6b0c574f93a31a0eb14f68b2cfb1c1fd78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152734
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-29 17:57:39 +00:00
Konstantin Shcheglov 6e9aa86d6f Stop using AnalysisOptions.signature and multiple paths in SdkDescription.
Basically reduce it to a single path.

R=brianwilkerson@google.com

Change-Id: Ia532a5c7f6ae1464b77c5e9d23b3aaa7e85a6bf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152710
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-29 17:50:14 +00:00
Konstantin Shcheglov e77e270cc2 Make all parameters of ExperimentalFeature constructor named required.
Change-Id: Ib0af7526923653992c13002c808197cc16ffa98b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152619
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-29 17:49:33 +00:00
Danny Tuppeny e8e366714c Rename "Sort Directives" as "Organize Imports" in the quick-fix
Fixes https://github.com/Dart-Code/Dart-Code/issues/2552.

Change-Id: I5591b3fa7b0e2c03e104b16f878689cf2e8caa4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151514
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2020-06-29 16:38:13 +00:00
Aske Simon Christensen 3c3a00f331 [vm] Adjust internal UTF-8 encoder to match dart:convert.
The breaking change https://github.com/dart-lang/sdk/issues/41100
changed the UTF-8 encoder to encode unpaired surrogates as replacement
characters.

However, the VM contains its own, internal UTF-8 encoder, which is used
for printing and for the Dart_StringToUTF8 function in the Dart API.
Here, this encoder is changed to also encode unpaired surrogates as
replacement characters.

Fixes https://github.com/dart-lang/sdk/issues/42094

Change-Id: I9d55168f67d124dbc7987fb759696a98e7526c29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149292
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2020-06-29 16:10:13 +00:00
Clement Skau 46bd867651 [SDK] Clean up tools/utils.py. Order consts, helpers.
This refactoring is being done to make it easier to integrate
this code into internal builds.

It has the added benefit of cleaning up some really wonderful code.

Change-Id: I30f22785cc1f3dec00e01fb809115344284375c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152840
Auto-Submit: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-06-29 15:05:23 +00:00