Commit Graph

2821 Commits

Author SHA1 Message Date
Jacob MacDonald 52fd18ac42 Remove multiRootOutputPath special case for package: uris
This was added for the case where the package root is the file system root, but it causes problems for other cases.

Removing this for now, there are no uses yet.

Change-Id: I99cee2d0b9cc8aac63ce4b4ff7f2e25ffc9c21b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133085
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2020-01-23 20:57:54 +00:00
Nicholas Shahan ca260cefdf [dartdevc] Update FutureOr is, as, and _check methods for NNBD
Change-Id: I27a3318f741bba429ed4790f9024ebaea6bfc45b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132743
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-23 20:21:19 +00:00
Nicholas Shahan 22c0c9fd83 [dartdevc] Fix nullability wrapping for Never and Bottom types
Created helper for emitting the nullability wrapper around a type. I'm also
using this helper as a way to reduce the number of places we check if the
null safety experiment is enabled to make that easier to cleanup in the near
future.

Change-Id: I928d098b9bdadd96759026f49c58c8fc86cf1aae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132940
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-01-22 22:25:59 +00:00
Vijay Menon 528edcf6a9 Add node-source-map-support for better web stack traces during testing
Change-Id: I9e500c4e47819d77c4c81a1027e6665a34d3fd29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132520
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-21 22:09:19 +00:00
Jacob MacDonald 76323794b6 code review updates from https://dart-review.googlesource.com/c/sdk/+/132300/6 that I forgot to upload
Change-Id: I99ae4416a57595399cdd158eb47445594cb25996
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132742
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-01-21 21:51:29 +00:00
Vijay Menon 038931666b [dartdevc,nnbd] include dart:developer and dart:isolate in built sdk
Change-Id: Icd400895c896b4652f41fdf0a8b36af57084782c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132421
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-21 18:33:27 +00:00
Jacob MacDonald 4460f95782 Updates frontend_server javascript bundler to be based on import uri instead of file uri.
Converts `package:` import uris into `/packages/` modules.

Also renames the output modules to append `.lib.js` instead of just `.js`. This allows us to distinguish between modules and applications based on extension.

Updates DDC source map code to be able to convert absolute file uris in sources so that they are relative to the source map.

Bug: https://github.com/dart-lang/webdev/issues/865
Change-Id: I55d70aa3761f10cc8bd7e92f5b567478040660de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132300
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-01-21 17:41:02 +00:00
Sigmund Cherem f910a7575f dart2js nnbd setup
- fixes check_nnbd_sdk.dart to run on dart2js patch files
- splits golden file used by that script by target
- adds it to the old-rti bot (until we get the new nnbd bot)
- adds a suite that runs legacy tests in nnbd weak mode

Change-Id: I0a89534dcd1cf7338849d59ab3e5d989d2ecf3d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131885
Reviewed-by: Vijay Menon <vsm@google.com>
2020-01-21 06:22:51 +00:00
Nicholas Shahan 16a1237dd7 Fix windows path bug and re-enable nnbd sdk patch and analysis test
Fixing the bug on windows felt more trivial than forking the testbot
configurations to avoid running the test on windows.

Change-Id: Ib4cbe72a226aee0083682197a69b2178eea8bea4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132100
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-01-17 23:07:26 +00:00
Vijay Menon 9447686d82 [nnbd] port dart:js_util to nnbd
Change-Id: I5ec29e77dd747aaab28cf3b1b20fd47b21e2d129
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132181
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-17 01:19:35 +00:00
Vijay Menon 8a947deffa [dartdevc] clear console on hot restart
Internal request b/147818704

Change-Id: I08c655c74ea10b6f14ffde8283cbfc286dfae41b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132180
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
2020-01-16 22:07:18 +00:00
Mark Zhou 9b82f1a1f5 [dartdevc] Unbreaking deferred types.
The exact mechanism causing the break isn't obvious but has something to do
with caching withNullability(Nullability.nullable) in _emitInterfaceType.

Kudos to Siggi for pointing out that this change could cause unintended
side effects in https://dart-review.googlesource.com/c/sdk/+/130727
(that I unfortunately didn't heed)!

Bug: https://b.corp.google.com/issues/147802360
Change-Id: I608a7c5485b4301360476439d9240bd5a73d3ad3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132040
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-01-16 20:22:18 +00:00
Vijay Menon 17f80f0d1f [nnbd] port dart:js to nnbd
This tests static analysis on the ddc patch, but not the dart2js one yet.

It also fixes js/null_test.dart to ensure it passes.  Note, that test was broken independent of NNBD.

Change-Id: I5a6bfdfaac845eaba6f154d30f2c1e30199574d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131300
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-16 19:26:18 +00:00
Jens Johansen 128771af8a [CFE] Version 2 of incremental compiler invalidation strategy
Change-Id: Iff860e2665dee64fc005a50237ae890986ddb0f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127896
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-16 07:50:39 +00:00
Mark Zhou 515d4bd7ad [dartdevc] Emitting equality checks that disregard 'legacy' wrappers for type objects.
Currently does not work for function and generic function types.

Type object equality ignores legacy modifiers but preserves other nullability
semantics. This scheme constructs the runtime type object (normalized) at runtime,
caching it if necessary. This avoids the space overhead of emitting canonicalized
normalized types at compile-time but incurs a cost when runtimeType is called
for the first time per recursive subtype.

See: https://github.com/dart-lang/language/blob/master/accepted/future-releases/nnbd/feature-specification.md#runtime-semantics

Change-Id: I76d714c5e618d77f334d90862bb7d3c9b0b8d305
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130727
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-01-15 21:21:27 +00:00
Johnni Winther d08f070b28 [cfe] Add canonical way to detect the synthesized redirecting factory field
Change-Id: Ied5ffe786558856c4e63881880cbd19fa0bd6c68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131620
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-14 09:42:45 +00:00
Jacob MacDonald e4f4c74de9 remove --bazel-mappings support since it is no longer used
Change-Id: I792e4abe5d4f09780d57f4ba893559642c36f894
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130887
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2020-01-10 19:43:41 +00:00
Vijay Menon f4848eb112 [dartdevc,nnbd] fix static async errors
Change-Id: I903f4483f33f737aea877a49999d02a82558dd1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130923
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-10 18:32:24 +00:00
Vijay Menon 4ca345e80f [dartdevc] regression test for dart:* nnbd static errors on bots
Change-Id: I6e9f2fe7075efef496f203ffe42cf10cdc1e660a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130881
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-10 00:33:57 +00:00
Nate Bosch d0e36cd93f Remove isKernel argment tracking
Closes #38777

This was hardcoded to true and no longer needs to be read.

Change-Id: I1c2df0ac55776c842563f12a67d298a508156bd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130822
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2020-01-09 21:49:16 +00:00
Nate Bosch 2d82fb42ce Enforce and fix lint prefer_single_quotes
Change-Id: I7e7b18d90ae8518c700607ec383c73a0eda5a299
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130726
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2020-01-08 22:07:21 +00:00
Nate Bosch c3756794e7 Refactor arg list to use conditional elements
Change-Id: I2c95bab40ac76c3741381f5c801de0b84a102f5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130761
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-01-08 20:44:25 +00:00
Nate Bosch 0a728f0f08 Enable null aware lints
- Enable `prefer_null_aware_operators`, it was already clean.
- Enable `prefer_conditional_assignment` and fix one violation.

Change-Id: I73a5062d5aeedaea9a7b542db02f455111566cfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130724
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-01-08 20:39:50 +00:00
Vijay Menon a21f295da9 [dartdevc] fix nnbd static errors on sdk
See https://github.com/dart-lang/sdk/issues/40022 - we get 30+ errors due to that.
Suppressing for now.

Change-Id: I7b14203c7b479e67fbbb0bc396162cdf23b38b3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130741
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-01-08 20:09:20 +00:00
Dmitry Stefantsov 1eacac48cf [cfe] Make .{thisF,f}unctionType nullability-aware
Change-Id: I4a83f4db7d6412165882e4a1f08c7fded6b9ea3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130373
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-01-08 11:52:06 +00:00
Mark Zhou 5696cd8d09 [dartdevc] Emitting nullability wrappers for generic classes and type parameters.
We are establishing a convention that nullability wrappers will be emitted at the
call sites of 'is', 'as', and '_check' calls (when necessary). Additional wrappers
will be emitted when forward-declaring generic types at the top level - but only
around the generic parameters themselves.

For example, declaring List<int>, List<int?>, List<int>?, and List<int?>? results
in two top-level classes: ListOfInt(int) and ListOfInt$(dart.nullable(int)).

Change-Id: I2d91e170d8e1e911ad9eb70d6b4d67f1cc4cdbc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129921
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-01-07 18:33:35 +00:00
Nate Bosch 4be46419fa Add types to uninitialized variables in DDC
Enable and fix lint prefer_typing_uninitialied_variables

Change-Id: Ibb739b21ac8654feef01ecc2aa1c646882b0b749
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130140
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-01-06 23:45:51 +00:00
Nicholas Shahan 98635636d7 [dartdevc] Cleanup violations of always_declare_return_types lint
This change does not enable the lint yet because there are many more violations
in the test and tool directories. I'm going to clean those up in a separate
change.

Change-Id: I8a7f9a9004d329db5ba34030cc8aa8e20d07f3ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130012
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2020-01-02 23:23:06 +00:00
Mark Zhou 3aa23f8091 [dartdevc] Removing nullability wrappers from const __proto__ fields.
Change-Id: Id56a082f8077ab16080d7ad3450075a858777527
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129812
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-01-02 22:14:56 +00:00
Nate Bosch 113ff6c993 Enforce that allowInterop is used in DDC
Fixes #39074

DDC emits Dart code that can usually be called with the same semantics
as JS there is no guarantee that a function passed to JS and then
invoked successfully was wrapped with `allowInterop`. The wrapping is
always required in Dart2JS. To make DDC more strict, add interceptors
that check for the usage of `allowInterop`.

Whenever a JS interop function or setter is passed an argument which is
statically typed as a Function, but not wrapped with `allowInterop` at
the call site, wrap it with `assertInterop` which will check the
argument at call time and fail with a clear error if it was not wrapped.

Whenever a JS interop function is torn off, either at the top level or
from an instance, wrap it with a function that will also inject these
checks at runtime.

There are still holes where we can't catch the mistake:
- An argument which is statically dynamic and a Function at runtime
  won't be caught.
- A Function which is stored in a collection won't be caught.
- A JS interop definition where a getter returns a Function which takes
  a Function as an argument is not checked.
- A dynamic call through to javascript is not checked.

Changes:

- Refactor `_isJsLibrary` and add `isJsMember`, and `isAllowInterop`
  utilities to determine what needs wrapping.
- Update `assertInterop` to give a more clear error when it fails, and
  to ignore non function arguments.
- Add `tearoffInterop` to wrap a function an ensure that any function
  typed arguments are wrapped.
- Inject `assertInterop` around Function arguments passed to JS methods.
- Inject `assertInterop` around Function arguments passed to static or
  instance JS setters.
- Inject a runtime wrapper around static or instance Function tearoffs.
- Add a test covering all flavors of checks that are supported.
- Change the interop expando to an `Expando<dynamic>` in the NNBD SDK to work
  around a stricter type check. https://github.com/dart-lang/sdk/issues/39971

Potential improvements:

If the `tearoffInterop` turns out to be too heavy, we could loosen it so
that we only wrap methods if any of their argument types are statically
declared to be a Function.

Change-Id: Ibc92df5b54e1a041b4102a07b8398b774b6bd1d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128462
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-01-02 20:24:26 +00:00
Mark Zhou 1f6a0c21d6 [dartdevc] Unemitting nullability modifiers for constructors and generator wrappers.
Change-Id: I5d4892cf6be814e943e6ebecde3b3156cff0bbbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129481
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-12-23 23:55:40 +00:00
Mark Zhou ffc17eba93 [dartdevc] Emitting is expressions correctly for NNBD-compliant ints.
Change-Id: I4ee2866ed4357926644d4300e232583bcead473d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129221
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-12-20 18:40:24 +00:00
Mark Zhou d85ec3c0c3 [dartdevc] Removing nullability wrappers from constructor invocations.
Change-Id: I8cf2058dd66bfa4bb1e76d16da8e4e48dcb478c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129300
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2019-12-20 18:12:40 +00:00
Nicholas Shahan 5f9346a2f5 [dartdevc] Add an nnbd runtime mode weak/strong option to ddb script
Cleaned up the help message printing and sorted the options alphabetically
since the list is getting longer.

Makes it easier to run a file in the various modes. Will automatically pass
the experiment flag to dartdevc if you run with weak or strong.

Added a verbose mode to print the commands being run with all the args and
environment.

Change-Id: I515d185d940b0a13ac74b8b58ae1510a5b203ae7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128775
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-19 00:02:31 +00:00
Nicholas Shahan c13ab9dce2 [dartdevc] Start emitting type wrappers for null safety
Legacy and nullable types will get wrapped with their respective wrappers when
compiling applications with null safety enabled.

Change-Id: I1defe4fc9d5d9b5eacf23a479178eca060ea716b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128379
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-18 00:14:34 +00:00
Johnni Winther 818ec6db92 [cfe] Implement nnbd-top-merge
+ and use nnbd-top-merge and legacy erasure in hierarchy computation

Change-Id: I4bf06ce8d3c68a9926865ebf84b24b4029828d73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128065
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-12-13 17:19:59 +00:00
Nicholas Shahan e3a9dec3e6 [dartdevc] Remove dead code that handles functions in asserts
This code is causing an issue when running tests with the NNBD SDK. As I
understand it used to be possible to pass a function to assert but that feature
was removed from the language. We might as well remove it from DDC too :)

Change-Id: Ia62c653ec9d4c98694986b2c326d2b1b027b9ed9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128308
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-13 17:14:29 +00:00
Nicholas Shahan 598fba0147 [dartdevc] Actually use the libraries from the NNBD fork of the SDK
This change fixes the issues causing build failures when using the
forked NNBD SDK sources and trying to build the dartdevc_kernel_sdk
target.

The end result is a dart_sdk.js file that is known to be incorrect
(missing uses of the legacy and nullable type wrapping) but serves
as a baseline for improvement. Some tests of the runtime directly
will correctly pass.

Following changes will turn on the type wrapping and we can start
diagnosing and fixing the issues that appear.

Fixes: #38665

Change-Id: Iddcf31ef2520fa54bf7d9ae6262c2264636b9b10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127780
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-13 17:11:19 +00:00
Nicholas Shahan c561a9eacc [dartdevc] Delete the legacy version of DDC
Change-Id: I2dc3999b0b7e93252402422d662fb5da4dcca3f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127840
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-12-12 21:53:08 +00:00
Konstantin Shcheglov 3389b3bd32 Remove Packages from SourceFactory.
We have PackageMapUriResolver, this should be the way to resolve
all `package:xyz` URIs. We should not repeat it in SourceFactory.

Change-Id: I52d33dbf7e2d44f2c53521f6a51b0aea70507d3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128106
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-12 17:10:00 +00:00
Vijay Menon 3e15b67d32 [dartdevc] add forwarding from old docs to new info
Fixes https://github.com/dart-lang/sdk/issues/38984

Change-Id: Ic8ef8838b0a8c3233bf94706b243cdd9aedacbc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127963
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
Commit-Queue: Kathy Walrath <kathyw@google.com>
2019-12-10 22:53:26 +00:00
Nicholas Shahan 7974f3f899 [dartdevc] Reduce the number of SDK libraries in the platform
We are temporarily building a smaller SDK platform to make progress building
applications against the forked sdk_nnbd sources. This is because some of the
libraries have not yet been ported and they don't compose well.

I needed to thread the status of the non-nullable experiment through the front
end entry point and into the target options, and native types.

Also includes some standardization of the flag name in DDC.

https://github.com/dart-lang/sdk/issues/39698

Change-Id: I4bdd503be694b28d7f95828d4af28d1d5fb3691f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127486
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-12-09 22:25:48 +00:00
Nicholas Shahan 2015c55277 [dartdevc] Remove ability to run analyzer based DDC
This is the first step in deleting legacy DDC!
* Default all invocations of DDC to run the kernel version.
* Disable all tests that run analyzer DDC.
* Detect the most likely case when invoked with an analyzer
  summary and print instruction to update build_web_compilers
  dependency.

I will follow up with deletions, and a rename of the test configurations/
builders to reclaim the names (ddc vs ddk, dartdevc vs dartdevk).

Issue #38777

Change-Id: I1477f0274b6b7f345a5e19d2b3f93797c454a09e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127067
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-12-09 22:11:22 +00:00
William Hesse 304eb2cb7b [test] Remove extra / in dartdevc nndb test suite runner.
Change-Id: I0f04cb2414b726005a60b4a2263be1bacd5ddb1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127643
Reviewed-by: Alexander Thomas <athom@google.com>
2019-12-09 17:20:26 +00:00
Nate Bosch bf7f27a2c5 Remove comment about inlining constants.
Followup for #36285

Primitive constants are already inlined for us.

Change-Id: I99edcd2076795c9ee5d043bd3028d31dea744cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123546
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-12-05 23:21:20 +00:00
Nicholas Shahan 88e26cd5d9 [dartdevc] Fix DDK sourcemap tests to use the right version of the SDK
Change-Id: I1fbed66efd51f02f0faa3b489013a398f8edcd1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127260
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-05 15:43:29 +00:00
Dmitry Stefantsov 47a9ebea76 [cfe] Make API of as-instance-of and legacy LUB/GLB library-specific
Change-Id: I1991c66e654ef537243d9f25f17070acbfa13af9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126380
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-12-05 13:32:28 +00:00
Vijay Menon 6dc48ab999 [dartdevc] Destructure optional positional parameters
Use ES6 destructuring to handle optional positional arguments more compactly.
Note, this doesn't actually change calling convention in DDC, just how
optionals are handled at the callee.

Given Dart:
  void foo(arg1, arg2, [opt1, opt2 = def2]) {
    ...
  }
old JS:
  function foo(arg1, arg2, opt1, opt2) {
    if (opt1 === void 0) opt1 = null;
    if (opt2 === void 0) opt2 = 42;
    ...
  }
new JS:
  function foo(arg1, arg2, opt1 = null, opt2 = def2) {
    ...
  }

We should be able to similar with named params.

Change-Id: I8491a4517d729ab1dec40c1ed2073b9c33cdffe0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124107
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-12-04 23:19:26 +00:00
Nicholas Shahan 2a13b1fe26 Reland "[dartdevc] Break dart:_debugger dependency on dart:html"
Original change was broken by the fact that DDC expects all types marked as
native have all their superclasses marked as native when the super classes are
compiled.

In this case `MapMixin` from dart:collection was not being marked as native and
the only reason it was working before was that the library dependency enforced
the necessary order.

* Now `MapMixin` is explicitly marked as native.
* Added a test case to use some of the API on `window.localStorage` that is
  inherited from the MapMixin class.

Change-Id: I1584bfb86179016ee12c2acc5cfbbe81d086841e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126906
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-04 00:51:18 +00:00
Nate Bosch 5ecfd7058a Drop fallback to looser as check
This was necessary for ignored cast failures which are no longer supported.

Change-Id: I8accee33a5985b2c0928307ac7a15c6874891add
Bug: https://github.com/dart-lang/sdk/issues/30330
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126901
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-12-03 21:40:38 +00:00