Commit graph

2629 commits

Author SHA1 Message Date
Jacob MacDonald d9d4e5ccb3 copy package config changes to the modular_suite_nnbd.dart
Change-Id: Ib2c645c0d94adb60693be85b266d23b811982e70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153364
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-06 20:53:11 +00:00
Nicholas Shahan 9547628ecf [ddc] Compare types with new DartTypeEquivalence
Avoids an assertion failure in the front end.

Change-Id: I7994fa611f82011857750cc60af64a2c89c96bf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152923
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-07-06 19:39:31 +00:00
Jacob MacDonald f42889fbb8 create package_config.json files in ddc modular test suite
Copies the same changes as were added for dart2js here https://dart-review.googlesource.com/c/sdk/+/152361/9/pkg/compiler/tool/modular_test_suite.dart

Change-Id: I785b275c62c3d3afb9f37c0b0c8c4e4369b4ccf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153362
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-06 19:33:11 +00:00
Johnni Winther 34f5c9d0b4 [cfe] Implement new async return rules
Closes #41800
Closes #41900
Closes #42134
Closes #42282
Closes #42236
Closes #42169

Change-Id: Ia994bc07fba4e2342fcb59d44fc77608198a328b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152150
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-07-06 07:04:40 +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
Michael Thomsen f0c87e9f21 Clean up no-publish comments in pubspecs
Change-Id: I6cc1ab404de75cd02183b862842198c85b6d9256
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152005
Reviewed-by: Alexander Thomas <athom@google.com>
2020-06-23 10:34:09 +00:00
Nicholas Shahan 7f268aba04 [ddc] Allow DDC to compile SDK from dill
This is the first step to removing all of the the sdks precompiled
to JS modules from the sdk download.

Enables build_runner to produce a JS file on demand from a .dill
file bundled in the sdk download. At this time, only the SDK can
be compiled from a .dill file.

Update build targets to run bin/dartdevc.dart instead of
tool/compile_dartdevc_sdk.dart.

Will delete tool/compile_dartdevc_sdk.dart after we cleanup all
of the uses outside of the SDK.

Change-Id: Id6002675419e8e502912cb3f5b626a0d13461df5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151025
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-06-23 01:08:06 +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
Anna Gringauze c909e16ee2 Added module information to metadata and use by frontend_sever
- created class representing module metadata, added metadata to JsCode
  class
- added module information to metadata, such as module name, load
  function name
- added import and file uris for libraries
- added experimental-emit-debug-metadata flag to frontend_server
- added frontend server tests to check for saved metadata

Related: https://github.com/dart-lang/sdk/issues/41852
Closes: https://github.com/dart-lang/sdk/issues/40774
Change-Id: Iecbbf1e4eea1919e01f002f45363d30707cb1590
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150181
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
2020-06-20 00:40:35 +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
Joshua Litt d14ab0779a [dartdevc] Migrate tests/compiler/dartdevc_native to tests/dartdevc_2.
Change-Id: I9c486f29f3bcf8a6ecf481eb25ea61d0468049b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150667
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-06-17 18:14:00 +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
Johnni Winther 7fce125300 [cfe,kernel] Add AstPrinter
This CL adds a Node.toText method together with an AstPrinter. These
facility and better toString implementation on AST nodes while allowing
for toString independent printing of AST to use in testing. This also
add support for an integrated toString of custom/internal nodes.

Some work is still needed in bringing the toString implementation on
all nodes to the old quality, and not all internal nodes have
customized textual representations yet. This work is left for future
CLs.

Change-Id: Ib0bf8a0bc02f489dfacdc8aa5f96da9c52f26058
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150923
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-06-16 17:15:10 +00:00
Dmitry Stefantsov 929d5e4a98 [cfe,ddc,dart2js,vm] Add FutureOrType
This CL is the sum of the following 5 CLs:
* https://dart-review.googlesource.com/c/sdk/+/149297/
* https://dart-review.googlesource.com/c/sdk/+/149299/
* https://dart-review.googlesource.com/c/sdk/+/149320/
* https://dart-review.googlesource.com/c/sdk/+/149321/
* https://dart-review.googlesource.com/c/sdk/+/149323/

The reason for landing the 5 CLs as one CL is to prevent potential
troubles with bisecting over the branch because the change is fully
functional only with all 5 CLs.

Closes #40123.

Bug: https://github.com/dart-lang/sdk/issues/40123
Change-Id: Ice52250a98acfe455b1d7fa5bb0624c115ca5dac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150934
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-06-15 12:18:46 +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 ee54a343ba [ddc] Fix type parameters in tear offs
Add missing nullability on type parameters in function types of
tear offs.

Change-Id: If56ab42db57d14d0939a03518d5b944548e4065d
Fixes: https://github.com/dart-lang/sdk/issues/42246
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150680
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-06-10 23:49:43 +00:00
Harry Terkelsen 54fe29e965 support @JS annotation from SDK
Attempt at fixing https://github.com/dart-lang/sdk/issues/39740 to allow the flutter web engine to use @JS
interop to avoid the overhead of the SDK available js interop.

Bug: 39740
Change-Id: I7ba9c8981e639cd267bee3086ba900b89bfc0d6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150501
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2020-06-09 17:10:15 +00:00
Nicholas Shahan 092789f1ac [ddc] Fix legacy type in covariance bounds check
There should be no way this could cause an unexpected failure
or break soundness but there is no reason to be marking the type
parameter as a legacy type in the check.

Change-Id: Ib4cf22cacd78d6cb9b55dd6ed594c75aa81ceead
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149887
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-06-04 21:18: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
Johnni Winther a936f3019e [cfe] Embed and use allowed experiments in CFE
This CL embeds the sdk_nnbd/lib/_internal/allowed_experiments.json
into the CFE and uses this to allow experiments enabled on a
per library basis. The file is embedded through generated code to
avoid reliance on access to the file itself.

A presubmit check is also added to ensure that the json file and
the generated code are in sync.

This work is in preparation for https://github.com/dart-lang/sdk/issues/41538


Change-Id: Ic03c0fc69684d124c685f2fe6e80423a7e751530
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149064
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-05-30 09:47:02 +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
Nicholas Shahan d76b5318b4 [ddc] Make amd modules a named function
Apply the same naming used in the ddc module format to amd modules.

Change-Id: Ib766c20cb35c3c6e11a345e45cba5c49f3a34b3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148941
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-05-27 20:44:07 +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
Jens Johansen 4dcf24ac7f [CFE] Use BlockExpression for encoding cascades
Change-Id: I9c56cbed9880716af804c80c6ca34578ae6765a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148528
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-05-26 09:07:25 +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
Anna Gringauze 0218c66698 Emit types during incremental expression compilation
During expression compilation, if the compiled expression is using
a type that was not used in the current function, the incremental
compiler and DDC produce code that refers to undefined types.
To fix that, discharge types created during expression compilation
and add their definitions at the beginning of the generated
function.

Added tests to validate the behavior.

Fixes: https://github.com/dart-lang/sdk/issues/41443
Change-Id: If3fdce85a50ab2590d107f3b9e8c19b4768fd482
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148468
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2020-05-20 18:51:20 +00:00
Nicholas Shahan ab0d67d8db [ddc] Add flag to suppress null safety warnings
Default setting will hide the warnings.

Allow infra to decide if warnings in the browser console will be
shown for null safety errors in weak mode.

Always show warnings when running with weak null safety with our
ddb script and the SDK test_runner.

Change-Id: I7c800b087069390ff374cbc4111334c2df947d86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148238
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-05-18 21:41:06 +00:00
Johnni Winther c10b41a4e2 [kernel] Add DartType.toTypeText and Constant.toConstantText
These are used to provide a testable textual representation
of types and constants that do not rely upon Node.toString.

Change-Id: Iff77ebb44e8299b262f4f263666b2e1d4dd5794b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147909
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-05-18 11:48:20 +00:00
Jens Johansen 7929b4223e [CFE] Fix memory leak via WidgetCreatorTracker
Change-Id: Iebb961955bcd6cf2513cdec6036dfbd126e45231
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148240
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-05-15 14:09:02 +00:00
Dmitry Stefantsov e53e5f2475 [cfe] Separate nullability and declared nullability
For some types it makes sense to distinguish between nullability as a
property of including null and the declared nullability, such as for
type-parameter types and FutureOr types.  This CL introduces the
separation between the two concepts.  The plan is to use that when
implementing FutureOrType.

Bug: https://github.com/dart-lang/sdk/issues/40123
Change-Id: I90b45bea768e89c213d021d360a481d38377c682
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147903
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-05-15 07:38:05 +00:00
Nicholas Shahan a83cbcc94c [ddc] Cleanup "ReleaseX64NNBD" from ddb script
That platform out directory isn't use now that we have unforked.

Change-Id: I8baba2ab25ae4f0d38b2b58ab06d52b90288d280
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148009
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2020-05-13 22:57:33 +00:00
Nicholas Shahan 40c1f17434 [ddc] Fix null check in equality operator
Move null check up so it can return before performing the cast in the
case of a covariant parameter.

Change-Id: I727822751e6613fac635fa49b254b9406eb93e1c
Fixes: https://github.com/dart-lang/sdk/issues/41866
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147812
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-13 21:13:27 +00:00
Nicholas Shahan f916fa6b4e [ddc] Output a metadata file for debugger
Currently hidden behind a flag marked experimental. We need to
define a clear API or process to introduce breaking changes before
we start landing dependencies in packages outside the SDK.

Change-Id: I27ed48c78fc3bad46be92c21c35ae91f4c036784
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144243
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-05-12 19:36:21 +00:00
asiva 03ce33f80c [BUILD] - Initial CL to unfork the NNBD Dart SDK
- Flips the flag from --nnbd to --no-nnbd so that by default it builds
  the NNBD version
- using the --no-nnbd flag results in the SDK being built in a
  directory which has the 'Legacy' suffix added to it
  (e.g: out/DebugX64Legacy)
- the '--enable-experiment=non-nullable' flag still needs to be passed
  in during execution so that CFE runs in that mode. This is different
  from the 'null_safety' flag

Change-Id: I729630a7bd36ea7ae38134f9285b44e93c283c68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138902
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-05-07 21:12:47 +00:00
Leaf Petersen 3437336ed0 Make dynamic catch clauses explicit.
Make the NNBD sdk libraries compatible with the change making the
default type of the error variable in a catch clause Object.

Change-Id: Ic0419980b067fdb1702c0ac9ca2cbc73b27d41b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146521
Auto-Submit: Leaf Petersen <leafp@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-05-06 15:48:34 +00:00
Johnni Winther a2015351c8 [dart2js,ddc] Ensure valid d8 breakpoints in testing
D8 breakpoints used in sourcemap testing should only be set for
test files and not, accidentally, in sdk source files. This
was hit in a dart2js step debugging test where, after unforking,
the line number in the test file accidentally matched those of
print.dart from the sdk.

Change-Id: I6a9c6f5bfd28b8821e9cee9b10cc6c67e4fc689b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146781
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-05-06 14:36:32 +00:00
Nicholas Shahan 525e02fa5e [ddc] Use Null Safety flag in typeAcceptsNull
- Expose the internal runtime flag for the Null Safety mode.
- Add a guard to protect against accidental configurations
  that set the mode multiple times.

Change-Id: I8d16a3c7bd8590ea6f2fee9b6f8c09009898a64b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144991
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-04-28 21:56:48 +00:00
Siva Annamalai 726d3c7725 Revert "[BUILD] - Initial CL to unfork the NNBD Dart SDK"
This reverts commit cab69e7706.

Reason for revert: It was a temporary submit

Original change's description:
> [BUILD] - Initial CL to unfork the NNBD Dart SDK
> NOTE: This is a trial submit and will be reverted immediately.
> 
> - Flips the flag from --nnbd to --no-nnbd so that by default it builds
>   the NNBD version
> - using the --no-nnbd flag results in the SDK being built in a
>   directory which has the 'Legacy' suffix added to it
>   (e.g: out/DebugX64Legacy)
> - the '--enable-experiment=non-nullable' flag still needs to be passed
>   in during execution so that CFE runs in that mode. This is different
>   from the 'null_safety' flag
> 
> Change-Id: I7d25d9710818af5919c0bb83abe51153172f5886
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144880
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=asiva@google.com

Change-Id: Ib0f99fc1a42c9c7a8b21f8542f4a35dba9105d5c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144900
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-04-27 05:00:10 +00:00
asiva cab69e7706 [BUILD] - Initial CL to unfork the NNBD Dart SDK
NOTE: This is a trial submit and will be reverted immediately.

- Flips the flag from --nnbd to --no-nnbd so that by default it builds
  the NNBD version
- using the --no-nnbd flag results in the SDK being built in a
  directory which has the 'Legacy' suffix added to it
  (e.g: out/DebugX64Legacy)
- the '--enable-experiment=non-nullable' flag still needs to be passed
  in during execution so that CFE runs in that mode. This is different
  from the 'null_safety' flag

Change-Id: I7d25d9710818af5919c0bb83abe51153172f5886
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144880
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-04-27 04:59:26 +00:00
Johnni Winther 6c21ed6314 [cfe] Support class hierarchy changes in ChangedStructureNotifier
Closes #40707

Change-Id: I0a9e0b11d0f597dfed7182dd869382057d04e5dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144821
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-04-26 19:51:29 +00:00
Nicholas Shahan 23cbe39355 [ddc] Remove error handler from number parse helpers
This copies the logic from dart2js and brings the two patches closer
together. There is no need to pass the error handler to the helper
function shared between `parse()` and `tryParse()`.

Update JS foreign function types in parseDouble to match the NNBD
version.

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

Change-Id: I85d39f8ba6bd76459cf6263099983b8b96d3a669
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144304
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-04-22 16:07:29 +00:00
Siva Annamalai 63a92a3b00 Revert "This is a trial submit of the unfork CL, it will be reverted immediately."
This reverts commit 393468dc89.

Reason for revert: This was a trial submit and so reverting it.

Original change's description:
> This is a trial submit of the unfork CL, it will be reverted immediately.
> This commit is being done so we can roll it into Flutter and run some device lab testing to see the effect this CL will have on Flutter.
> 
> [BUILD] - Initial CL to unfork the NNBD Dart SDK
> 
> - Flips the flag from --nnbd to --no-nnbd so that by default it builds
>   the NNBD version
> - using the --no-nnbd flag results in the SDK being built in a
>   directory which has the 'Legacy' suffix added to it
>   (e.g: out/DebugX64Legacy)
> - the '--enable-experiment=non-nullable' flag still needs to be passed
>   in during execution so that CFE runs in that mode. This is different
>   from the 'null_safety' flag
> 
> Change-Id: I83c813aee2a5b61ad876d8a7b0988705bb24c839
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144082
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=asiva@google.com,liama@google.com

Change-Id: I7b50fae71764eceb17893338d1981e40ea2de520
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144083
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-04-20 03:50:49 +00:00
asiva 393468dc89 This is a trial submit of the unfork CL, it will be reverted immediately.
This commit is being done so we can roll it into Flutter and run some device lab testing to see the effect this CL will have on Flutter.

[BUILD] - Initial CL to unfork the NNBD Dart SDK

- Flips the flag from --nnbd to --no-nnbd so that by default it builds
  the NNBD version
- using the --no-nnbd flag results in the SDK being built in a
  directory which has the 'Legacy' suffix added to it
  (e.g: out/DebugX64Legacy)
- the '--enable-experiment=non-nullable' flag still needs to be passed
  in during execution so that CFE runs in that mode. This is different
  from the 'null_safety' flag

Change-Id: I83c813aee2a5b61ad876d8a7b0988705bb24c839
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144082
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-04-20 03:46:06 +00:00
Konstantin Shcheglov cf70a46f8e Change the default type of the exception to 'Object' instead of 'dynamic'.
Bug: https://github.com/dart-lang/sdk/issues/41521
Change-Id: I4410bb5b968899b6368eed304e1dfb84f4451554
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143980
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-04-18 01:33:17 +00:00
Nicholas Shahan 9ae942b083 [ddc] Use dynamic as default for top type bounds
For the cases of implicit bounds like `<T>` the default value
should be `dynamic` when instantiating and no type parameter is
provided. This change fixes this cases.

For explicit bounds like `<T extends Object?>` or
`<T extends Object*>` the default values should be `Object?` or
`Object*`. This change breaks these cases by defaulting to
`dynamic`.

Filed: https://github.com/dart-lang/sdk/issues/41539

I believe this is the correct trade off right now because the
implicit bounds like `<T>` are more likely to appear compared to
`<T extends Object?>` or `<T extends Object*>`.

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

Change-Id: I53a22cf9de2d200f628f3ac0f6b0a6b1ab9ba3fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143442
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-04-17 17:51:58 +00:00
Stephen Adams 74e28e7703 Avoid 'late' for timer
Change-Id: I7cf9ef01437cc30a41bd8d0d73e6c10c07296bc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143441
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-04-15 06:32:19 +00:00
Nicholas Shahan 1ce773c67f [ddc] Hoist all legacy and nullable types
As a possible performance improvement types are hoisted to top
level variables where they can be used from anywhere in
the program.

Change-Id: I93cee0b6e582e9218dae5b15b2b8816e7c64153b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142905
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2020-04-10 17:50:45 +00:00