Commit Graph

143 Commits

Author SHA1 Message Date
Jenny Messerly 1ef4399df0 Run dartfmt --fix for dart2 on pkg/dev_compiler
This uses optional new/const and `=` in named argument defaults.

All changes are automated, except for:

- utils/dartdevc/BUILD.gn: run DDC build scripts with --preview-dart-2
- pkg/dev_compiler/tool/patch_sdk.dart: add a TODO that Analyzer doesn't
  supporting implicit const in libraries.dart
- pkg/dev_compiler/tool/input_sdk/libraries.dart: was not formatted due
  to the aforementioned Analyzer bug
- tools/bots/test_matrix.json: run DDC sourcemap suite in Dart 2 mode
- pkg/pkg.status: skip pkg/dev_compiler if running in Dart 1 mode

Change-Id: I9b80ccba0c2cc7b66efc662a0b16562e3660aee3
Reviewed-on: https://dart-review.googlesource.com/60402
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2018-06-15 00:28:13 +00:00
Jenny Messerly 8cd33751c6 optimize string concat in dartdevc
String concat now uses + rather than tagged template strings.
Also refactors the JSTypeRep code into a shared location, and fixes a
bug in null inference for op assign expressions in Analyzer backend.

Change-Id: I74fb6950c1d739efb977a03bd639a07afe453eb6
Reviewed-on: https://dart-review.googlesource.com/57522
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-06-07 01:28:02 +00:00
Jenny Messerly d87642df9c fix #33036, dartdevk now uses CFE for patching its SDK
Change-Id: I65e7df5373c359019b4b7c5714ae71a80d60df13
Reviewed-on: https://dart-review.googlesource.com/53682
Reviewed-by: Vijay Menon <vsm@google.com>
2018-05-07 22:01:52 +00:00
Jenny Messerly b62276d97f fix DDC SDK implementation JS type annotations to work with CFE
This migrates the JS builtin's string type to the `<T>` type parameter
for a few more cases. This was done to eliminate null checks, casts and
dynamic calls when dartdevk builds the SDK, so it matches dartdevc.

Change-Id: I8570e5127149a45289a90002c27034333c3038ad
Reviewed-on: https://dart-review.googlesource.com/51207
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-17 19:29:40 +00:00
Jenny Messerly c9e9c1d8e9 Remove dart:isolate runtime support in DDC
This disables most runtime features of dart:isolate, similar to dart:io.

For now, this supports `new ReceivePort()` and `ReceivePort.close` as
those are used by async tests to keep the Dart VM alive. Those are
no-ops in DDC. Also removes most of dart:_isolate_helper, except for
the JS API that's used to bootstrap DDC `main()`.

Change-Id: I84eab6cd39d05a70a6afe982e952076ddaaa8c0f
Reviewed-on: https://dart-review.googlesource.com/45754
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-03-28 19:42:08 +00:00
Jenny Messerly 5013b28bbe fix #31999, remove fuzzy arrow runtime support from DDC
Also updates tests that relied on fuzzy arrows.

Change-Id: Ia8df1d8d421e43dfada589223d5e46182b92fa67
Reviewed-on: https://dart-review.googlesource.com/37425
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-01-31 22:20:38 +00:00
Zachary Anderson 9c40a7e662 Reland: [dart:cli] Adds waitFor(Future)
This is a reland of https://dart-review.googlesource.com/#/c/sdk/+/28920/
with the following changes:
- It creates a new library dart:cli
- waitFor(Future) goes in dart:cli instead of dart:io
- Removes a flaky test, and adds a missing precompiler entrypoint
- Adds waitFor(Future)
- Improves doc comments

fixes #31102

Change-Id: I04d2c46fd0afac049dd4fd1353905dc20da18f90
Reviewed-on: https://dart-review.googlesource.com/29449
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Natalie Weizenbaum <nweiz@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-01-18 16:38:54 +00:00
Leaf Petersen 1ed4096b4e Remove generic comment syntax from pkg/dev_compiler.
Bug:
Change-Id: Ifc823c2b703ec70cd97981f08b29396de516f678
Reviewed-on: https://dart-review.googlesource.com/30382
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2017-12-19 22:03:43 +00:00
Vijay Menon 616187bff8 Remove ddc-specific versions of dart:html and friends
Change-Id: I2980f0579a7c34022f2f96cd1338ca8d9f177ad2
Reviewed-on: https://dart-review.googlesource.com/26640
Reviewed-by: Alan Knight <alanknight@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-12-06 19:34:25 +00:00
Paul Berry 316f2b429f Strong mode fixes to DDC SDK
Change-Id: I40508c686014f28772109fdfd10c68b986b40be6
Reviewed-on: https://dart-review.googlesource.com/25140
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-12-01 19:58:07 +00:00
Lasse R.H. Nielsen b0f6c4c8b1 Don't deprecate old constant names yet.
Flutter reacts badly to using deprecated members.

Change-Id: Id7933ddbc0c2fa68d9a232e2ad4c74dfd0ecdf35
Reviewed-on: https://dart-review.googlesource.com/21601
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2017-11-17 10:58:33 +00:00
Lasse R.H. Nielsen 0b58c4bd10 Change some constant declarations to lowerCase.
Retain the old values.

Reapply of https://dart-review.googlesource.com/c/sdk/+/20680 with fixes
for VM method fingerprints.

Change-Id: Ie14e7ccc3194d5561983348e6b6752728913ff4d
Reviewed-on: https://dart-review.googlesource.com/20664
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2017-11-14 12:59:14 +00:00
Lasse R.H. Nielsen e61fc07b58 Revert "Change some constant declarations to lowerCase."
This reverts commit c048cfb178.

Reason for revert: VM code fingerprints needs update.

Original change's description:
> Change some constant declarations to lowerCase.
> 
> Retain the old values.
> 
> Change-Id: I03bd326f379fe5f96d8f6081a7133de956d745c0
> Reviewed-on: https://dart-review.googlesource.com/11520
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Florian Loitsch <floitsch@google.com>

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

Change-Id: I095e8198304ca4e59b39d30b0fdf0af4945e5231
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/20680
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2017-11-14 11:23:08 +00:00
Lasse R.H. Nielsen c048cfb178 Change some constant declarations to lowerCase.
Retain the old values.

Change-Id: I03bd326f379fe5f96d8f6081a7133de956d745c0
Reviewed-on: https://dart-review.googlesource.com/11520
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-11-14 11:13:04 +00:00
Jennifer Messerly 3a907e5cab add a script to build DDC's SDK to a dill file
Change-Id: I93f9d55bd99a3b98ee823c38255e9a8081954a4b
Reviewed-on: https://dart-review.googlesource.com/10213
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-03 20:27:12 +00:00
Leaf Petersen e0c2e8191f Eliminate fuzzy arrow from conversions_dart2js.dart
Bug:
Change-Id: Ide970d2a5353e53af9f0a73748b12b2fb770ebcb
Reviewed-on: https://dart-review.googlesource.com/7941
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
2017-09-26 10:37:48 +00:00
Florian Loitsch 38bf70d7ac Use generic functions in zones.
Migrated from https://chromiumcodereview.appspot.com/2893893002/

Change-Id: I0bd6dc1438eb1e6762e7760a08b5a760b07d4b10
Reviewed-on: https://dart-review.googlesource.com/4942
Reviewed-by: Florian Loitsch <floitsch@google.com>
Commit-Queue: Florian Loitsch <floitsch@google.com>
2017-09-20 15:46:06 +00:00
Vijay Menon 99e672d1cb Registration-based approach to cross frame support.
This approach installs all Dart extension types onto a window whenever
that window is accessed.

See #28326

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2980853002 .
2017-07-19 12:53:43 -07:00
Vijay Menon 8913dd97df Update ddc dart:html
This is just a straight copy of the dart2js version to pick up sra's range fix.

TBR=sra@google.com,alanknight@google.com

Review-Url: https://codereview.chromium.org/2983693002 .
2017-07-17 12:14:30 -07:00
Erik Corry 029b1cb948 Spelling fixes e to i.
R=kevmoo@google.com
BUG=

Review-Url: https://codereview.chromium.org/2957593002 .
2017-06-24 13:41:39 +02:00
Alan Knight a865f0ecf2 Update DDC libraries to match SDK, and debugger_test golden file
BUG=
R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2903333002 .
2017-05-25 15:00:51 -07:00
Alan Knight 0bb2d5e548 Update DDC html libraries to match SDK
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2899083007 .
2017-05-25 09:33:23 -07:00
Bob Nystrom 979a75c4b3 Fix more errors in DDC SDK.
R=jacobr@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2871363002 .
2017-05-11 11:22:05 -07:00
Erik Corry aa6353b6da Dart SDK Spelling b, c, and d.
R=kmillikin@google.com
BUG=

Review-Url: https://codereview.chromium.org/2850783002 .
2017-05-01 08:28:10 +02:00
Erik Corry 6617737ff5 Replace 'the the' with 'the'
R=kmillikin@google.com
BUG=

Review-Url: https://codereview.chromium.org/2830353002 .
2017-04-24 08:50:37 +02:00
Erik Corry 4b9bba55b4 Stoppp using trippple consonants
R=ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2833073002 .
2017-04-21 17:50:13 +02:00
Jacob Richman 0dbb32f406 Run formatter on dev_compiler.
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2830503002 .
2017-04-18 16:16:14 -07:00
Jennifer Messerly f021a7019b fixes #27586, prefer downwards context type in generic inference
fixes #27625, Object constraints were not tracked in inference
fixes #27933, pin return type from downwards inference

We now prefer to pick the bound (lower or upper) that had some information on, and it also improves inference error messages somewhat (still a ways to go).

The way this works is we now have a type representing an unknown type: ?. We use ? when performing downward inference steps, instead of `dynamic`. This allows more accurate tracking of type constraints.

For example: given:

    var x = await Future.wait([a, b]);

Future.wait<T>'s argument type is Iterable<Future<T>>. Since we didn't know T, we previously pushed down Iterable<Future<dynamic>>. The dynamic caused loss of information. Now we push down Iterable<Future<?>>, allowing us to infer the right type there.

R=leafp@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2456803004 .
2017-03-17 16:59:56 -07:00
Jacob Richman 9484ac8bdf Format all dart dev compiler files
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2752163002 .
2017-03-15 21:34:25 -07:00
Vijay Menon f6e964fca9 Fix dangling ddc references in libraries.dart
Our internal tooling is complaining about this when building / checking the ddc sdk.  It appears to use the analyzer's summary builder tool which seems less forgiving about dangling references / missing files.

R=srawlins@google.com

Review-Url: https://codereview.chromium.org/2740573003 .
2017-03-07 15:27:46 -08:00
Jennifer Messerly fe294f3753 unfork DDC's copy of most SDK libraries
There's some changes in strong mode errors we may want to follow up on.

Unforks the following: async, collection, convert, core, developer, internal, io, isolate, math, mirrors.

Does not unfork: html, indexed_db, js, js_util, svg, typed_data, web_audio, web_gl, web_sql.

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2698353003 .
2017-02-28 17:10:52 -08:00
Leaf Petersen fd6f2cc4cc Add generic types to Future.forEach in DDC sdk
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2696133005 .
2017-02-15 11:17:25 -08:00
Ben Konyi 39f80e42e0 Corrected spelling mistake from "happend" to "happen" throughout multiple files.
BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2688943002 .
2017-02-10 12:52:42 -08:00
Jacob Richman a8c7e74424 Remove dynamic call from _LinkedHashSet. Remove some dcalls from the dart:html util library.
BUG=
R=alanknight@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2666053004 .
2017-02-01 13:26:41 -08:00
Conor Reisman 80066aa2d6 Fix typo in StreamSink.close documentation (#28572)
provding -> providing.
2017-01-31 04:11:38 -08:00
Jennifer Messerly 0e00b3e5c8 fix #28008, fix #28009 implement FutureOr<T>
This implements FutureOr<T> in strong mode, otherwise it's ignored (treated as `dynamic`.

Also fixes strong mode's inference subtype function incorrectly treating `void` as a malformed type. This had the consequence of allowing `void` to be inferred as a type argument.

R=leafp@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2647833002 .
2017-01-25 15:32:57 -08:00
Benjamin Dopplinger bf5597c95a Fix "classs" typos (#28469) 2017-01-23 17:00:24 +01:00
Jacob Richman badfd146d2 Fix type error in js_dart2js.dart caught by DDC.
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2611423002 .
2017-01-09 07:42:49 -08:00
Leaf Petersen 7ab0daeedf Make EventStreamSubscription DDC safe.
EventStreamSubscription.listen does a cast which is only working in
DDC because we're ignoring the failure.  This wraps the listener to
check the argument rather than casting the function.  Also picks up a
few misc changes to the main SDK that hadn't been merged into DDC.

BUG=
R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2609633002 .
2017-01-09 04:13:36 -08:00
Jacob Richman 93fb5d8119 Fix cross-window JS interop on FireFox.
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2610813003 .
2017-01-04 14:15:20 -08:00
Jacob Richman 3659aaf181 Fix bug in Blob creation from workers.
Fixes https://github.com/dart-lang/sdk/issues/28155

BUG=

Review-Url: https://codereview.chromium.org/2592813003 .
2016-12-21 08:45:48 -08:00
Jacob Richman 7f26211c26 Correct handling of cross-frame functions in ddc.
Misc fixes of dart:js support on ddc.
Work around issue with Blob constructor on ddc.
Fix incorrect dart:js test on dart2js (fixes https://github.com/dart-lang/sdk/issues/26197)

BUG=
R=alanknight@google.com, leafp@google.com, rnystrom@google.com

Review-Url: https://codereview.chromium.org/2587203002 .
2016-12-19 15:00:55 -08:00
Vijay Menon 201c5b9297 Fix runtime strong mode error in ListMixin
R=jacobr@google.com

Review URL: https://codereview.chromium.org/2544163002 .
2016-12-01 15:41:46 -08:00
Bob Nystrom aa749dbd8d Sprinkle some types on the SDK like the static typing fairy.
When I'm looking at the dynamic call profiles of an internal app test,
I see a bunch coming from the SDK itself. In fact, the top five most
common dynamic call sites are in the SDK.

This fixes four of them. (The fifth is in runUnary() in Zone, and I
don't think can be made typed yet.)

R=vsm@google.com

Review URL: https://codereview.chromium.org/2542723003 .
2016-11-30 17:04:54 -08:00
Alan Knight 667fc8dbe9 Make the dart:developer library available in DDC so debugger statement works
BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/2534263002 .
2016-11-29 16:13:45 -08:00
Vijay Menon 88c5dd5745 Better mirrors support for mixins and private fields
This is generally motivated by pageloader usage.

R=rnystrom@google.com

Review URL: https://codereview.chromium.org/2535273002 .
2016-11-29 14:00:01 -08:00
Mohamed Hayibor 5595b9698d Fix typos 'overriden' to 'overridden' and '@mustCall super' to '@mustCallSuper' (#27853)
* fix overriden typos to overridden
* Fix @mustCall super to @mustCallSuper
2016-11-18 09:36:25 -08:00
Jacob Richman fb467ef68a Fix _wrapDartFunction to call the JS set method directly. At one point this code was previously surprisingly generating a direct call to set instead of a call to dsetindex.
BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/2504733002 .
2016-11-15 12:52:28 -08:00
Kevin Moore 4179bd7601 Apply codec change from fb968553 to DDC copy
Closes https://github.com/dart-lang/sdk/pull/27724

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/2481703003 .
2016-11-07 10:59:22 -08:00
Jan-Hendrik Dolling 89560c68a0 change "the the" to the 2016-10-28 21:47:50 +02:00