Commit graph

982 commits

Author SHA1 Message Date
Nicholas Shahan e36fbfd978 [ddc] Add basic symbol information for classes
Module symbol information now includes basic details the classes
compiled in the module.

Add tests and refactor to share some of the options for running the
incremental frontend compiler and ddc.

Change-Id: I6d3eb16bd6fb70c4c0af46de93a0f7bf96151c4f
Issue: https://github.com/dart-lang/sdk/issues/40273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202865
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2021-06-16 23:48:28 +00:00
Sigmund Cherem 01a6b4fb12 [ddc] delete kernel_sdk.dart.
This was used to build the sdk long ago. Last year (in April!) we removed
the last use of it internally, so the file can now be removed. At this
point both internal and external build systems use the compile platform tool.

Change-Id: Ib92b2ae4b0b3f1b7b7ec4bc6dd50ad2723016ec4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186661
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-02-24 00:11:02 +00:00
Sigmund Cherem 06a4b109bc [web] Delete check_nnbd_sdk test
Change-Id: Ia55f76a57adbe2e133ad9e049e1201bec5094b53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186660
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-02-24 00:04:29 +00:00
Alexander Markov 9d4ad8a14b [core lib] Add unimplemented int.operator >>>
This change adds a placeholder for int.operator >>>.
No implementation is added yet.

This change unblocks implementation of this operator in
the backends (VM, dart2js, DDC).

Issue: https://github.com/dart-lang/sdk/issues/44912
Issue: https://github.com/dart-lang/sdk/issues/30892
Change-Id: I9912ca9f44d594e9c5fa91f5fc65e807fe48cc7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185480
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2021-02-22 00:02:47 +00:00
Lasse R.H. Nielsen d352bc28b8 Remove (most) uses of the "non-nullable" experiment flag.
Since the flag is now enabled by default, there should be no mention of it.
There are still some uses in front_end/testcases that are not just removable
(it also uses `no-non-nullable`). There migth be more uses that are not
as easily found as grepping for `--enable-experiment

Removes two VM tests where fixing them meant they were just duplicating
the corresponding non *_2/ tests.
Fixes #44941

TEST= Large number of tests chaged.=(no-)?non-nullable`.

Change-Id: Ief755981ccde9a5482fcdf408c2929c74433a710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183688
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-12 17:16:54 +00:00
Nicholas Shahan 2b4a3b082b [ddc] Merge remaining diffs in dart_library.js
- Copy the internal version of dart_library.js without any changes.
- Unblocks syncing this file again.
- Update ddb script to use the dart2js preamble for d8 which includes
  assignment of a global `self` and the fake event loop for better
  error handling.

Change-Id: I01c2ad82fe7c36bb393f9eab897f558daabf6b8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181522
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-02-01 19:55:49 +00:00
Sigmund Cherem 8b0fba90a6 [web] Make check_nnbd_sdk less noisy.
This change does a small fix to exclude line numbers from the golden
files produced by check_nnbd_sdk.dart. Doing so helps keep the golden
file more stable and less likely to require updates when developers make
unrelated changes to the core libraries.

There are very few failures that remain and now that the CFE is more
mature, we may be in a position to stop using the patch-sdk mechanism to
test the validity of the migrated sdk.

Change-Id: Id41448f23871d0a43257db5dbf5b0b062e2eaddd
Bug: https://github.com/dart-lang/sdk/issues/44491 https://github.com/dart-lang/sdk/issues/44618
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178726
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-01-12 02:10:30 +00:00
Sigmund Cherem e997621c0f [dartdevc] small cleanup tweaks to the ddb tool
Change-Id: I4691fbe24d94f7efca03c1c3c40a0a8cac20082c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176983
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-12-23 22:16:36 +00:00
Sigmund Cherem 368d9f375f web: fix js-number patches to avoid assignment errors
Change-Id: Ie4ae4b1aa1a67a0153168d30d27d16d005c564a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176483
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-12-17 04:35:53 +00:00
Lasse R.H. Nielsen e40ae3ba25 Add missing @Since markers on unmodifiable set additions.
Change-Id: I84e94736a425d45b6b1334e90f7991fa31070713
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176240
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
2020-12-15 18:48:41 +00:00
Oleksii Khomchenko 64226729c1 [corelib] Add Set.unmodifiable backed by an UnmodifiableSetView
UnmodifiableSetView does not have backend specific implementations
(simillar to UnmodifiableMapView, unlike UnmodifiableListView).

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

Change-Id: I041bb6dc95d6a67a395ca75581ffe8e5933acdc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164103
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-12-10 11:00:27 +00:00
Stephen Adams 35c7ebba1f [js_runtime] Specialize JSArray.addAll for JSArray input
Change-Id: I80b648a1a7c1cafb871618ccf57901047a374c19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175344
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-12-09 05:23:08 +00:00
Lasse R.H. Nielsen 6e29700e16 Update List constructor documentation, deprecate constructor.
Emphasize that the operation is going away,
and mark constructor as deprecated.

TEST= Refactoring+deprecation only, covered by existing tests.

Change-Id: I82aa044cd2cf7bf347b624371399f44bda8f4a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173261
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-12-07 16:20:28 +00:00
Nicholas Shahan bfe8aa8d5b [ddc] Add option to throw null safety violations
Allows sound-like null safety when running mixed applications in weak
mode.

This is not a specified option and is only intended to assist large
scale migration efforts.

Change-Id: Icd0abb0e876d16e719a01e8381eef55a2b511051
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171821
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2020-11-16 22:58:50 +00:00
Aske Simon Christensen 1ab705f60c [vm] Require all recognized methods to be marked with pragma.
Adds a @pragma("vm:recognized", <kind>) to all recognized methods, where
<kind> is one of "intrinsic", "graph" or "other", corresponding to the
kind of recognized method.

When running in debug mode, it is checked that all recognized methods
are marked with the correct kind of pragma, and that all methods marked
with the pragma are in fact recognized.

This enables kernel-level analyses and optimizations to query whether
a method is recognized by the VM.

TEST=Asserts that check the correspondence both ways, covered by test
suite, in particular the various CompileAll tests that compile all code.
Change-Id: I12f3305c72a93ecb1aefae2d66e3d9a7dae23b44
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168951
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-16 13:49:50 +00:00
Stephen Adams 8c13fa841e [dart2js] Kernel transformer expansion for List.generate
Simple calls to `List.generate` are expanded into a list allocation
and a loop. This generates better code for several reasons:

 - There is no overhead for the function argument (closure allocation,
   closure type, closure class)

 - Global type inference is more precise since each List.generate list
   is tracked separately, and the assignments in the loop give better
   inference to the collection's element type.

To get precise element type inference, there are two new JSArray
constructors. Global type inference starts with the element type being
bottom for these elements, avoiding spurious nulls in the inferred
type.

Change-Id: I5efb90651ae3f9eb2e81af556704960cdf0b75c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168770
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-11-11 04:27:22 +00:00
Nicholas Shahan 1869a54132 [ddc] Update ddb to run with ddc/legacy modules in d8
- Fixes broken benchmarks in ddc because the benchmarks run in
  d8 with the ddc module system can handle conflicting library
  names more gracefully than es6.

- In the future we need to update the source of truth for
  dart_library.js so we can keep the file in sync.

- Removes the ability for ddb to run with any precompiled sdk.js
  from a dart installation. Now you must run a build first and
  the sdk.js files from that build will be used. This means the
  `--debug` flag no longer changes which sdk.js files are used.

Change-Id: Icaf78956f93ff643d23e68001354ec08c9c28b12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166926
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-10-24 00:14:42 +00:00
Lasse Reichstein Holst Nielsen f264f6a451 Fix bad DartDoc in Set.toSet documentation.
Change-Id: I1801d4d8f3f25c76885f3482ae1553d32e6ee15b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168828
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-10-23 11:18:12 +00:00
Lasse Reichstein Holst Nielsen 48c73d82bf Clean up annotations and update @override documentation.
Fixes #43622

Bug: http://dartbug.com/43622
Change-Id: I4adea2995146ecd317d5c90a514cb564afa4f846
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165800
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-10-20 15:56:13 +00:00
Nicholas Shahan 6b84ac8d0f [ddc] Optimize creating native typed data lists
Connect the type hierarchy with the missing (compared to the
dart2js versions) of the JSMutableIndexable class.

Avoids an extra copying of all data to a temporary list during
the construction just to get access to the index operator.

Change-Id: I8a9f8ba4d956ac49d6fb635709d11a6e7c018270
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166782
Reviewed-by: Mark Zhou <markzipan@google.com>
2020-10-16 21:21:42 +00:00
Nicholas Shahan 0376746d84 [ddc] Optimize list operations
Avoid redundant element casts and checks if the list is growable.

Change-Id: Ib915ccf2ec65fbe7d32ecaabe23899f2530617c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166781
Reviewed-by: Mark Zhou <markzipan@google.com>
2020-10-16 21:21:42 +00:00
Leaf Petersen e85bf740ef Opt pkg/dev_compiler out of null safety.
Change-Id: I62207a436605480b6981b8b00bf7b88d8589db0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166980
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-10-12 23:25:42 +00:00
Sigmund Cherem 22c3d24f77 [ddc] allow stack trace to be visible when running ddb with d8
Change-Id: I97017bfdf113c4815e2d634c55c017d4b433fcbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164602
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-09-26 00:35:14 +00:00
Srujan Gaddam f4f53ca252 [ddc] Add nullability assertions for native values
Bug: https://github.com/dart-lang/sdk/issues/42535

Adds a runtime flag to ddc to enable runtime checks on native APIs.
In the case where an API is typed non-nullable but returns a null
value, throws a null assertion error.

Change-Id: I4d5d7529ba28d9308687dad5d51f1b9c71274455
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162461
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-09-25 01:32:43 +00:00
Paul Berry 08dd4b1faa Null-safe numbers: implement static typing rules, hook up for binary operators.
Future CLs will hook up the static typing rules for method calls
(`clamp` and `remainder`) and will implement the rules for contexts.

Bug: https://github.com/dart-lang/sdk/issues/42629
Change-Id: Iccfb1fa1ac9aff6c0832d65e4835b5b9bd51a804
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158501
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-08-24 15:34:33 +00:00
Konstantin Shcheglov 39e4dfe571 Update experimental_features.yaml, set experimentalReleaseVersion for non-nullable.
Bug: https://github.com/dart-lang/sdk/issues/43032
Change-Id: I28b27b3416826abd807a185b2d4214782571fb98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159383
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2020-08-20 01:38:48 +00:00
Konstantin Shcheglov 2b7fc8f134 Update FeatureSet to the new rules.
Bug: https://github.com/dart-lang/sdk/issues/43032
Change-Id: I6c7d7dc56fd0d4edcc3c6f6cc6fb0422316b8f4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159187
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-19 18:27:37 +00:00
Konstantin Shcheglov ebd5b622ba Add DartSdk.languageVersion
Bug: https://github.com/dart-lang/build/issues/2763#issuecomment-666707445
Change-Id: I8232bd395abc9efea0e5c27716450d6a5442b3bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156489
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-04 21:01:09 +00:00
Nicholas Shahan 5c141df638 [ddc] Add self reference to ddb bootstrap scripts
Fixes the JS interop tests/benchmarks that expect the global
window.self to exist when running in d8 or node.

Change-Id: Id3eed6cdffb97560d61781e11d97d63edf74232d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156782
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-08-04 17:00:59 +00:00
Nicholas Shahan 40b880ee61 [ddc] Fix import names in ddb script
Some benchmarks are located in directories named with characters
that are invalid in js identifiers. To generate bootstrapping that
loads these modules import the module builder and use the same
naming method that ddc uses.

These names are directly tied to the version of ddc that produces
them. This solidifies the fact that we really can't rely on using
the ddb script to run ddc from a different commit/build.

Change-Id: I92349d70134886de63686d88f5eab9da12b4021f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156820
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-08-03 18:38:01 +00:00
Nicholas Shahan 0f7add33bd [ddc] Pass an empty list as args in ddb script
This brings ddc to parity with dart2js when running benchmarks
and fixes a crash in the migrated Utf8Decode benchmarks.

In the future we might reject programs based on the signature
of the main method or introduce runtime errors but that is
still under discussion
https://github.com/dart-lang/language/issues/1120.

Change-Id: I594f60e887ce05ef7074c72cbbe379c0d526707e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156361
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-07-30 16:07:18 +00:00
Konstantin Shcheglov 8de8a1c226 Move codes from StaticTypeWarningCode into CompileTimeErrorCode.
They are all errors now.

Change-Id: If48d38e38e845fd5b5a950dd5514bf1cbbce03d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-27 16:44:15 +00:00
Kevin Moore 966078df3a Fix a number of outdated references to dartlang.org in doc comments
Eliminated several links to content that no longer exists

Change-Id: Icd7bf5796a061882ba384e39d78d5f8ff429696d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154362
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
2020-07-15 01:11:03 +00:00
Nicholas Shahan 7478143e5f [ddc] Inline the sound null safety flag
Now that the sound null safety mode is a compile time flag
instead of a runtime flag there is no need to set the value in
the bootstrapping code before running main(). The sound and weak
versions of the sdk now have it already set.

Add compileTimeFlag() method that will inline the constant value
directly into the generated output.

Change-Id: I5b9243c47cffc421067ac820ef49342b9d0efff9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154100
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-07-13 22:45:19 +00:00
Nicholas Shahan 2280e77f52 [ddc] Fix copy paste error in ddb script
Change-Id: I17e8c72369a5b9331dcceaa29343f6596e7440b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153821
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2020-07-09 17:10:04 +00:00
Nicholas Shahan b524f398c3 [ddc] Add option to run non-null asserts in weak mode
* Setting the nonNullAsserts flag in the bootstrapping logic will
  enable/disable failing when a null value is passed to a non-nullable
  method parameter when running with weak null safety.

* Move the --null-assertions from VM options to the shared options in
  the test and use it to set the flag in DDC the entry point.

* Configure other backends to ignore the flag.

Change-Id: Ia2670514bed7fa981564e99b85d74f6bae6dd9fc
Fixes: https://github.com/dart-lang/sdk/issues/42404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151306
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-07 21:48:40 +00:00
Nicholas Shahan 7ac8f426ff [ddc] Update flags in ddb script
* Start using --sound-null-safety in ddb script To be more consistent
with the finalized naming.
Legacy mode: No flags
Weak mode: --enable-experiment=non-nullable
Sound mode: --enable-experiment=non-nullable --sound-null-safety

* Remove --kernel flag. It's been ignored since analyzer based DDC
was removed.

Change-Id: I1349f7852927e65b1574637a96f68123f1f9741a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153387
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-07-07 19:44:40 +00:00
Jonas Termansen 0d1db38cf8 [ddc] Only print blank line in ddb if verbose.
The blank line clobbers the output if ddb is used in non-verbose mode
to execute a program where the stdout ordinarily belongs to the program
in question whose output might be machine parsed.

Change-Id: Ie929d19deabebb7b1f3d24f99035aec2d9844a64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153208
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2020-07-07 17:36:12 +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
David Morgan 1d3fbbed7c Revert "Fix duration.toString() to conform the description"
This reverts commit 038e981f89.

Reason for revert: Breaks some tests; visible changes to some web UIs.

Original change's description:
> Fix duration.toString() to conform the description
> 
> Duration.toString() should return in a format of "HH:MM:SS.mmmmmm".
> But when `hours` is less than 10, toString() doesn't have the leading
> zero, which is "H:MM:SS.mmmmmm".
> 
> The corresponding co19 issue: https://github.com/dart-lang/co19/issues/733
> 
> Bug: https://github.com/dart-lang/sdk/issues/41737
> Change-Id: I2264171b2b37e89056695f7f821125a5f78d87fb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151163
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

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

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

Bug: https://github.com/dart-lang/sdk/issues/41737
Change-Id: I4d7ef5de9807e8e2b2a77c2171d1693b7527f671
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151848
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-06-22 10:29:15 +00:00
Zichang Guo 038e981f89 Fix duration.toString() to conform the description
Duration.toString() should return in a format of "HH:MM:SS.mmmmmm".
But when `hours` is less than 10, toString() doesn't have the leading
zero, which is "H:MM:SS.mmmmmm".

The corresponding co19 issue: https://github.com/dart-lang/co19/issues/733

Bug: https://github.com/dart-lang/sdk/issues/41737
Change-Id: I2264171b2b37e89056695f7f821125a5f78d87fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151163
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-06-19 22:52:30 +00:00
Stephen Adams 1596bf3cd4 [js_runtime] Remove js_rti.dart
Change-Id: Ie28cca1b3b869e3bba55bbbd6ac8071ce22fb310
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151800
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-06-18 21:11:12 +00:00
Jago 7d863d7266 Doc: DateTime accepted format for parsing date
Add to the inline documentation the most simple and often most used simple date format that can be parsed, that was missing.

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

GitOrigin-RevId: 03e6d955961a2fc8b0eab5c9e46f4212ef470c9a
Change-Id: Ia2a5e8376a3741d34dbd27ceb6f39d986687bfee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150507
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-06-17 08:43:23 +00:00
Leaf Petersen d44457f79d [Core Libraries] Eliminate the fork in the core libraries.
Move the nnbd core libraries from sdk_nnbd to sdk, and updates
references in build files and elsewhere accordingly.

Change-Id: I09760fe1e006657aacdfe80f3b22fdf6f7e30a9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151121
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-06-16 23:37:36 +00:00
James Lin af054ee91c Adjust documentation to various functions
* Adjust `exit()` documentation to mention `finally` and to further
  emphasize that calling `exit()` does not pass Go and does not
  collect $200.

* Adjust `DateTime.difference` documentation to clarify the sign of
  the returned `Duration`.  Fixes https://github.com/dart-lang/sdk/issues/36347.

* Adjust `String.lastIndexOf` documentation to clarify what is
  returned.  Fixes https://github.com/dart-lang/sdk/issues/41893.

Change-Id: I6ed91e8c79a647928ced7e8f0268a62ed92fbd4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149494
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2020-06-12 20:16:39 +00:00
Nicholas Shahan 2ed302bfbb [ddc] Update ddb script to use SDK js from gen dir
When running ddb with `--debug` pull the SDK .dill and .js files from
ReleaseX64/gen/utils/dartdevc and require.js from third_party/require.

Change-Id: Ibcfd5e1d32c39cca3583cfef14fe8393e0846d69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149886
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-06-04 21:10:39 +00:00
Nicholas Shahan 72e559929f [ddc] Add --sound-null-safety flag and pass to CFE
https://dart-review.googlesource.com/c/sdk/+/149080 is required to
get errors if you try use weak .dill files when passing the
--sound-null-safety flag.

Added a new build target to copy the sound SDK outline .dill to
dart-sdk/lib/_internal. This is only part of dartdevc_test right
now. We will decide in the future if we are going to include this
in the released SDK or if we will have the build systems create
them as needed. For now in testing scenarios it appears to be part
of the SDK.

Change-Id: I3b31a894841f59b437658104e7ee9443ee67db93
Fixes: https://github.com/dart-lang/sdk/issues/41694
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146962
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-05-29 01:16:18 +00:00
Ben Konyi c4b7097e97 [ VM ] Migrate VM tests to support null safety and return errors from Dart_GetType and Dart_NewListOf when --null-safety is enabled
These methods return legacy types, which aren't valid with null safety
enabled.

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

Change-Id: I1181f0f3b9a8df156dea4dc4c82fef8afdf97ab9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148685
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-05-26 22:40:52 +00:00
Konstantin Shcheglov 2231b8c580 Use AllowedExperiments in analyzer.
Bug: https://github.com/dart-lang/sdk/issues/41741
Change-Id: Iba0face7198f4ecc17c86d2fcb0630912db7ba60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148648
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-20 20:42:31 +00:00