Commit graph

8589 commits

Author SHA1 Message Date
Leaf Petersen 580e486386 Make CastStreamSubscription.onData handle a null callback
Fixes #33166

Change-Id: I52e8bcb6c782c84e8a474b0fc40ada24f31bf602
Reviewed-on: https://dart-review.googlesource.com/55984
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-05-22 16:24:57 +00:00
Devon Carew eeec6466b6 Convert the command-line analyzer to a dart 2 snapshot.
Change-Id: Ieb5cd8971494a8a6ffc07c0fd4dde07cfb6f5373
Reviewed-on: https://dart-review.googlesource.com/56034
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-05-22 15:44:04 +00:00
Nate Bosch 2ff2af7921 Allow running pub with --preview-dart-2
- Make a snapshot in Dart 2 mode
- Check for the VM argument `--preview-dart-2` and run the correct
  snapshot

Towards fixing https://github.com/dart-lang/sdk/issues/32188

Change-Id: I56d5e7f268ff40b80783fae571981705536280f2
Reviewed-on: https://dart-review.googlesource.com/54743
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2018-05-18 20:27:29 +00:00
Vijay Menon 9f6e8a3a96 Move DDC to Dart 2 snapshot
This is not yet working.

Change-Id: I86990eb7a8758d9bccee45997f30286d72a8925f
Reviewed-on: https://dart-review.googlesource.com/54532
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-05-18 19:13:08 +00:00
Zach Anderson e7495e427c [dart:io] Adds X509Certificate.der and X509Certificate.pem
fixes #33115

Change-Id: I7ccf5998b23e936040fe65792824f09d3f494cf7
Reviewed-on: https://dart-review.googlesource.com/55505
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2018-05-17 16:20:06 +00:00
Stephen Adams dc8e621451 [js_runtime] Avoid more casts
TBR=sigmund@google.com

Change-Id: I6400b13627c112a7a113350fdb9243353fcee6d3
Reviewed-on: https://dart-review.googlesource.com/55620
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-17 05:45:21 +00:00
Régis Crelier c60ea740cb [VM runtime] The 'checked' parameter of Isolate.spanwUri should control asserts
only, but not type checks in Dart2 strong mode (fixes #33120).

Change-Id: Ib8ca63aa3113b80243b6f8eb4015cb5c24140a88
Reviewed-on: https://dart-review.googlesource.com/55442
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-05-16 18:13:22 +00:00
Zach Anderson 42bcdcd332 [dart:io] Revert recent non-utf8 path handling
Reason for revert: Breaking API change blocks Flutter rolls. Reverting
to reconsider, work around, etc..

Revert "[ VM ] Fixed issue where backing array was deleted from an ExternalTypedData before the ExternalTypedData was used."

This reverts commit 916b9da48d.

Revert "[ VM ] Fixed tests for non-UTF8 paths on Windows / Macos."

This reverts commit 6327fe91c2.

Revert "[ VM ] Fix failing tests on Windows bots after non-UTF-8 paths change."

This reverts commit b51f4b7956.

Revert "[ VM ] Updated non-UTF-8 tests to expect exceptions on OSX/iOS."

This reverts commit bcb36247d2.

Revert "Revert "[ VM ] Updated non-UTF-8 tests to expect exceptions on OSX/iOS.""

This reverts commit 24450c79a5.

Change-Id: I756f74f4acdde168d0984fe130f05f9252366334
Reviewed-on: https://dart-review.googlesource.com/55441
Reviewed-by: Todd Volkert <tvolkert@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-05-16 15:47:10 +00:00
Johnni Winther 944ce140e2 Remove most imports of elements/elements.dart
Change-Id: I4ecd45286fab1171eab1e2d3d443a0441bbdc883
Reviewed-on: https://dart-review.googlesource.com/55180
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Lasse R.H. Nielsen cdc520f459 Mark MirrorsUsed as deprecated.
Change-Id: I8e28f80581fdb22de5fd63d9a604252c95df14ee
Reviewed-on: https://dart-review.googlesource.com/55360
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Anders Sandholm <sandholm@google.com>
2018-05-16 09:51:18 +00:00
Lasse R.H. Nielsen bf77f064c1 Mark NoSuchMethodError constructor as deprecated.
Move implementation details into patch files, it does not belong in the interface.
Actually implement NoSuchMethod.withInvocation in dart2js.

Change-Id: I37049c258067b962d18eff42196e37aa127f0dea
Reviewed-on: https://dart-review.googlesource.com/55166
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-05-16 09:09:08 +00:00
Ben Konyi 916b9da48d [ VM ] Fixed issue where backing array was deleted from an ExternalTypedData before the ExternalTypedData was used.
Reland "Fix issues with FileSystemEntities which have non-UTF8 paths causing exceptions to be thrown when converting to/from a Dart VM String."

This reverts commit 4f549e2900.

Change-Id: Ia27c8c300beb178fa7b08ffe0bfcb2d61f65bbb5
Reviewed-on: https://dart-review.googlesource.com/55271
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-05-15 21:54:46 +00:00
Sigmund Cherem a06f7c9241 Remove dart:_isolate_helper.
The rest of the code was used in a single place, so I've moved the code to the
appropriate library.

Change-Id: Idd0416bf7365e3de05f20ab1184428ae7ae614b2
Reviewed-on: https://dart-review.googlesource.com/54745
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-15 00:21:28 +00:00
Stephen Adams b3649427bd js_runtime: avoid some implicit casts
Change-Id: I828d172db560f1a2ec8aefe7ea85980a50dee3aa
Reviewed-on: https://dart-review.googlesource.com/54746
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-14 23:53:37 +00:00
Ben Konyi 4f549e2900 Revert "Fix issues with FileSystemEntities which have non-UTF8 paths causing exceptions to be thrown when converting to/from a Dart VM String."
This reverts commit ba342a94ec.

Reason for revert: Bots are red.

Original change's description:
> Fix issues with FileSystemEntities which have non-UTF8 paths causing exceptions to be thrown when converting to/from a Dart VM String.
> 
> Continuation of PR #32583 by powdercloud
> 
> Fixes #29451
> 
> Change-Id: I4bdf24f9c8ead425a4f0cad33b642908f1ec203d
> Reviewed-on: https://dart-review.googlesource.com/51580
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,zra@google.com,tvolkert@google.com

Change-Id: I12850f178a13a75289d18af4e565bd73c59b14ad
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/55060
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-05-14 23:40:29 +00:00
Ben Konyi ba342a94ec Fix issues with FileSystemEntities which have non-UTF8 paths causing exceptions to be thrown when converting to/from a Dart VM String.
Continuation of PR #32583 by powdercloud

Fixes #29451

Change-Id: I4bdf24f9c8ead425a4f0cad33b642908f1ec203d
Reviewed-on: https://dart-review.googlesource.com/51580
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-05-14 23:06:57 +00:00
Sigmund Cherem be77569d57 Remove old mirrors library now that the old-frontend is being deleted
Change-Id: Iea1cbb0c4422fa51e632ac03c9cd01e4916181fc
Reviewed-on: https://dart-review.googlesource.com/54744
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-14 21:38:07 +00:00
Sigmund Cherem 3c22fc9216 Allow null nonce
This should fix the bots for FF and safari.  (Chrome returns '', but FF and
Safari return a null value.)

TBR=sra@google.com

Change-Id: I9a402d3c9f4fed09b9181a8ec29f68ff6770e509
Reviewed-on: https://dart-review.googlesource.com/54714
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-11 20:41:59 +00:00
Sigmund Cherem c7683ad41b Support strict CSP in dart2js.
dart2js will now set the CSP nonce on scripts that are inserted for deferred
loads. Note that this change only applies to the default hunk loader. Custom
hooks need to set the nonce value manually.

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

Change-Id: I04abc7904dff22dad586690d175b87c77c3f1fe2
Reviewed-on: https://dart-review.googlesource.com/54702
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-11 17:41:07 +00:00
Stephen Adams ef6e19a83a [dart2js] Implementation of extractTypeVariables
Change-Id: I80272dade861e30440f64fe36c1bf4bb5cd2eb8a
Reviewed-on: https://dart-review.googlesource.com/54625
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-11 01:37:45 +00:00
Sigmund Cherem c25a9fd46b Remove support for dart:isolate in dart2js.
Change-Id: I1216a0ac91d8a1d13b441809596e1a8b5e51bb34
Reviewed-on: https://dart-review.googlesource.com/54526
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-10 01:20:17 +00:00
Adam Barth 779dc6eb85 Stop leaking file descriptors for HTTP clients
Previously, we would wait for a Future to terminate before destroying
the underlying raw socket. If that future never terminated, we would
leak the underlying file descriptor.

Now, the "force" codepath in close destroys the socket immediately
(similar to what it did previously for active sockets) and the non-force
codepath has a timeout, as requested by a TODO comment.

Change-Id: I021a93a40e4708ce93b4f1ae6c3f7289764bd69f
Reviewed-on: https://dart-review.googlesource.com/54442
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Adam Barth <abarth@google.com>
2018-05-09 21:33:09 +00:00
Zach Anderson 5afa2dca51 [dart:io] Fix ProcessStartMode.values
Change-Id: I1bdd98c7e86991e38d6bc7555620d784d595eb2d
Reviewed-on: https://dart-review.googlesource.com/54441
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-05-09 17:27:57 +00:00
Sigmund Cherem 3ec1b929e3 Remove dependencies on isolates.
This starts removing support for isolates. I've kept around the
isolate library for now, but I stopped injecting the isolate logic
unless you directly access an isolate API.

Concrete changes:

* Timer no longer uses the event queue: this was only used in worker
isolates, soon to be removed.

* Checking for whether the code is run within a worker is not dependent
   on initializing the isolates global state. This was important to allow
   deferred-loading to work without the isolate logic.

* Workers no longer track pending async calls correctly. This may make it possible
   to terminate worker isolates early, again this wont be relevant shortly.

Bug: https://github.com/dart-lang/sdk/issues/32684
Change-Id: I05025418e05c3641ba1a3bc34ea75ca558a28fbd
Reviewed-on: https://dart-review.googlesource.com/54160
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-09 16:36:26 +00:00
Lasse Reichstein Holst Nielsen 862a894de6 Make cast do the same things as retype.
Deprecate `retype` and forward it to `cast`.

Change-Id: Ie17ffdd1eef0d3f19582bf638c5349927c7b5ebd
Reviewed-on: https://dart-review.googlesource.com/53802
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-05-09 08:00:08 +00:00
Zach Anderson ac6ea06fd2 [dart:io] Switch ProcessStartMode back to an enum
Switching ProcessStartMode back to an enum due to problems with
package:process (https://github.com/google/process.dart/blob/master/lib/src/record_replay/run_manifest_entry.dart#L11)

Change-Id: I7db55a6a2107c9469d264e0539844363d729e0bf
Reviewed-on: https://dart-review.googlesource.com/54063
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-05-08 19:13:19 +00:00
Sigmund Cherem 410db09743 Do not convert the worker object in jsinterop, just like we do for window
This makes it possible to do:

  js.context['self'].addEventListener('message',
      allowInterop((e) => print('received')));

Change-Id: I202b6c881372a77c0ec41dd334e9aa76286d7796
Reviewed-on: https://dart-review.googlesource.com/54068
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-07 21:10:43 +00:00
Sigmund Cherem 5618373690 Copy timers to jsshell.js preamble
We should work on merging d8.js and this file, since they are almost identical.

Closes #7728

Change-Id: I4f754a4f59ad3b498eba7658d38cecc617bf784d
Reviewed-on: https://dart-review.googlesource.com/53860
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-05 01:02:56 +00:00
Devon Carew 5904247715 Fix a typo in socket.dart.
Change-Id: I92031ce05fde7b5292df8b0f32fe4fbe77d80923
Reviewed-on: https://dart-review.googlesource.com/53721
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-05-04 17:00:26 +00:00
Zach Anderson 4877587346 [GN] Uses dart_action.gni instead of compiled_action.gni.
This avoids conflicts with client repos that have a file
//build/compiled_action.gni with something different in them.

Change-Id: I133f66b0989bcb547cb8eed8710a88e2c1384bd7
Reviewed-on: https://dart-review.googlesource.com/53440
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-05-03 21:07:13 +00:00
Zach Anderson afb490adbc [dart:io] Provide modern Dart-styled constants
This CL updates dart:io but not dart:_http. It updates the sdk sources,
the patch files, and tests.

Change-Id: I64c3da407f09fa2bc6eec582049c4ae3a8afbe6d
Reviewed-on: https://dart-review.googlesource.com/52990
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-05-03 17:00:14 +00:00
Johnni Winther d13bf49870 Check type-variable bounds on generic methods
Closes #32711

Change-Id: I86c123f5a8b9eda393b276248cdd27d1b109354b
Reviewed-on: https://dart-review.googlesource.com/53201
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-03 09:36:58 +00:00
Ryan Macnak 258c5172df [vm] Remove dart_mirrors_api.h.
Its last user was Dartium's DevTools.

Change-Id: I86e1a2aacc7f2589be53418b3030accc0cef9a7d
Reviewed-on: https://dart-review.googlesource.com/53464
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-05-02 21:39:27 +00:00
Johnni Winther 54b8ebd992 Support js-interop classes that implement generic types in Dart 2
This adds a special RTI representation for a type argument of a
(supertype of a) js-interop class, which effectively is the Dart 1
`dynamic` type.

Closes #32969

Change-Id: Ifd92b3fc6779d96d354ad929bd7c07a349299ae6
Reviewed-on: https://dart-review.googlesource.com/53002
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-01 08:37:11 +00:00
Stephen Adams d6a3b85ed2 Use factory methods for async/sync*/async* transforms
The static methods allow type parameters to be registered,
but this means that the type parameters will be dropped unless in strong mode.

Change-Id: I91c1977c287c14742df7d59b988e64ddc46f794d
Reviewed-on: https://dart-review.googlesource.com/52870
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-30 22:32:56 +00:00
Sigmund Cherem 004ee9cd12 Fix how we use Comparable.compare, so we have a function with the appropriate type in JSArray.sort
This is the same fix that was done here: https://github.com/dart-lang/sdk/blob/master/sdk/lib/collection/list.dart#L349

Change-Id: I6013dc96c67b487b0e96118028ef920a84f371b5
Reviewed-on: https://dart-review.googlesource.com/52701
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-04-26 00:32:02 +00:00
Nate Bosch 94f45c8876 Bring in the latest pub
Bug: 32593
Change-Id: I4a8ce82591249968cfb00e9c57ddf75afb760d14
Reviewed-on: https://dart-review.googlesource.com/52700
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2018-04-26 00:01:35 +00:00
Keerti Parthasarathy 9eb09d825b Revert "Create _nullFuture and _falseFuture in the root zone."
This reverts commit 9bb085a1c6 due to
test failure in google3.

Change-Id: I63940e62bd97c83bc432db99b44c991e6c1e025e
Reviewed-on: https://dart-review.googlesource.com/52422
Reviewed-by: Dan Grove <dgrove@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2018-04-24 20:45:38 +00:00
Stephen Adams 42b5affddc js_runtime: recover sync* performance in strong mode
Put in types to avoid some implicit downcasts in _SyncStarIterator.

Change-Id: I0b04a20ccc84e20f95469a0515a054caf4cf4b34
Reviewed-on: https://dart-review.googlesource.com/52420
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-04-24 17:20:17 +00:00
Ryan Macnak db8754583d [gn] Propagate outputs up to //create_sdk.
Allows a rule to depend on create_sdk and declare a part of the SDK as an input. Doing both is good style in GN, and is needed for polymorphism with a prebuilt SDK, which would have an empty dependency and an input to detect updates to the prebuilt artifacts.

Change-Id: Icbb05a1073c6b18517dd715fba047c80caa3e8cd
Reviewed-on: https://dart-review.googlesource.com/52401
Reviewed-by: Zach Anderson <zra@google.com>
2018-04-24 16:03:45 +00:00
Stephen Adams 81d779c41b Redo "Pass type argument into rewritten marked function"
TBR=sigmund@google.com

Change-Id: I0999ab52f76da185c601ce7105e4a8491c5e4edf
Reviewed-on: https://dart-review.googlesource.com/52262
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-04-21 01:14:49 +00:00
Johnni Winther be47fa67aa Fix dart2js subtyping
A<dynamic> is _not_ a subtype of A<int> in Dart 2

Change-Id: I0d1185b38192a06aaf9d8622a78c7384dfc287dc
Reviewed-on: https://dart-review.googlesource.com/52106
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-20 21:44:09 +00:00
Stephen Adams a5ea3c5e33 Revert "Pass type argument into rewritten marked function"
This reverts commit 25b3dbb7b3.

TBR=sigmund@google.com

Change-Id: If0e37738e1516efcb144bffbaf57cfc7d3028d13
Reviewed-on: https://dart-review.googlesource.com/52261
Reviewed-by: Stephen Adams <sra@google.com>
2018-04-20 19:30:14 +00:00
Stephen Adams 25b3dbb7b3 Pass type argument into rewritten marked function
The values returned from calling sync*, async and async* are now parameterised.
Simple cases where the type has no type parameters are handled.

The next step is to introduce a signature-like j-model entity to compute the type in more complex cases.


Change-Id: I2e43088cc6383a70e3a3d3067ec7542694ee2d0a
Reviewed-on: https://dart-review.googlesource.com/51421
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-20 18:41:59 +00:00
Lasse R.H. Nielsen 973a1a0219 Remove uses of upper-case constants in remaining SDK code.
This includes Fasta, tools and observatory, so the checked-in SDK must
have the lower-case constants.

Change-Id: I8380ad041ad058f7d02ae19caccfecd434d13d75
Reviewed-on: https://dart-review.googlesource.com/50201
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-16 16:11:57 +00:00
Stephen Adams b0fafbd1f4 Clean up js_runtime parse/tryParse methods
Change-Id: Ibbb79650053fb6777e1694f2540f21bf699d6b52
Reviewed-on: https://dart-review.googlesource.com/51044
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-04-12 21:23:56 +00:00
Lasse R.H. Nielsen 7cc4d76a30 Add tryParse alternatives to parseFunctions.
Deprecate `onError` arguments to parse methods.

Change-Id: Iac1d87416abc8a73ce1853edffab49df8a8cb5fe
Reviewed-on: https://dart-review.googlesource.com/50723
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-12 13:16:49 +00:00
Stephen Adams a90a74cfd8 JSArray strong mode performance fixes
Replace

      var element = JS('', '#[#]', this, i);

with

      var element = JS<E>('', '#[#]', this, i);

to ensure 'element' has the static type E.

I would prefer

      E element = JS('', '#[#]', this, i);

but that makes legacy checked mode insert unneeded type assertions.

Change-Id: I74446ca7bfa748490347100093a94b9191ca6821
Reviewed-on: https://dart-review.googlesource.com/50860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-04-11 21:58:39 +00:00
Stephen Adams cbdf102d0c Use interceptor for reading type arguments
Type arguments that require a subsitution need the interceptor to
access the substitution function.

- Add an interceptor input to HTypeInfoReadVariable
- Add an entry point getRuntimeTypeArgumentIntercepted that takes the interceptor.
- Optimize uses that do not need the interceptor.

The interceptor is cheap to get from the context in the common case
that the type variable access is directly in an instance method.

A typical use (broken)

    var t1 = H.getRuntimeTypeArgument(receiver, "ListMixin", 0);

becomes

    var t1 = H.getRuntimeTypeArgumentIntercepted(this, receiver, "ListMixin", 0);

Change-Id: I2abe6a2b6e8d2cdb0ede1b7248dd8337830f8a0c
Reviewed-on: https://dart-review.googlesource.com/50640
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-11 21:25:26 +00:00
Lasse R.H. Nielsen 4126459025 Fix bug in CastList.sort.
Optimisitically always wrapped the `compare` argument, even if it was `null`.

Change-Id: I811affad97edc9e98af07abd323a25478e45a392
Reviewed-on: https://dart-review.googlesource.com/50724
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2018-04-11 14:56:06 +00:00
Terry Lucas 6ab6d1eda9 Suppress fromRect its only available in DOMRect and not in ClientRect - will open bug to fix this issue.
R=sra@google.com

Change-Id: I09b653c7f3987dcf7ce5b235593e4f3140561d5c
Reviewed-on: https://dart-review.googlesource.com/50581
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
2018-04-10 23:25:12 +00:00
Stephen Adams f3cec061eb Capture type variables in global NSM stubs
- Add a type argument count to JSInvocationMirror.
- Change stubs to pass the argument count.

Change-Id: I448dbee9a2aa0be17c24ae79eae0c89e7574fa7c
Reviewed-on: https://dart-review.googlesource.com/49820
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-10 21:32:11 +00:00
Terry Lucas 34be5de0c7 Fixed _DomRect class to map to both ClientRect and DOMRect for browser backward compat.
R=sra@google.com,sigmund@google.com

Change-Id: I2f5ccae15bcd993ab1e15ab556a25d6e0cd1d450
Reviewed-on: https://dart-review.googlesource.com/50504
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
2018-04-10 21:18:45 +00:00
Stephen Adams 4dd5e6e6ad js_runtime: fix _JsonMap keys list type
TBR=sigmund@google.com

Change-Id: Iec7d7e5229cb96e739e3d3bde73f5ce3534c5827
Reviewed-on: https://dart-review.googlesource.com/50020
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-09 17:19:36 +00:00
Sigmund Cherem 133cd9d182 Use JavaScriptFunction for _registerCustomElement
"=Object" was inacurate and contradicted the inferred type <Function> in strong mode.

Change-Id: Ibee4351357dde4aaacf95ff7265cd335fc5d06ea
Reviewed-on: https://dart-review.googlesource.com/49832
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-04-06 23:14:13 +00:00
Stephen Adams 6656233fcc Strong-mode fixes in js_runtime
Fixes errors in RegExp and String.fromCharCodes.

TBR=sigmund@google.com

Change-Id: I7f84d2b9ee2dfead6d0cf634e36c06b9071bf991
Reviewed-on: https://dart-review.googlesource.com/49981
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-04-06 21:44:32 +00:00
Kevin Moore e17b36a4ff Fix references to operator [] and == in SDK doc comments
Change-Id: I6005b40207e312fdfdc8fb78fa5dab7abb0bf8c7
Reviewed-on: https://dart-review.googlesource.com/49961
Reviewed-by: Janice Collins <jcollins@google.com>
2018-04-06 21:01:22 +00:00
Lasse R.H. Nielsen 9bb085a1c6 Create _nullFuture and _falseFuture in the root zone.
Avoids issues where they are lazily created in a different current zone and that zone messes with, for example, schedule microtask, which the future uses to schedule invocations of its callbacks.

Change-Id: I6697ca469426472523089fcf7ca44312b9c6ff5f
Reviewed-on: https://dart-review.googlesource.com/49509
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2018-04-06 16:10:52 +00:00
Lasse Reichstein Holst Nielsen 8ada18e9a1 Mention removal of defaultValue parameter on stream methods in changelog.
Also remove mentions in documentation.

Change-Id: I51ad3137fff505168acde7f2e21bebc42a49da3b
Reviewed-on: https://dart-review.googlesource.com/49721
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-04-06 10:35:52 +00:00
Terry Lucas 3e6b8717fe Fixed GamePadList not working in DDC and hide MessagePort.start operation.
Fixes https://github.com/dart-lang/sdk/issues/31029

R=vsm@google.com

Change-Id: I757538eec1ebcf42204e7de0807a48a4757f3faf
Reviewed-on: https://dart-review.googlesource.com/49740
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
2018-04-05 15:13:17 +00:00
Lasse Reichstein Holst Nielsen 155e55cbb1 Remove defaultValue parameter from Stream.first/lastWhere.
Change-Id: Id1f642a2f29086a5a7478c771ce16987b340861f
Reviewed-on: https://dart-review.googlesource.com/43420
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-03 10:58:15 +00:00
Lasse R.H. Nielsen 0ba21c25b7 Clean up Map#operator[] documentation
New PR for https://github.com/dart-lang/sdk/pull/32714 to get a squashed view.
Thanks @burkemw3.

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

GitOrigin-RevId: ad3342fc02
Change-Id: I00905dded9de083350051a36657b928454b0a9fe
Reviewed-on: https://dart-review.googlesource.com/49101
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-04-03 07:51:05 +00:00
Sigmund Cherem e01fbecdf5 Fix type in NativeTypedArrayOfDouble
Change-Id: Ifeb5d1bdaa9dce941449217127b7324e3744d6df
Reviewed-on: https://dart-review.googlesource.com/49082
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-04-03 00:15:55 +00:00
Stephen Adams 9858ea1f8d Explicitly store isIntercepted in full emitter tearoffs
The trick of detecting isIntercepted from the number of arguments does
not work with function type arguments. We fixed this in other places,
now fix it in the full emitter.

Change-Id: I35fcda11db1df0e7442b66317c9ea20674514722
Reviewed-on: https://dart-review.googlesource.com/48922
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-03-31 00:02:11 +00:00
Terry Lucas 49558b9c4c Fixed MessageChannel receiveing messages on ports.
Removed pkg browser from tests.

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

R=kevmoo@google.com

Change-Id: Ib0ef5f933d38b2f748cca1f82de8bcf01702df4d
Reviewed-on: https://dart-review.googlesource.com/48742
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
2018-03-30 17:16:15 +00:00
Johnni Winther a6a2152482 Add runtime type representation for void
Change-Id: Id4eff63656fc5eacfa7aada6120d85acec735cad
Reviewed-on: https://dart-review.googlesource.com/48426
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-03-30 11:05:43 +00:00
Zach Anderson 865f52737a [dart:io] Adds IOOverrides.socketConnect
fixes #32535

Change-Id: I335e3698ec3505114d480ae6179254fa0ade3f7a
Reviewed-on: https://dart-review.googlesource.com/48702
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Todd Volkert <tvolkert@google.com>
2018-03-28 23:07:49 +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
Sigmund Cherem 2de82410e0 Make isolate patch play nice with web workers.
Closes https://github.com/dart-lang/sdk/issues/32438

Change-Id: I14163ef868365bf5faecfdfaccb54047391e0f80
Reviewed-on: https://dart-review.googlesource.com/48520
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-03-28 19:14:18 +00:00
Terry Lucas 8e02ff92db Added @category annotation for Web libraries and removed createCustomUpgrader.
TBR=jcollins@google.com

Change-Id: I151e8d8af4bc647bdf47399c11f83b1625dabcf6
Reviewed-on: https://dart-review.googlesource.com/48523
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
2018-03-27 23:53:14 +00:00
Terry Lucas bc75856e54 Update getClientRects, removed xtab, removed bogus entry in dom.json,
expose ServiceWorker, removed query and queryAll from in dart:html,
added constructor to MessageChannel and removed getCssCanvasContext.

Fixed all tests using query and queryAll.

Fixes https://github.com/dart-lang/sdk/issues/25664
Fixes https://github.com/dart-lang/sdk/issues/26349
Fixes https://github.com/dart-lang/sdk/issues/32323
Fixes https://github.com/dart-lang/sdk/issues/32659
Fixes https://github.com/dart-lang/sdk/issues/32675

R=kevmoo@google.com

Change-Id: I687471e80b8fe9c7040673113f424dbaab7c64d4
Reviewed-on: https://dart-review.googlesource.com/48381
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2018-03-27 20:45:33 +00:00
Janice Collins f386b367a5 Update dartdoc to v0.18.0 and tag library categories.
Bug: https://github.com/dart-lang/sdk/issues/32297
Change-Id: Id99c98c1b908c5a4b42594cd7e73cd92e089bbca
Reviewed-on: https://dart-review.googlesource.com/48450
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-03-27 16:19:34 +00:00
Sam Rawlins 301b5a1f16 Remove Maps; move _fillMapWith* methods to MapBase
Fixes #31843

Bug: https://github.com/dart-lang/sdk/issues/31843
Change-Id: I02c544c921951f4a50421205dc1f25997cbecd6e
Reviewed-on: https://dart-review.googlesource.com/39880
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-03-26 21:23:21 +00:00
Johnni Winther 5271cc4e81 Support FutureOr at runtime
Change-Id: I6d442ac160739490c2591367055aaa0ba0c00047
Reviewed-on: https://dart-review.googlesource.com/48143
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-03-26 12:54:58 +00:00
Johnni Winther e6636a5c34 Fix error in function subtyping
Change-Id: I5ccc4e2823c1dcdb84929f9fc0216822808d522a
Reviewed-on: https://dart-review.googlesource.com/48281
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-03-23 23:49:49 +00:00
Sigmund Cherem c033e064bd Fix server.plaform definition for dart:js
This is so we correctly answer `const bool.fromEnvironment("dart.library.js")`
as true when --categories=Server is passed to the compiler.

Change-Id: Id12a0af65905fabc23ef5a1cd3e5fd837bc8b766
Reviewed-on: https://dart-review.googlesource.com/48265
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-03-23 23:44:49 +00:00
Sigmund Cherem 751357d630 Make dart.library.isolate false in consts and config imports
Closes #30539

Change-Id: I037ae91d66ad32059d096d3db8890c456230bb96
Reviewed-on: https://dart-review.googlesource.com/48062
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-03-23 20:21:19 +00:00
Sigmund Cherem 34bb60bbc5 Library specification format: replace 'environment_overrides' with 'supported'.
Change-Id: Ic8172f4574a35ac31910ac0d5934c0d63db40a23
Reviewed-on: https://dart-review.googlesource.com/48060
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-03-23 18:28:59 +00:00
Sigmund Cherem 07d2c9f287 Add server category for dart2js
Change-Id: I077da86aff4420aba1323e98d6cde08ac871f6f1
Reviewed-on: https://dart-review.googlesource.com/47721
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-03-23 00:40:55 +00:00
Sigmund Cherem b66971a45d Fix config specific imports to dart.io and dart.mirrors in dart2js
This uses the environment_overrides section that I'm adding to the libraries
specification files.

Change-Id: I95c175533f21320dd44eab9988afe2644ed0c9d3
Reviewed-on: https://dart-review.googlesource.com/47406
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-03-23 00:02:54 +00:00
Sigmund Cherem 81d1f20943 Copy libraries.json to the generated SDK
Change-Id: Iea4636d150dcf6023c9b5cc59646f10e518bfc04
Reviewed-on: https://dart-review.googlesource.com/48025
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-03-22 23:07:55 +00:00
Sigmund Cherem 898260a998 Split dependency on dart:html from dart:js
This change is needed to be able to introduce a new platform "dart2js_server"
that represents compiling to dart2js for non-browser targets (like nodejs). Some
users (like Dart Sass) depend on this feature.

The old front-end made this work by using "--categories=all", this change should
make it possible to compile with "--categories=Server".

Change-Id: I41bf25ab19016154206c419a48884bdc4afbd444
Reviewed-on: https://dart-review.googlesource.com/47700
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-03-22 22:15:05 +00:00
Terry Lucas 17a778c9cb Changed AudioScheduledSourceNode.start to start2.
Fixes https://github.com/dart-lang/sdk/issues/32624

TBR=kevmoo@google.com

Change-Id: Ied9494a4b9695ae08ff2ef63c43759ea7951e9fa
Reviewed-on: https://dart-review.googlesource.com/47760
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
2018-03-22 13:18:37 +00:00
Régis Crelier f2806ab624 [Corelib, VM runtime] Fix handling of zero operand in Bigint operations (fixes #32465).
Fix VM, dart2js, and dcc Bigint implementations.
Add shift tests.
Re-enable Bigint intrinsics on VM.

Change-Id: Iec19eac8069cf17783a5346289ea2745ffcc7c26
Reviewed-on: https://dart-review.googlesource.com/46570
Reviewed-by: Florian Loitsch <floitsch@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-03-21 21:44:10 +00:00
Sigmund Cherem a5966ad988 Fix dart2js libraries.yaml
Long ago I accidentally only made the change to _cfe.dart in the .json file and
not in the .yaml file (which is technically the source of truth).

Change-Id: I0e8abdc84b9b0f20019c712246493979debaf1cd
Reviewed-on: https://dart-review.googlesource.com/47323
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-03-20 22:29:19 +00:00
Terry Lucas 581c512345 Fixed DOMRectList not having a prototype field.
TBR=vsm@google.com

Change-Id: I6cbc38bbb2123b914d5b5511774425c403e614ed
Reviewed-on: https://dart-review.googlesource.com/47183
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
2018-03-20 01:08:47 +00:00
Lasse Reichstein Holst Nielsen a81bc639b5 Fix bug in BigInt.from with certain double values.
Add test.

Change-Id: I385f7237e1b3d004b4401e18a82919b15d097181
Reviewed-on: https://dart-review.googlesource.com/46460
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2018-03-19 17:46:35 +00:00
Alexey Knyazev 4f1f5f8167 Reland "Do not return this on RandomAccessFile.close"
This is a reland of 44aa9a17fd

Original change's description:
> Do not return this on RandomAccessFile.close
> 
> Bug: 32015
> Change-Id: I98508bdad569201afeed91f1287f061b5bb39a31
> Reviewed-on: https://dart-review.googlesource.com/44060
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>

Bug: 32015
Change-Id: I96d870e083d7862cf0f6ad664364cf7ddef0f598
Reviewed-on: https://dart-review.googlesource.com/46780
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-03-19 13:45:25 +00:00
Lasse Reichstein Holst Nielsen c43b1d66b5 Fix typo in map.update.
Add tests.

Change-Id: If27b6c987c944ebb84d43acde012f5b44730c4e7
Reviewed-on: https://dart-review.googlesource.com/45501
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2018-03-19 10:54:15 +00:00
Terry Lucas 60469482f1 Move ClientRect members to DOMRect.
TBR=sigmund@google.com,sra@google.com

Change-Id: I424b087830954329f4399f6b169f572196a4f658
Reviewed-on: https://dart-review.googlesource.com/46948
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
2018-03-18 13:27:46 +00:00
Terry Lucas ef6273cba0 Dart Web Libraries re-generated based on Chrome 63 WebIDLs.
This is a migration of 13 Chrome release about 1.5 years of Chrome releases.
Update PYTHON scripts for cleaner and easier rolling.

Here's a doc on the changes that might affect Dart users:
https://docs.google.com/document/d/1Kj0nk3SueO3JKub8im7z3znu9j5oiI7vf49ejZrMxuE/edit#

Change-Id: I768fbd09b04fe6884af36ac102d5813f67bae426
Reviewed-on: https://dart-review.googlesource.com/24501
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
2018-03-18 09:41:04 +00:00
Eric J. Duran 6ee70f9a2c Fixing #32455 - Replace precisley with precisely (#32460) 2018-03-16 08:51:04 -07:00
Kevin Millikin 1abf929476 Fix some uses of deprecated API
Fix all deprecation warnings in the kernel and vm packages.

Change-Id: I44e5b128cc8fbc1360ad4c49ecdf2aa7cfd269d8
Reviewed-on: https://dart-review.googlesource.com/46720
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-03-15 10:09:23 +00:00
Ben Konyi b28c4664c0 Revert "[VM] Move runtime/lib/{developer,profiler,timeline}.dart -> ..._patch.dart, fix owner of constructors"
This reverts commit 60a2cfa219.

Change-Id: I6d83653c72d5e8576952a631d23be5be5d9c71f6
Reviewed-on: https://dart-review.googlesource.com/46384
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-03-13 22:24:19 +00:00
Lasse R.H. Nielsen 6f13072739 Add toString to MapEntry.
Fixes #32464

BUG: http://dartbug.com/32464

Change-Id: I1462452c3f6a7838aeaaa84e3fb0e092a3f85338
Reviewed-on: https://dart-review.googlesource.com/45704
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2018-03-13 13:57:59 +00:00
Lasse R.H. Nielsen 00dae36b47 Add of constructors to collections.
Change-Id: Ic9a180cbb758cf8fe51369d904fa4b51fd1b8e27
Reviewed-on: https://dart-review.googlesource.com/44480
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-03-13 12:57:49 +00:00
Martin Kustermann 60a2cfa219 [VM] Move runtime/lib/{developer,profiler,timeline}.dart -> ..._patch.dart, fix owner of constructors
This makes sure we can distinguish e.g. 2 different timeline.dart files
(from runtime/lib/timeline.dart and sdk/lib/developer/timeline.dart)

This CL also fixes the owner of constructors to be patch classes, if
the constructors come from a patch.

This CL also adds a service/valid_source_locations_test, which loops
over libraries/classes/fields/functions and obtains source locations for
them, including line numbers.  This ensures that if there is a source
location attached to a member, we can use it's token position to get to
the line number.

This CL also changes package:kernel's [Cloner] to clone fileOffsets (and
not just fileEndOffsets). This is important for mixin resolution, where
we copy members into mixin application classes.

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

Change-Id: I4fea5cd646d81f47e1c4ede1e86d477ba6de3e82
Reviewed-on: https://dart-review.googlesource.com/46141
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-03-13 10:27:26 +00:00
Lasse Reichstein Holst Nielsen 0b5d718489 Change return type of decodeBase64 to Uint8List.
Matches base64.decode.

Change-Id: Ida4e2a450940217959089d5bc48b6462b52df755
Reviewed-on: https://dart-review.googlesource.com/46140
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-03-13 08:12:52 +00:00
Lasse Reichstein Holst Nielsen 414a3318ea Add jsonDecode, jsonEncode, base64Decode, base64Encode, base64UrlEncode functions.
Change-Id: Ic65ada3b107cc8e6c3459459c4bea389feef2168
Reviewed-on: https://dart-review.googlesource.com/23664
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-03-12 09:16:27 +00:00
Ryan Macnak 439badf2c0 Revert "[build] Declare dependency of the version strings on the current Git commit."
This reverts commit c080951d45.

Reason for revert: Breaks Debian source package

Original change's description:
> [build] Declare dependency of the version strings on the current Git commit.
> 
> Bug: https://github.com/flutter/flutter/issues/15348
> Change-Id: Ifef1b55c6efe0f030ee83e4c43a774c7cd049fac
> Reviewed-on: https://dart-review.googlesource.com/45921
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>

TBR=aam@google.com,rmacnak@google.com,zra@google.com,phosek@google.com

Change-Id: I16ff18213bd1592c21bd9ae99b6e97fbdfc1824c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/flutter/flutter/issues/15348
Reviewed-on: https://dart-review.googlesource.com/45980
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-03-10 00:39:50 +00:00
Ryan Macnak c080951d45 [build] Declare dependency of the version strings on the current Git commit.
Bug: https://github.com/flutter/flutter/issues/15348
Change-Id: Ifef1b55c6efe0f030ee83e4c43a774c7cd049fac
Reviewed-on: https://dart-review.googlesource.com/45921
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-03-09 23:24:08 +00:00
Stephen Adams b8093e3323 Generate signature of instantiated generic function from uninstantiated function
Change-Id: I8c02404e5a17f577d831f3a3b58ff075ad73e878
Reviewed-on: https://dart-review.googlesource.com/45755
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-03-09 21:05:38 +00:00
Leaf Petersen 4c881188b2 Disable the .whereType method until generic methods are turned on.
The whereType method silently does the wrong thing without methods,
so make it throw until we turn them on everywhere.

Change-Id: Id934c8bdb4f682dbc3560d78fbca580e37297e2d
Reviewed-on: https://dart-review.googlesource.com/45744
Reviewed-by: Nate Bosch <nbosch@google.com>
2018-03-08 23:14:22 +00:00
Lasse Reichstein Holst Nielsen b3c12d4e3a Dart 2 Libraries Wave 3
Add `typeArguments` to Invocation.
Add constructors to Invocation, making it less necessary for users to create their own implementations.
Add tests.
Add Symbol.unaryMinus and Symbol.empty constants.

Change-Id: I70cb3265f9413617cf57fce1297e393a29eeb26a
Reviewed-on: https://dart-review.googlesource.com/40741
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-03-08 16:36:07 +00:00
Vyacheslav Egorov 675048d0b6 Add pragma class to dart:core.
This class can be used to annotate declarations with
tool specific hints.

For example @pragma('vm:extern') can tell that a method is invoked from
outside (e.g. via VM C API), which informs Kernel based tools not to
tree-shake this method.

Design doc (internal) https://docs.google.com/document/d/1yqje8uctBqITcwKxhebb0EHunY1bt0Qd4yZExrTHIW8/edit

Change-Id: Icf2106accfb1167124582466a3a55486d432793d
Reviewed-on: https://dart-review.googlesource.com/43062
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-03-07 11:01:57 +00:00
Lasse R.H. Nielsen bda78a0f41 Deprecated old upper-case constants.
Change-Id: Ia923f953069bd41dbd5f0f3dc48aa55bad46aabd
Reviewed-on: https://dart-review.googlesource.com/45220
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-03-06 14:17:01 +00:00
William Hesse e59018e714 Revert "Do not return this on RandomAccessFile.close"
This reverts commit 44aa9a17fd.

Reason for revert: The dartdoc API documentation generator cannot handle Future<void> yet.  This is filed as a P0 issue, and the change should be relanded when it is fixed: https://github.com/dart-lang/dartdoc/issues/1625

Original change's description:
> Do not return this on RandomAccessFile.close
> 
> Bug: 32015
> Change-Id: I98508bdad569201afeed91f1287f061b5bb39a31
> Reviewed-on: https://dart-review.googlesource.com/44060
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>

TBR=lrn@google.com,vegorov@google.com,zra@google.com,sigmund@google.com,lexa.knyazev@gmail.com

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

Bug: 32015
Change-Id: I658b997cdc62e23cfb4fec8921e19239d534e272
Reviewed-on: https://dart-review.googlesource.com/44980
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2018-03-05 13:10:41 +00:00
Alexey Knyazev 44aa9a17fd Do not return this on RandomAccessFile.close
Bug: 32015
Change-Id: I98508bdad569201afeed91f1287f061b5bb39a31
Reviewed-on: https://dart-review.googlesource.com/44060
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-03-03 19:46:01 +00:00
Stephen Adams 8e8287f4e0 Add classes for instantiations
Change-Id: Iee9df3ad673012776cd1867448ff12ba692a863f
Reviewed-on: https://dart-review.googlesource.com/41564
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-03-03 00:50:59 +00:00
Sigmund Cherem 7fd5294bb3 Add rules to build dart2js platform in strong mode
This must land after we make the libraries strong clean.

Change-Id: I3a49a2be3b2bcb15842434266f55ce49e3800fc6
Reviewed-on: https://dart-review.googlesource.com/42140
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-03-02 22:19:19 +00:00
Kevin Moore 751de54dc0 Remove invalid dart:collection link in doc comments
Fixes https://github.com/dart-lang/sdk/issues/31246

Change-Id: I6549cbb074102616c8f000d9b83555cba5ebabc7
Reviewed-on: https://dart-review.googlesource.com/44582
Reviewed-by: Devon Carew <devoncarew@google.com>
2018-03-02 21:45:27 +00:00
Stephen Adams 109316c484 Force inlining to match AST version
These are a couple of cases where inlining differs from the previous
version and makes a difference in angular code.

Change-Id: Ibc8ba0d720b8bb49481c41e1332fc6a4a0292d9d
Reviewed-on: https://dart-review.googlesource.com/44701
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-03-02 20:10:49 +00:00
Lasse R.H. Nielsen 3a769b9dbe Add missing methods to make classes Dart 2 valid.
Change-Id: I9a2e07de692127069d8098e3a0ea45846a3f45ae
Reviewed-on: https://dart-review.googlesource.com/43672
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2018-03-02 14:01:49 +00:00
Lasse R.H. Nielsen 34f09ac4c8 Wave 2.2 Step 2: Deprecated first/lastWhere's defaultValue parameter.
Change-Id: Iabfd7a990ff723a2d861ee7034f6569c2ca948cc
Reviewed-on: https://dart-review.googlesource.com/43401
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-03-01 14:12:08 +00:00
Lasse R.H. Nielsen 9ee735b659 Add missing methods to List and Map implementations.
Optimize FollowedBy when the operands have efficient length.

Change-Id: I0af59240d70b929358c06b8d57a85df2deee6aaf
Reviewed-on: https://dart-review.googlesource.com/43665
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-02-28 12:26:53 +00:00
Jenny Messerly 8bce74bc05 Remove dart:html import of dart:isolate
dart:isolate was used for the `Future<Isolate>` return type of
spawnDomUri, which is an unimplemented experimental method. This method
now returns `Future`.

This change helps dart4web disable support for dart:isolate (#30538)

Change-Id: Ida87c2a27ac33d1b9a14feb7dd6d306a546a0aaf
Reviewed-on: https://dart-review.googlesource.com/43860
Reviewed-by: Terry Lucas <terry@google.com>
2018-02-28 07:25:00 +00:00
Kathy Walrath aee7d5773d API doc updates
* Update the API doc index page
* Update dart:io API description

Change-Id: I3e3574fc8d188e0d2fb5033c523f314590c4214c
Reviewed-on: https://dart-review.googlesource.com/43891
Reviewed-by: Kathy Walrath <kathyw@google.com>
Commit-Queue: Kathy Walrath <kathyw@google.com>
2018-02-28 01:23:46 +00:00
Siva Chandra 4f5ad1918c Make strong mode the default under --preview-dart-2.
Change-Id: Ic1637d65a34f6b0310439293f7d83cb351f2c89c
Reviewed-on: https://dart-review.googlesource.com/43200
Commit-Queue: Siva Chandra <sivachandra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-27 22:16:07 +00:00
Sigmund Cherem e33f4f7c2e Fail if mirrors are really used.
Some legacy libraries may import dart:mirrors, but not use it. This CL turns them
into a runtime error temporarily to give some time for the library
maintainers to remove the import to dart:mirrors in the future.

Change-Id: I876133908d2a61300256915aab54730bdff51649
Reviewed-on: https://dart-review.googlesource.com/43640
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-02-27 04:57:27 +00:00
Lasse R.H. Nielsen 8d38d94ddb Add static list methods.
Change-Id: I40574d695826a3ed038c7c756ce980fae001325d
Reviewed-on: https://dart-review.googlesource.com/43040
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-02-26 11:34:43 +00:00
Terry Lucas 9f09ef0af3 - Fixed callback signatures with indexed_db open method to expose VersionChangeEvent and
Event type parameters instead of dynamic.
- Fixed missing interceptor in dart2js for MutationEvent (even though its deprecated
and should not be used).  The MutationEvent is created when a node is deleted. Enabled
Dart MutationEvent class generation.
- Fixed/re-enabled all indexed_db tests to run and pass successfully.

Stephen please take a look - target in VersionChangeEvent is a final field, per your suggestion,
instead of a getter.  The MutationEvent is returned in the browser and without the MutationEvent
Dart class the error:

     Uncaught TypeError: t1.get$target is not a function


R=vsm@google.com,gabrielchow@google.com,sra@google.com

Change-Id: Ic36aea8c33b4263a32ff9d047ba3e6b979e03b10
Reviewed-on: https://dart-review.googlesource.com/41569
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
2018-02-23 14:29:45 +00:00
Maksim Ryzhikov a218445ead Fix Doc typo in the example
Closes #32287
https://github.com/dart-lang/sdk/pull/32287

GitOrigin-RevId: 6ea54882bd45566454ab44adbfa96ca11aa4ec3d
Change-Id: Ieba69f244e5ddef77e2074f666bec04825e47bc5
Reviewed-on: https://dart-review.googlesource.com/43360
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-23 10:20:50 +00:00
Lasse Reichstein Holst Nielsen eaf49211ce Document deprecation of @proxy.
Fixes #32251

Bug: http://dartbug.com/32251
Change-Id: I080f95eb99ed5c3dc058ac84fd9194ff72f59b0a
Reviewed-on: https://dart-review.googlesource.com/42760
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-02-23 09:26:23 +00:00
Kevin Moore 922c0b5664 Fix Doc comment issues with Map and mirrors
Change-Id: I86c8d849c8137854b3a2dfa966cf86c9475f9f72
Reviewed-on: https://dart-review.googlesource.com/43201
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-02-23 01:59:44 +00:00
Stephen Adams 9598a1d1fa Add HAbs instruction
This change is to recover 6% lost on Intl.NumberFormat.format.reused
when JSNumber was make Dart2 clean.

Use invoke_dynamic_specializer to replace call with HAbs instruction.

Inject receiver check to condition receiver to a non-null number to
improve. This part makes x.abs() one of the operations 'trusted' by
'--trust-primitives'.

Add one-shot accelerators for abs and get:sign.

Change-Id: Ia423c4b398114abe1d4a784febbe664710f0a242
Reviewed-on: https://dart-review.googlesource.com/42890
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-02-22 22:21:41 +00:00
Vyacheslav Egorov a564c1f79c [corelib] Fix strong mode issue in http implementation
Fixes https://github.com/dart-lang/sdk/issues/32274
Fixes https://github.com/flutter/flutter/issues/14819

Bug: 32274
Change-Id: I4d294681d0d751119b8966fb3ce26f6fdbf81e39
Reviewed-on: https://dart-review.googlesource.com/43020
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-02-22 13:35:33 +00:00
Stephen Adams 284312b101 Test for compiled-to-JavaScript version of BigInt.isValidInt
In JavaScript, and integral valued double is an 'int'.

Change-Id: I79dedcb00f74dc699f85a21a2052239ed25b7974
Reviewed-on: https://dart-review.googlesource.com/41640
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-02-22 04:07:52 +00:00
Sigmund Cherem ed041212d8 Changes to JSInt and JSNumber to make the sdk strong-clean
This may introduce extra interceptor methods for JSInt, we should consider
optimizing these separately (see https://github.com/dart-lang/sdk/issues/32252)

Change-Id: I26ee463c8672d67cd44b21b6ac50a1842b6e7b1e
Reviewed-on: https://dart-review.googlesource.com/42523
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-02-21 01:59:19 +00:00
Sigmund Cherem e6e6efc3bc Changes to patch files to make them strong-clean
This is a partial list, there are still 8 issues remaining, most of them in
js_number.dart, one that is not but the FE is not giving me a location for some
reason.

Change-Id: I2bd1d24256147e255f487e100ce800c3ba791ce5
Reviewed-on: https://dart-review.googlesource.com/42122
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-02-20 20:19:15 +00:00
Stephen Adams e1cfc35572 Update dart2js/ddc int.bitLength
1. Make bitLength work on very large values. This fixes problems with
BigInt.from on large values.

2. Restructure to allow Math.clz32 to be used once dart2js no longer
supporst IE11.

Change-Id: I255f030ff3b3630cdee63502d11a8b6630a4f008
Reviewed-on: https://dart-review.googlesource.com/41960
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-02-16 22:26:35 +00:00
Lasse R.H. Nielsen fed7120b07 Make UnmodifiableMapView not lose unmodifiability on cast/retype.
Change-Id: I44c084353b35e16cd2fd5481d86a7be6c0b62ef3
Reviewed-on: https://dart-review.googlesource.com/41160
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-02-14 12:49:23 +00:00
Régis Crelier 4c9a842d61 [corelib] Cleanup isValidInt and toInt() in new BigInt implementation.
Change-Id: I1f107d4f6e26ea3644bc6c9f7cff5ee6fac43958
Reviewed-on: https://dart-review.googlesource.com/40512
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-02-14 03:43:52 +00:00
Rafal Wachol 91890156cc Added ability to set User Agent for Websocket connection.
Bug: https://github.com/dart-lang/sdk/issues/32008
Change-Id: Ia74689e808a57b00a518e6a32f1763a40afc5860
Reviewed-on: https://dart-review.googlesource.com/40220
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-02-13 06:15:53 +00:00
Stephen Adams d78c05279a dart2js runtime Dart 2 subtype check (mostly)
This change adds most of Dart 2 subtype checking to js_runtime.
The main observable change is the stronger subtyping of function types.
The subtype code is split into V1 and V2 methods with the intention to
eventually remove the V1 paths.

There is a lot of minor details that are still TODO:

- TODO: generalized void
- TODO: comparison on type variable by it's bound
- TODO: FutureOr

Change-Id: Id05db0aef5ce0d58416a72f1538a90ed67436b3e
Reviewed-on: https://dart-review.googlesource.com/37960
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-02-12 23:54:48 +00:00
Zachary Anderson 23fe39e89f [dart:typed_data] Adds unmodifiable list views
On Fuchsia, we need external typed data arrays that are backed by
read-only regions of memory. Today, writes to these typed data
lists crash the process. This change allows us to wrap the
external typed data in unmodifiable views so that an exception
is thrown instead of crashing.

related #32028

Change-Id: I94dc5e1771b73480cb0eb21799215c090000fd5f
Reviewed-on: https://dart-review.googlesource.com/40201
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-02-12 16:30:51 +00:00
Lasse R.H. Nielsen 0d5ce913c9 Add cast/retype to Stream, StreamTransformer and Converter.
Switch default for StreamController.addStream cancelOnError parameter to false.
Add orElse named argument to Stream.{first,last}Where.
First step in renaming the argument from defaultValue to orElse.

Change-Id: I22039c1f6933664ebc287c71e802799a64776f08
Reviewed-on: https://dart-review.googlesource.com/34822
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-02-09 14:09:39 +00:00
Lasse R.H. Nielsen bdc6e9c862 Add ticks counter to Timer.
Change-Id: Ie5ed28fa8b7ef9c6aea97331267cf3c717b17099
Reviewed-on: https://dart-review.googlesource.com/21342
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-02-08 10:16:00 +00:00
Lasse R.H. Nielsen 6f78471687 New methods on Iterable, List, Set, Queue, Map.
Changes signature of Iterable.singleWhere.
Makes LinkedHashMap no longer be a HashMap.

Change-Id: I7a12fea533d42b0fc8357086649df38ad01f3cdd
Reviewed-on: https://dart-review.googlesource.com/39140
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-02-07 06:12:53 +00:00
Zachary Anderson c8a8674d97 [dart:cli] Fix waitFor for Future that completes with null
fixes #32052

Change-Id: Id7a8b0da09c95436387eb57cc47b0b1489db0f0c
Reviewed-on: https://dart-review.googlesource.com/38924
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-02-06 15:43:33 +00:00
William Hesse 9c35cff5cd Revert "New methods on Iterable, List, Set, Queue, Map."
This reverts commit 0b59f24f97.

Reason for revert: Creates crashes in dart2js with kernel, see
https://luci-milo.appspot.com/buildbot/client.dart/dart2js-linux-d8-minified-1-5-be/9751

Original change's description:
> New methods on Iterable, List, Set, Queue, Map.
> Changes signature of Iterable.singleWhere.
> Makes LinkedHashMap no longer be a HashMap.
> 
> Change-Id: Ibd7e56e1ac03cb9fb10d19d1328d452fcd06d89f
> Reviewed-on: https://dart-review.googlesource.com/32541
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>

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

Change-Id: Iab904f5885a5213ae2e16ef496eed0b6843185f3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/39060
Reviewed-by: William Hesse <whesse@google.com>
2018-02-06 13:32:19 +00:00
Lasse R.H. Nielsen 0b59f24f97 New methods on Iterable, List, Set, Queue, Map.
Changes signature of Iterable.singleWhere.
Makes LinkedHashMap no longer be a HashMap.

Change-Id: Ibd7e56e1ac03cb9fb10d19d1328d452fcd06d89f
Reviewed-on: https://dart-review.googlesource.com/32541
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-02-06 11:17:46 +00:00
Terry Lucas d7a8aa155f Fixed a number of File API methods in DDC.
R=vsm@google.com

Change-Id: I77881201f1e89f731476655476eb865e10d581a1
Reviewed-on: https://dart-review.googlesource.com/38164
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-02-05 22:29:00 +00:00
Peter von der Ahé 861550a28c Read patch files in strong mode
Closes https://github.com/dart-lang/sdk/issues/28822

Change-Id: I05e1d9885a39efca131d78d06cfd8a0e84276bb9
Reviewed-on: https://dart-review.googlesource.com/36641
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-02-05 14:35:36 +00:00
Devon Carew 9dfb7b2f75 dart:convert typo
Change-Id: Icbb22730a1ebfeaf19b34bbf363ddd12dc01fff2
Reviewed-on: https://dart-review.googlesource.com/38420
Reviewed-by: Kevin Moore <kevmoo@google.com>
2018-02-03 05:10:59 +00:00
Florian Loitsch 3b8e4d41a7 Reapply "Run async functions immediately."
Which was reverted in commit 032be73dbe.
Originally commited in commit 67bac0bce6.
Original review URL: https://dart-review.googlesource.com/5263

Change-Id: Ic7333c29e502a3924dc6aade8ffa46fc8aa5b04a
Reviewed-on: https://dart-review.googlesource.com/38120
Commit-Queue: Florian Loitsch <floitsch@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-02-02 15:50:16 +00:00
Florian Loitsch 032be73dbe Revert "Run async functions immediately."
This reverts commit 67bac0bce6.

Reason for revert: broke the bot.

Original change's description:
> Run async functions immediately.
> 
> Migrated from https://codereview.chromium.org/2478703003/
> 
> Change-Id: I1d678c01ba5876490b12c676c500171328361d31
> Reviewed-on: https://dart-review.googlesource.com/5263
> Commit-Queue: Florian Loitsch <floitsch@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Vijay Menon <vsm@google.com>
> Reviewed-by: William Hesse <whesse@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

TBR=whesse@google.com,rnystrom@google.com,vegorov@google.com,kustermann@google.com,zra@google.com,floitsch@google.com,jmesserly@google.com,vsm@google.com,regis@google.com,sigmund@google.com

Change-Id: I20c948057423c3fa5aa8c72843f8f2a17e086ad5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/37981
Reviewed-by: Florian Loitsch <floitsch@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-02-01 15:01:21 +00:00
Florian Loitsch 67bac0bce6 Run async functions immediately.
Migrated from https://codereview.chromium.org/2478703003/

Change-Id: I1d678c01ba5876490b12c676c500171328361d31
Reviewed-on: https://dart-review.googlesource.com/5263
Commit-Queue: Florian Loitsch <floitsch@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-02-01 14:08:57 +00:00
Lasse Reichstein Holst Nielsen 0c18b643c6 Add RegExp.escape methods.
Fixes 4706

Bug: http://dartbug.com/4706
Change-Id: If635cb0eb7c20405ab0127a443fe51176191b5ad
Reviewed-on: https://dart-review.googlesource.com/35641
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-02-01 09:56:47 +00:00
Régis Crelier 25d7d355db Provide distinct BigInt implementation classes in VM, dart2js, and dartdevc.
The classes are still identical, but will diverge as the VM will provide an
optimized version.

Change-Id: I8397fd927b89fa745ac7aa4b8d98e562140f731b
Reviewed-on: https://dart-review.googlesource.com/35521
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-01-29 18:12:34 +00:00
Samir Jindel 68554ab8f5 [kernel] Support "dart-ext:..." imports in the CFE.
They are encoded as annotations on the importing library, similarly to
how native methods are encoded.

Change-Id: I4dc1119b20949308e4856666693fe4e890e9ee87
Reviewed-on: https://dart-review.googlesource.com/35660
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-01-29 14:04:25 +00:00
Zachary Anderson 6523896c6f [dart:io] Adds ProcessStartMode.INHERIT_STDIO
Adds a ProcessStartMode in which the child process inherits the stdio
handles from the parent.

Change-Id: Ibe7b8ae08caccaed827ae0a911a3cced7803cb6b
Reviewed-on: https://dart-review.googlesource.com/36362
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-01-23 22:50:06 +00:00
Zachary Anderson 71d356d5fe [fuchsia][dart:io] Allow the embedder to specify handles for stdio
The content handlers on Fuchsia can potentially give each Isolate
different handles to use for stdout and stderr. This change provides
a hook for an embedder to call to supply the handles to Dart, and
removes hardcoding of stdio handles to 0, 1, 2.

Change-Id: Ic03b77adc9a911e9c754562fa6a91f9929e10dfc
Reviewed-on: https://dart-review.googlesource.com/36122
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-01-22 21:09:39 +00:00
Terry Lucas 0a02050867 Fixed DirectoryReader returned from createReader to exist in DDC.
R=vsm@google.com

Change-Id: I6761da70b2f51f235534ee10fa0b7cb7a7a98659
Reviewed-on: https://dart-review.googlesource.com/36020
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-01-19 18:14:05 +00:00
Lasse R.H. Nielsen 20c6215c52 Prepare SDK for wave 2.2 migration.
With these changes, migration can more efficiently convert existing
code, and can actually change the addStream signature to not specify
"true".

Change-Id: I65a90afe2716e9a99d41e5f55bf1e0dcc5d3e40e
Reviewed-on: https://dart-review.googlesource.com/35183
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-01-19 09:16:55 +00:00
Zachary Anderson 09fd9dec7a [dart:cli] Fix doc comment typo
Change-Id: Id68426b6a570d250f7f11a4d6d3e054caa90c6a6
Reviewed-on: https://dart-review.googlesource.com/35762
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-01-18 18:49:34 +00:00
Zachary Anderson 09dc8611b4 [infra] Add cli lib to built sdk lib/ dir
Fixes analyzer test failures on the bots.

Change-Id: I426ce7be20bac0ab57b8921db0ffa5fe2be15871
Reviewed-on: https://dart-review.googlesource.com/35760
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-01-18 17:46:39 +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
Erik Corry c8ae9bf77b [VM] Stop treating 0x180e as whitespace
This aligns us with JS engines and Unicode 6.3

R=lrn@google.com

Bug: 29060
Change-Id: I0b6356f0e652f7c9841bcf6485aa591a3d835061
Reviewed-on: https://dart-review.googlesource.com/35560
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Corry <erikcorry@google.com>
2018-01-18 10:37:15 +00:00
James Robinson 138d587e3a [gn] Remove uses of is_fuchsia_host GN variable
Some parts of the Dart build need to be customized when running the
host steps for a build ultimately targeting a Fuchsia build. This was
set by passing a special GN variable indicating that a configuration
was a host configuration targeting a Fuchsia build, but the built-in GN
variable 'target_os' has the same result as it is the same across all
toolchains in a particular build.  This replaces the test:
  is_fuchsia || is_fuchsia_host

with the equivalent:
  target_os == "fuchsia"

and the less common:
  is_fuchsia_host

with:
  target_os != current_os && target_os == "fuchsia"

Change-Id: Iabec1fb2879b234ca44c9e03b2f4a62ffbc6fa4a
Reviewed-on: https://dart-review.googlesource.com/35542
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-01-18 06:05:56 +00:00
Stephen Adams 8a7c3331df dart2js: Make String.split return List<String>
Two follow-on optimization would reduce the generated code to closer to the original size:

- It would be profitable to write an optimization the removes the type
  information from any list when it can be proven the type information
  is not used.

- Provided the split result list is not modified, we can strengthen
  accesses to be non-null Strings.

Bug: https://github.com/dart-lang/sdk/issues/30548
Change-Id: I87ecdd129ec0227f982bd2e1f34193b3d6b0d81b
Reviewed-on: https://dart-review.googlesource.com/35081
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-18 02:02:24 +00:00
Alexander Markov 7bd5093f83 [corelib] Fix type argument of Iterable from EmptyIterable.map
Change-Id: Ifee26537d05848e4ea6d354f5d57e0f14574d050
Reviewed-on: https://dart-review.googlesource.com/35460
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-01-17 22:31:18 +00:00
Kevin Moore 0d785569d1 Fix library dartdoc references
Change-Id: Idf83e7f5dfb95e0097fa73fa0a0ecd68c76d2ac9
Reviewed-on: https://dart-review.googlesource.com/35381
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2018-01-17 20:01:18 +00:00
Sigmund Cherem c241078b10 Cleanup dart2js snapshot generation
- I beleive create_snapshot.dart is no longer in use: it was replaced by
  create_snapshot_entry + GN application snapshot rules.

- utils_wrapper seems to be something really historical (maybe we thought we
  were going to only have a single wrapper for all of our tools back in the
  day). The only use of it is to track build dependencies in test.py, which I
  think we can do by directly using dart2js.dart.snapshot instead.

Change-Id: I6e32403eb8c5d40f0b58e48ae5ff6fb60fd855b3
Reviewed-on: https://dart-review.googlesource.com/34923
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-01-17 00:35:34 +00:00
Sigmund Cherem 0c04eb53c7 Disable int64 when running dart2js
The goal is to renable it as soon as we migrate our constant-evaluator and
constant folding to use Bigint.

Change-Id: I3bba1bbe07517e9cb496896b3417f58173878d62
Reviewed-on: https://dart-review.googlesource.com/34302
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-01-16 19:52:22 +00:00
Lasse R.H. Nielsen 6178cc17ed Change the static castTo methods to be named castFrom.
It's just a better name.

Bug:
Change-Id: I0bf42b53fb5041faa307d288ffe12fb4b1ac7068
Reviewed-on: https://dart-review.googlesource.com/34180
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-01-15 08:59:31 +00:00
Paul Berry 45b02f8216 Use the new spec for Future flattening for type inference
Change Fasta type inference and Kernel type checking to use the new
definition for Future flattening, which is really unwrapping (peeling
off one layer of Future or FutureOr).  Use this for inferring types of
`await` expressions and return types from `async` functions.

Ensure that we are using the same notion of flattening for inference
and checking.  (Maybe it was a red flag that we weren't.)

This fixes await_test so that it produces a runtime error rather than
a compile time error - see #31541.

A similar change will need to be made to the analyzer - see #31887.

Change-Id: I7d936e9788969a48fdc216628eaa793389fb5e30
Reviewed-on: https://dart-review.googlesource.com/34504
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-01-15 07:09:36 +00:00
Siva Chandra 4b73d12082 Link kernel service dill with the command line dart executable.
This linked in kernel service dill file will be used to load the kernel
isolate if the attempt to lookup the kernel service snapshot fails. The
kernel service snapshot is looked up in the following order.

1. If the "--dfe" option is specified, the file specified is used.
2. If the kernel service snapshot is found next to the executable,
then it is used.
3. If the kernel service snapshot is found in the "snapshots" directory
next to the executable, then it is used.

Change-Id: I5a0e757eb27b26a274b22b4bc36350fee59a100f
Reviewed-on: https://dart-review.googlesource.com/32446
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Chandra <sivachandra@google.com>
2018-01-12 20:40:41 +00:00
Ryan Macnak 9cf7d6fa93 Partial static mode changes for vm-service and tests (part 4).
Bug: https://github.com/dart-lang/sdk/issues/31587
Bug: https://github.com/dart-lang/sdk/issues/31696
Change-Id: I2b37ad97da0520db08f43981fdbc48b094942a0e
Reviewed-on: https://dart-review.googlesource.com/34306
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-01-12 20:12:41 +00:00
Ryan Macnak a4f3b53fe8 Reapply "Partial static mode changes for vm-service and tests (part 3)."
Remove use of castTo, which is not yet available in the prebuilt SDK used to build Observatory.

Bug: https://github.com/dart-lang/sdk/issues/31587
Change-Id: Ia118710a2c4dca1851935d284e1a78a9c6517256
Reviewed-on: https://dart-review.googlesource.com/34022
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-01-11 01:31:17 +00:00
Stephen Adams f756c5e71d Print names for generic method type parameters in function type
- Added JS_GET_FLAG('STRONG_MODE') allow the code to be tailored to
the type system version.

 - Split type stringifying code into V1 (existing logic) and V2
(strong mode Dart 2.0 logic).

The V1 code will eventually be deleted.

Change-Id: I78db91796040b6ecfa1bd5d6a9d64bd4c2bc4bcf
Reviewed-on: https://dart-review.googlesource.com/33680
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-01-10 21:00:48 +00:00
Vijay Menon bedf7121e0 Wire build rules to generate ddc-kernel versions of SDK files
Change-Id: I7d39bce7a3382c7a332ecdc4886bb08dabfdf09a
Reviewed-on: https://dart-review.googlesource.com/33900
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-01-10 18:34:38 +00:00
Devon Carew 8a60ff77d3 Documentation updates for dart:developer.
Bug:
Change-Id: Ib866d4eb347938aebb6f0dca8a8b1ec2827830d8
Reviewed-on: https://dart-review.googlesource.com/32900
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-01-10 17:24:09 +00:00
Jens Johansen 37c28f8661 Revert "Reapply "Partial static mode changes for vm-service and tests (part 3).""
This reverts commit c9f6e8695d.

Reason for revert: Change brakes Observatory:

```
$ out/ReleaseX64/dart --observe hello.dart
Observatory listening on http://127.0.0.1:8181/
Hello, world!
vm-service: isolate(348927110)  'hello.dart:main()' has no debugger attached and is paused at exit.  Connect to Observatory at http://127.0.0.1:8181/ to debug.
```

Going to the website I get
```
Unexpected exception:

NoSuchMethodError: method not found: 'castTo'
Receiver: ""
Arguments: [Instance of 'it']

StackTrace:

main.dart.js 2017:3     Object.f
main.dart.js 2203:30    Object.qn
main.dart.js 21316:11   b3.aQ
main.dart.js 20634:6    b3.c2
main.dart.js 20643:8    TZ.$1
main.dart.js 36992:29   UB.$0
main.dart.js 36982:9    Ux.nq
main.dart.js 36990:30   UC.$1
main.dart.js 36992:29   UB.$0
main.dart.js 36982:9    Ux.nq
===== asynchronous gap ===========================
main.dart.js 4840:12    Zh.e4
main.dart.js 3930:17    L.lK
main.dart.js 3932:28    L.ad
main.dart.js 20621:12   b3.dart.ba.lE
main.dart.js 20621:112  b3.dart.ba.lE
main.dart.js 20603:22   b3.cD
===== asynchronous gap ===========================
main.dart.js 4840:12    Zh.e4
main.dart.js 3930:17    L.lK
main.dart.js 3932:28    L.ad
main.dart.js 20621:12   ms.dart.ba.lE
main.dart.js 20621:112  ms.dart.ba.lE
main.dart.js 15829:10   Y4.bs
```

and Observatory is completely broken.

From https://github.com/dart-lang/sdk/issues/31397 it seems that Observatory uses an "old" sdk, i.e. we cannot use new stuff as castTo.

Original change's description:
> Reapply "Partial static mode changes for vm-service and tests (part 3)."
>
> Fix dynamic mode static warnings.
>
> Bug: https://github.com/dart-lang/sdk/issues/31587
> Change-Id: I966349f5409f911efacd11f08ffd469373bcd434
> Reviewed-on: https://dart-review.googlesource.com/33540
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: I775544cb5ab212cc836bc63181bdce31d19380b8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/31587
Reviewed-on: https://dart-review.googlesource.com/33800
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-10 12:21:53 +00:00
Ryan Macnak c9f6e8695d Reapply "Partial static mode changes for vm-service and tests (part 3)."
Fix dynamic mode static warnings.

Bug: https://github.com/dart-lang/sdk/issues/31587
Change-Id: I966349f5409f911efacd11f08ffd469373bcd434
Reviewed-on: https://dart-review.googlesource.com/33540
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-01-10 01:28:39 +00:00
Stephen Adams 8e3da7df7c js_runtime: Make CastErrorImplementation more like TypeErrorImplementation
I also added safe-printed irritant to the message, which in the case
of a primitive value or closure would tell you what value is causing
the problem.

Bug:
Change-Id: I530f5185f06d54ddc2ad4d45e11fa08b71213338
Reviewed-on: https://dart-review.googlesource.com/33260
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-01-09 20:49:09 +00:00
Ryan Macnak e8d9d945f3 Revert "Partial static mode changes for vm-service and tests (part 3)."
This reverts commit 6ccd7b8ac2.

Reason for revert: analyzer failures

Original change's description:
> Partial static mode changes for vm-service and tests (part 3).
> 
> Bug: https://github.com/dart-lang/sdk/issues/31587
> Change-Id: I812fd4cd8e74875ce7ada9886035137af2fef73a
> Reviewed-on: https://dart-review.googlesource.com/33100
> Reviewed-by: Siva Annamalai <asiva@google.com>

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

Change-Id: Ic368fc23f58e02cafbaf6ae81dbcbffc3dcced13
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/31587
Reviewed-on: https://dart-review.googlesource.com/33240
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-01-09 02:37:56 +00:00
Ryan Macnak 6ccd7b8ac2 Partial static mode changes for vm-service and tests (part 3).
Bug: https://github.com/dart-lang/sdk/issues/31587
Change-Id: I812fd4cd8e74875ce7ada9886035137af2fef73a
Reviewed-on: https://dart-review.googlesource.com/33100
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-01-09 01:40:10 +00:00
Lasse R.H. Nielsen 4dd367c652 Fix return type of Base64Codec.decode to say Uint8List.
Update some documentation.

Change-Id: I4e05d89e84bd35068ca57917e752af235c62b647
Reviewed-on: https://dart-review.googlesource.com/32762
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-01-08 13:27:02 +00:00
Stephen Adams 31cd4e1457 Factor deferred loading data
'Normalize' the data used for loading deferred libraries.  Replace
URIs and SHA1 hashes with indexes so that the URIs and hashes occur
once.

Bug: https://github.com/dart-lang/sdk/issues/29635
Change-Id: I3ac8791ad44ca588cbb1bd7d86f18243c956a04a
Reviewed-on: https://dart-review.googlesource.com/32505
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-05 22:02:49 +00:00
Stephen Adams 6ceb6ce00e Emit type representation for generic function types
Change-Id: I0a10f5316b3e3c633c34f2a9e184de01ed9cf7de
Reviewed-on: https://dart-review.googlesource.com/32004
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-04 02:45:15 +00:00
Lasse R.H. Nielsen d1382f983c Initial steps to add cast operation.
Start by adding static castTo method to the interfaces. This provides everybody with the
desired implementation without exposing the classes.
When implementing the cast method, the recommended way is to (extend the base class,
but if you choose not to ...) use the castTo method.

If we ever get a language feature, we can implement the castTo method using that,
without being stuck with an unnecessary class.

Change-Id: I53274e60c88a4de519bead85d2ca44c1065a9c1a
Reviewed-on: https://dart-review.googlesource.com/26620
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-01-03 12:16:24 +00:00
Terry Lucas 476b1e02a9 Updated PYTHON code to correctly generate web_sql and re-wrote/re-enabled async web_sql test.
Also, updated status files to correctly fix failures in FF, IE and removed other spurious status entries.

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

Change-Id: Ic965103d892ff4d5d119712e3187e829f57cd022
Reviewed-on: https://dart-review.googlesource.com/31800
Reviewed-by: Terry Lucas <terry@google.com>
2017-12-29 23:51:02 +00:00
Stephen Adams f937039bd6 Remove unused JS_BUILTIN
Became unused at:
1ae1ec7df4
Change-Id: I92c167dc2a071a45b2635b9b1d907015043d60ab
Reviewed-on: https://dart-review.googlesource.com/31560
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2017-12-28 01:16:02 +00:00
Terry Lucas 0af98266ab Revert "Updated PYTHON code to correctly generate web_sql and re-wrote/re-enabled async web_sql test."
This reverts commit 0c8294e4a0.

Bug:
Change-Id: Idb35c64fd5365f2669e8aff45765fed74e0f0766
Reviewed-on: https://dart-review.googlesource.com/31440
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
2017-12-23 01:59:38 +00:00
Terry Lucas 0c8294e4a0 Updated PYTHON code to correctly generate web_sql and re-wrote/re-enabled async web_sql test.
R=alanknight@google.com,vsm@google.com

Change-Id: I80e82f5aaa3c9748740031d8da139f79e2c0ab70
Reviewed-on: https://dart-review.googlesource.com/31080
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Alan Knight <alanknight@google.com>
2017-12-22 22:57:34 +00:00
Roland McGrath f3581accf2 [GN] In Fuchsia build, use symlink for host dart-sdk/bin/dart copy
This solves some arcane issues with Fuchsia's GN complexities,
explained further in the comments.  It obviates "copy_dylibs".

Change-Id: If1b26bfa73d5167550d2217258fa074b9dacade9
Reviewed-on: https://dart-review.googlesource.com/30924
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-12-21 19:34:41 +00:00
Sigmund Cherem 22298629e8 Add unstable API for bazel summary worker and move the actual worker out of package:front-end
Bug:
Change-Id: I0a64d3de46ef55e8185e723d6111fa315ad286ca
Reviewed-on: https://dart-review.googlesource.com/30621
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2017-12-21 19:09:11 +00:00
Ryan Macnak 9f4ffb64ef Partial static mode changes for vm-service and tests (part 2).
Bug: https://github.com/dart-lang/sdk/issues/31587
Change-Id: Ie2605f5043b9f5d2f9156928e3cd39f74e726853
Reviewed-on: https://dart-review.googlesource.com/30681
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-12-20 00:45:28 +00:00
Sigmund Cherem b280922064 Fix patch location for isolate library
Change-Id: Ie1f0913eb61dfd77e73d483fd48f235c58ded523
Reviewed-on: https://dart-review.googlesource.com/30626
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-12-20 00:15:43 +00:00
Ryan Macnak d528e1651f Reapply "Misc "strong" mode fixes for dart:io."
Remove changes to Socket.flush and Socket.done.

Split socket_test and socket_exceptions_test so we can minimize suppressions.

Bug: https://github.com/dart-lang/sdk/issues/31587
Bug: https://github.com/dart-lang/sdk/issues/31685
Bug: https://github.com/dart-lang/sdk/issues/27453
Change-Id: I3c44223480554f57d66be048c0361f6d0c699be2
Reviewed-on: https://dart-review.googlesource.com/30389
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-12-19 21:41:47 +00:00
Sigmund Cherem 414bad86df Directly create dart2js platform files using its patch files
Change-Id: I1c7d59968bfafeeb5a8b5252fa2d47e3c05b893e
Reviewed-on: https://dart-review.googlesource.com/27404
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-12-19 20:31:57 +00:00
Zachary Anderson 3cd62c4b74 [dart:core] Adds @Provisional annotation
@Experimental is already defined in dart:html. Adding the same
annotation to dart:core breaks the build. Removing the annotation from
dart:html and adding it to dart:core is a breaking change, e.g.
if someone has said "import 'dart:html' show Experimental".

This annotation is for use in the upcoming dart:standalone with
the waitFor(Future f) function:

https://dart-review.googlesource.com/c/sdk/+/29449
Change-Id: Iea2f537a2ae89a6097c4284084a2a168e833bb04
Reviewed-on: https://dart-review.googlesource.com/30261
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-12-19 19:00:22 +00:00
Ryan Macnak a51b45870c Revert "Misc "strong" mode fixes for dart:io."
This reverts commit c6f1ce24f3.

Reason for revert: standalone_2/io/socket_exception_test failing

Original change's description:
> Misc "strong" mode fixes for dart:io.
> 
> Bug: https://github.com/dart-lang/sdk/issues/31587
> Change-Id: I032be8e25aa8d6a851f0bf00ec12b1a3578308c6
> Reviewed-on: https://dart-review.googlesource.com/30080
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,zra@google.com,asiva@google.com

Change-Id: I9af0570577009b54e3a43f083008d65c4c3f9ba3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/31587
Reviewed-on: https://dart-review.googlesource.com/30420
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-12-19 00:04:10 +00:00
Zachary Anderson 971a15795e [dart:io] Allow setting overrides in the root Zone
Otherwise there is no way to install overrides that affect the whole
program.

related https://github.com/flutter/flutter/issues/13602

Change-Id: I905b7067e79f11051e8204ebb296915d495fd13f
Reviewed-on: https://dart-review.googlesource.com/30100
Reviewed-by: Florian Loitsch <floitsch@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-12-18 22:46:07 +00:00
Ryan Macnak c6f1ce24f3 Misc "strong" mode fixes for dart:io.
Bug: https://github.com/dart-lang/sdk/issues/31587
Change-Id: I032be8e25aa8d6a851f0bf00ec12b1a3578308c6
Reviewed-on: https://dart-review.googlesource.com/30080
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-12-18 22:15:06 +00:00
Vyacheslav Egorov b2eab8b96e [VM/Service] Restore zero-copying handling of JSON messages in vmservice.
In 5a44162c97 in attempt to adhere to declared
method signatures we lost zero-copying JSON decoding of responses from
VM: `Message.sendToVM` was changed to always decode the response into
string before passing it to the caller and the logic to use fused
JSON decoding was removed. This increased peak memory consumption by
the VM Service.

This commit addresses the issue by restoring the zero-copying JSON decoding
logic while adding a wrapper around responses that make it clear what kind
of data is passed around and how that data is encoded and handled.

We introduce a class `Response` which can contain either a Dart string, a
binary data (represented as a Uint8List) or utf8 encoded string (represented
as a Uint8List). This class is used in all places where previously a String
or dynamic were used, e.g. MessageRouter.routeRequest is changed to return
Future<Response> rather than Future<String>. This allows callees to
decode JSON responses without copying them into Dart heap while
maintaining sufficient level of typing to make the code easy to reason about.

This commit also removes some dead code from the VM service related to old
Service API and TAR assets unpacking (which has been long done in C++).

Bug: https://github.com/flutter/flutter/issues/13626
Change-Id: Ifbba56944a552034a0f802a965a313326a1236e7
Reviewed-on: https://dart-review.googlesource.com/30280
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-12-18 19:06:06 +00:00
Sam Rawlins eaa6790ef2 Clean up HttpClient docs
In particular, fix typos, and update many comments to begin with a one-sentence
summary, for better readability at api.dartlang.org.

Fixes #31608, #29460, #31538, #31449, #31505

Bug: https://github.com/dart-lang/sdk/issues/31608
Bug: https://github.com/dart-lang/sdk/issues/29460
Bug: https://github.com/dart-lang/sdk/issues/31538
Bug: https://github.com/dart-lang/sdk/issues/31449
Bug: https://github.com/dart-lang/sdk/issues/31505
Change-Id: If00726ef3636479f0613c91e48ff9f0e24b12502
Reviewed-on: https://dart-review.googlesource.com/30120
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-12-18 18:50:46 +00:00
Paul Berry 2822fbadea Fix the interface definition for Socket.close and Socket.done.
These members were defined as returning Future<Socket>, but the
implementation in _Socket didn't conform to the interface.  There's no
reason these members need to return Future<Socket> anyway, so just
change them to return Future<dynamic>.

Avoids a strong mode error in socket_patch.dart.

Change-Id: Icdda5c7880daf0241e36f1d35e61d171f1694409
Reviewed-on: https://dart-review.googlesource.com/29741
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-12-15 16:16:14 +00:00
Ryan Macnak 5554382135 Get a better stack trace from conversion errors in File.readAsString.
Bug: https://github.com/dart-lang/sdk/issues/31619
Change-Id: I79ae0337e35c8dd44aeff0613edaad620e82848e
Reviewed-on: https://dart-review.googlesource.com/29447
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-12-15 01:36:02 +00:00
Vijay Menon e0f5891850 Merge ddc type fixes to html_common
Change-Id: If8583c824989c9729ae2c29c718a514f24be0d2d
Reviewed-on: https://dart-review.googlesource.com/26840
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2017-12-14 22:04:05 +00:00
Terry Lucas bfea069823 Test possible keyevent fix.
Change-Id: I3f90979fad2681775cae56d499f3ff5968ea6485
Reviewed-on: https://dart-review.googlesource.com/29545
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
2017-12-14 21:22:39 +00:00
Terry Lucas 642b768e87 Fixed default parameter messagePorts for MessageEvent factory.
R=vsm@google.com

Change-Id: Ic94ccbe4c29302e44c58791658ce75dff86d9ac2
Reviewed-on: https://dart-review.googlesource.com/29544
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-12-14 18:21:25 +00:00
Florian Loitsch 1a61b425d1 Reland BigInt class.
Moved `parseRadix` into a separate test where it doesn't do 10 iterations.
This reverts commit ab4061471b.

Change-Id: Ie48216c2f4f077dc86f915a54021c39706c432e8
Reviewed-on: https://dart-review.googlesource.com/29593
Reviewed-by: Florian Loitsch <floitsch@google.com>
Commit-Queue: Florian Loitsch <floitsch@google.com>
2017-12-14 15:44:15 +00:00
Florian Loitsch f3e845cf48 Revert "Reland: [dart:io] Adds waitForEventSync"
This reverts commit 3ea5e13ad7.

Change-Id: Ic9fae69f3b7ef6e41aac3c7ebca3e1d288dbffb1
Reviewed-on: https://dart-review.googlesource.com/29589
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-12-14 14:10:45 +00:00
pq ab4061471b Revert "Add BigInt class." [TBR].
This reverts commit f189bb57a4.

Bug:
Change-Id: I7b1cc4ab69adb5142ff7b5abd563d3bf7371ebb9
Reviewed-on: https://dart-review.googlesource.com/29442
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2017-12-13 21:12:02 +00:00
Florian Loitsch f189bb57a4 Add BigInt class.
Change-Id: I6e7fed3913cdb8e69ea15f0c69e060cccd91a356
Reviewed-on: https://dart-review.googlesource.com/9820
Commit-Queue: Florian Loitsch <floitsch@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2017-12-13 18:23:51 +00:00
Terry Lucas 529add3834 DDC fix to expose classes which are only created inside of the browser.
R=vsm@google.com

Change-Id: I27ede73ac84a72ee9b5e8b3b0a706ade82b2aa59
Reviewed-on: https://dart-review.googlesource.com/25500
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-12-13 03:03:09 +00:00
Zachary Anderson 3ea5e13ad7 Reland: [dart:io] Adds waitForEventSync
The only fix needed for relanding is adding _ensureScheduleImmediate
to the list of vm entrypoints in //runtime/vm/compiler/aot/precompiler.cc

Original commit message:

Adds a top-level call waitForEventSync to dart:io that blocks the
thread an Isolate is running on until messages are available.
Before the thread blocks, the microtask queue is drained.
Before waitForEventSync returns, all messages are handled.

Lifting this up from a comment:

This is apropos of the request that nweiz@ sent to the mailing list a
couple weeks back. I'm not sure we should land this. We certainly
shouldn't land it without some annotations that will make the analyzer
complain a lot in most configurations, but I don't know what those
annotations are.

fixes #31102

Change-Id: Id96de46cc5f10e1847045cfafb7cfed6a38bce16
Reviewed-on: https://dart-review.googlesource.com/28920
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-12-12 23:16:50 +00:00
Natalie Weizenbaum acdd2adbdf Make sure that _StreamSinkImpl._isBound is kept up-to-date
There were two situations where this could get into a bad state:

* If the sink already had an error, _isBound would be set to true and
  never unset. This is fixed by not setting it at all if an error
  already exists.

* If _controllerCompleter completed to an error, _isBound would never
  get set back to false. This is fixed by refactoring the code so that
  the appropriate whenComplete() is always run.

Change-Id: Ia511fa3e2345213ff8e56dc4fae6f397b84257d1
Reviewed-on: https://dart-review.googlesource.com/26981
Commit-Queue: Natalie Weizenbaum <nweiz@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-12-12 22:41:29 +00:00
Zach Anderson 9d8e6453d2 Revert "[dart:io] Adds waitForEventSync"
This reverts commit 2aed87a133.

Reverting for failures on precompiled bots.

Change-Id: I758bfc72d8f5e67b0e5e12a7367a47f1df9364e2
Reviewed-on: https://dart-review.googlesource.com/28900
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-12-12 21:05:01 +00:00
Zachary Anderson 2aed87a133 [dart:io] Adds waitForEventSync
Adds a top-level call waitForEventSync to dart:io that blocks the
thread an Isolate is running on until messages are available.
Before the thread blocks, the microtask queue is drained.
Before waitForEventSync returns, all messages are handled.

Lifting this up from a comment:

This is apropos of the request that nweiz@ sent to the mailing list a
couple weeks back. I'm not sure we should land this. We certainly
shouldn't land it without some annotations that will make the analyzer
complain a lot in most configurations, but I don't know what those
annotations are.

Change-Id: If8286f4525994a162dd4f4563fefccb9d0984f7c
Reviewed-on: https://dart-review.googlesource.com/25281
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-12-12 19:12:58 +00:00
Bob Nystrom 650c9dcc8e Support extractTypeArguments() in 1.0 mode on the VM and dart2js.
Without strong mode, a "good enough" implementation is to simply call
the generic method with "dynamic" for the type arguments, which is what
this does. That should be enough to unblock our internal users.

We also need to not report a compile error when
dart_internal/extract_type_arguments.dart imports the hidden
"dart:_internal" library.

This patch does both of those for the VM and dart2js (using its old
front end).

Note that the test still fails because the test is more particular than
most actual user code would be -- it validates that the instantiated
type arguments are *exactly* correct, and not that the returned object
is merely subtype compatible.

Bug:
Change-Id: I0343beace4991861b29712b3fd7067ec8dc8f8ba
Reviewed-on: https://dart-review.googlesource.com/28020
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-12 19:04:18 +00:00
Vyacheslav Egorov 5a44162c97 [vm] Fix incorrect override in vmservice source
VMService.routeRequest of type Future Function(Message) overrides
MessageRouter.routeRequest of type Future<String> Function(Message).

It not enough to just fix VMService.routeRequest's return type because
Message.sendToVM() violates its type signature: it declares to
return Future<String> but in reality it returns Future<dynamic>
which can complete with either String or List. This CL addresses
this issue as well.

Bug:
Change-Id: I8240113d3e13d67c4e9a59db4250132a2077a4ec
Reviewed-on: https://dart-review.googlesource.com/26701
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2017-12-12 18:54:58 +00:00
Karl Klose 7b2678bd17 Fix paths in sdk/bin/dartdevk.bat
R=jensj@google.com

Change-Id: I3690674bf334f257b78916b88813d220330c72af
Reviewed-on: https://dart-review.googlesource.com/27761
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2017-12-12 06:51:27 +00:00
Paul Berry ba2417fdc0 Fix SDK errors due to inconsistent inheritance of Operator==.
The informal spec for strong mode top level inference
(https://github.com/dart-lang/sdk/pull/28218) says "If there are
multiple overridden/implemented methods, and any two of them have
non-equal types (declared or inferred) for a parameter position which
is being inferred for the overriding method, it is an error."

This CL fixes several SDK errors that arise from this rule.  For
example, the classes _Closure, Function, and Object contained members
declared as follows:

    class _Closure implements Function {
      bool operator ==(other) ...
    }
    class Function {
      bool operator ==(Object other) ...
    }
    class Object {
      bool operator ==(other) ...
    }

The type of Object's operator == was (dynamic) -> bool; the type of
Function's operator == was (Object) -> bool; therefore the type of
_Closure's operator == (which overrides both, since _Closure extends
Object and implements Function) cannot be inferred and must be
specified.

A similar situation exists for _Double and _IntegerImplementation
(both implement num, which declares operator == to have type (Object)
-> bool), and _Uri (which implements Uri, which declares operator ==
to have type (Object) -> bool).

This CL fixes the error by specifying the type explicitly in the
classes _Closure, _Double, _IntegerImplementation, and _Uri.

Change-Id: I91f7ceef8549399d438ba4be8c408493b3f338db
Reviewed-on: https://dart-review.googlesource.com/28100
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-11 13:02:19 +00:00
Zachary Anderson 9344c79eff [dart:io] Allow the embedder to override Platform.localeName
We don't have a good place to pull this from on Android, but the
Flutter engine gets notifications when it is updated, etc., so don't
cache the value, and let the embedder supply a closure.

fixes #29211

Change-Id: I18e322fffb5212d9dbe154bc8628f817ba070237
Reviewed-on: https://dart-review.googlesource.com/27924
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-12-08 22:58:30 +00:00
Bob Nystrom 03c8767f73 Here's a start at exposing an API to address https://github.com/dart-lang/sdk/issues/31371.
There is no actual implementation here yet (that's your job :) ), but there is:

- An external method in dart:_internal, extractTypeArguments().
- Empty patch methods for that for the VM, dart2js, and DDC. These need to have implementations
  filled in.
- A "dart_internal" package to expose a subset of the API. It gives you:

    extractListTypeArgument()
    extractMapTypeArguments()

  We'll bring this into Google, but not publish it externally unless we find we really need to.
- A test for the behavior. It probably has bugs since I can't run it.

See: https://github.com/dart-lang/sdk/issues/31371
Change-Id: I7d9f9a3a36f8e8be106440375c80d584898c83cb
Reviewed-on: https://dart-review.googlesource.com/26467
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-12-08 21:57:00 +00:00
Jens Johansen 83057c42b1 Run dartdevk tests on Windows too
Attempt #4 at making Windows bot happy

Bug:
Change-Id: I6101851787ba956fc14f28130ac6b73bfa38b2a3
Reviewed-on: https://dart-review.googlesource.com/27723
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-08 13:34:09 +00:00
Jens Johansen 6e3d94ab1a Revert "Run dartdevk tests on Windows too"
This reverts commit 125d704a6e.

Reason for revert: Seemingly still looks for .packages in wrong place.

Original change's description:
> Run dartdevk tests on Windows too
> 
> Attempt #3 at making Windows bot happy
> 
> Bug:
> Change-Id: Iae01ddc20167eed00387bc7075fd3272665ed76a
> Reviewed-on: https://dart-review.googlesource.com/27680
> Reviewed-by: Jens Johansen <jensj@google.com>

TBR=jensj@google.com,kmillikin@google.com

Change-Id: If8f13daf50343f0347fd7b9c218227154a766306
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/27700
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-12-08 13:02:52 +00:00
Jens Johansen 125d704a6e Run dartdevk tests on Windows too
Attempt #3 at making Windows bot happy

Bug:
Change-Id: Iae01ddc20167eed00387bc7075fd3272665ed76a
Reviewed-on: https://dart-review.googlesource.com/27680
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-08 12:40:28 +00:00
Vijay Menon c2d67fc39e Fix type error in html_common
My merge CL is breaking in dart2js.  Landing this minimal fix while I look at that.

Bug:
Change-Id: Ie0b17c9643e3ea7e788ff02ca3beef58fe3c3903
Reviewed-on: https://dart-review.googlesource.com/27060
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-12-07 03:45:30 +00:00
Vijay Menon b8cd835bb9 Workaround CFE instantiate-to-bounds bug
This avoids #31566 for now.

Change-Id: I5f2ea0cf0ad15a534c1c62182bdca36fc3b0b103
Reviewed-on: https://dart-review.googlesource.com/26760
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-12-06 21:34:11 +00:00
Leaf Petersen 8f199377fa Remove generic method comment syntax from dart:html.
This removes the last uses of the generic method comment syntax from
the SDK.  There are no additional explicit casts or reified generics
(other than those implied by reifying generic methods) in this CL.

Bug:
Change-Id: Icae23cac60869243cb3ba441f86d70422f68178f
Reviewed-on: https://dart-review.googlesource.com/26081
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2017-12-06 21:26:04 +00:00
Leaf Petersen faa4ff9408 Type on printToZone, and startRootIsolate fix.
Put a precise type on the printToZone variable, and change entry
calls in startRootIsolate to avoid casting arguments to Null.


Bug:
Change-Id: Ia7d23e8dafa93bd6246ec7fa9b8c14411db30421
Reviewed-on: https://dart-review.googlesource.com/18683
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2017-12-04 22:57:04 +00:00
Karl Klose 2a1d5ce963 Fix dartedvk script paths for Windows
Change-Id: I0fa243203ea36ecd7ad31c55f71a6a34df54ef98
Reviewed-on: https://dart-review.googlesource.com/25242
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2017-12-04 13:32:14 +00:00
Lasse Reichstein Holst Nielsen 757d806b36 Add type parameter to Isolate.spawn.
This is a strong mode migration that was missed in the earlier rounds.
It allows use of functions that have a more restricted argument type than Object in strong mode
while still ensuring that the argument has a correct type.

Change-Id: Ib00e3f4b4a679c003a992d674c36ef672729b22e
Reviewed-on: https://dart-review.googlesource.com/24540
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2017-12-04 07:11:44 +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
Leaf Petersen be65ed0704 Remove comment syntax in _internal/.../linked_hash_map.dart.
Change type arguments for LinkedHashMapCell from reified in strong
mode only (using the comment syntax) to always reified.

Bug:
Change-Id: I567178a413194c72f01d4166e537ecb608c6a708
Reviewed-on: https://dart-review.googlesource.com/21789
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-11-30 20:02:04 +00:00
Jacob MacDonald 15148dde93 compile and ship the front_end blaze worker entrypoint as a snapshot
Bug:
Change-Id: Id8611e484df73a1ffb36baca5c529327bbb336cb
Reviewed-on: https://dart-review.googlesource.com/24560
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2017-11-29 23:40:35 +00:00
Karl Klose 2d48be6e62 Invoke dartdevk.dart through shell script that locates the 'dart' executable
Change-Id: Id13cc838b67785b12f95d19b480a6a830ad5c003
Reviewed-on: https://dart-review.googlesource.com/24120
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2017-11-29 11:27:50 +00:00
Mark Fielbig d648426a5b Fix typo in isolate docs. (#31474)
Looks good. Thanks!
2017-11-29 07:57:15 +01:00
Lasse R.H. Nielsen 847cf039f0 Lower-case Isolate.{IMMEDIATE,BEFORE_NEXT_EVENT}.
Change-Id: I9a7071a7f6dc61b502f5aa9bc9bc2455247a7513
Reviewed-on: https://dart-review.googlesource.com/22984
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-11-24 12:44:17 +00:00
Leaf Petersen cac2299976 Remove comment syntax from lib/convert.
Remove comment syntax on methods signatures in convert.  This doesn't
change the reified types, but may cause new errors and warnings in
non-strong mode code.

Bug:
Change-Id: Ib811a4918d30eb5ba04300df928ac6c3868b2c2b
Reviewed-on: https://dart-review.googlesource.com/21783
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2017-11-22 22:57:05 +00:00
Zachary Anderson 616215df1b [dart:io] Adds Stdin.hasTerminal to mirror Stdout.hasTerminal
fixes #29083

Change-Id: I5f4d7ac2a5df9600fd3ad12abc2dd6068d9980af
Reviewed-on: https://dart-review.googlesource.com/23145
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-11-22 22:41:37 +00:00
Leaf Petersen 2b5349e259 Remove most comment syntax casts from sdk.
Eliminates all of the uses of the "/*=" syntax in the sdk libraries
that can be trivially converted to implicit downcasts.

Bug:
Change-Id: I213a5d683f50d0cec0b32482f44330db3b5d618d
Reviewed-on: https://dart-review.googlesource.com/21781
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2017-11-21 21:08:26 +00:00
Zachary Anderson bb33ba10d6 [GN] Fix SDK build deps
Change-Id: Id05e458963d3ba402558135c6af448b505669f11
Reviewed-on: https://dart-review.googlesource.com/22600
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-11-21 18:34:30 +00:00
Stephen Adams 5aebf58b66 Add type parameter to JS pseudofunction.
Bug: 31408
Change-Id: I90ce573c2022c2614269dcb73d2856fcc7573e24
Reviewed-on: https://dart-review.googlesource.com/21841
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-21 02:43:17 +00:00
Bob Nystrom 68dc77f456 Build DDC's SDK as part of the regular build.
This involves a few main pieces:

- Add code to the GN scripts to generate DDC's patched SDK and then
  compile it to summaries and JS in the build output directory.

- Add support to the underlying DDC build scripts to support controlling
  which files are built where.

- Update test.dart to use the DDC SDK from the build directory.

- Update create_sdk to use the built SDK instead of the checked in one.

- Fix various internal DDC tools to build their own copy of the SDK
  (since they can't easily find the one in the build directory because
  it's path if config-specific) and use those.

- Delete the checked DDC SDK JS and summaries.

I think I got everything working. The built Dart SDK looks fine -- it's
identical to one built using the old build scripts.

The various tools and DDC's little test runner I *think* work, but there
may be a bug or two in there. I tried the various things I could and it
seems like they work but it's hard to tell since they may be kind of
broken right now anyway.

Bug:
Change-Id: Iea77915a5c1cc8450f60ebfbdf8c725c7ea2f32c
Reviewed-on: https://dart-review.googlesource.com/18144
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-11-20 23:24:07 +00:00
Paul Berry 1bdf361ed4 Strong mode fix for future_impl.dart.
Change-Id: Icbc36fecd79aedf87340e9d20d1901759492400a
Reviewed-on: https://dart-review.googlesource.com/21464
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-11-20 21:27:47 +00:00
Régis Crelier f91f67a5be [VM] Emit type checks for incoming function arguments in strong mode.
Change-Id: Icd64913f0fc6ba54a0b8517bf05ae4babfae3bdc
Reviewed-on: https://dart-review.googlesource.com/19287
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-11-18 00:31:35 +00:00
Leaf Petersen 63918ea921 Remove comment syntax from lib/async.
Eliminate uses of the comment syntax in lib/async.  This is mostly
done simply by turning explicit (but commented) casts into implicit
casts to avoid regressing dart2js performance.

Bug:
Change-Id: I286c7bffbf609b5e2fa24b9d48b90876c2c45a9b
Reviewed-on: https://dart-review.googlesource.com/21566
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-11-17 20:40:47 +00:00
Leaf Petersen 85ca7df7e2 Avoid fuzzy arrows when parsing json.
Change the types on the json decoding reviver to avoid fuzzy arrow
checks.

Bug:
Change-Id: I3ca52d7676b6305c398f128d370bc9859fd65820
Reviewed-on: https://dart-review.googlesource.com/21564
Reviewed-by: Vijay Menon <vsm@google.com>
2017-11-17 20:37: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
Paul Berry 1034ad336d Strong mode fix for line_splitter.dart.
The new front end doesn't support generic comment syntax yet, so it's
getting the wrong type for LineSplitter in strong mode.  Since we no
longer to preserve legacy mode semantics for LineSplitter, we can just
use the correct strong mode types without generic comment syntax.

Change-Id: If2dcb2fb3fae9eb49685838e4e84958e545650c7
Reviewed-on: https://dart-review.googlesource.com/21286
Reviewed-by: Florian Loitsch <floitsch@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-16 19:52:51 +00:00
Stephen Adams 3836c70a81 Redo "js_runtime: Use browser's TextDecoder for UTF8 decoding"
Bug:
Change-Id: I40903bcdc1502e15cbf84298b43ba04ae8a8ecaf
Reviewed-on: https://dart-review.googlesource.com/21383
Reviewed-by: Stephen Adams <sra@google.com>
2017-11-16 04:59:26 +00:00
Stephen Adams 5e06165d6b Revert "js_runtime: Use browser's TextDecoder for UTF8 decoding"
This reverts commit 5f15867a47.

The recent renaming of constants had caused a lot of pain with this CL.

TBR=lrn@google.com

Bug:
Change-Id: I67a78fa09e15e95ea44fe18d9847fcfd9c61e043
Reviewed-on: https://dart-review.googlesource.com/21382
Reviewed-by: Stephen Adams <sra@google.com>
2017-11-16 04:52:40 +00:00
Stephen Adams 5f15867a47 js_runtime: Use browser's TextDecoder for UTF8 decoding
Change-Id: I85a8e774595784883281b1cc40ee75ae8de7d1d9
Reviewed-on: https://dart-review.googlesource.com/3303
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-11-16 04:22:22 +00:00
Ryan Macnak b8f6eb7899 [vm] Make effectively const fields const.
Change-Id: I3dd3a81a4887bdbe480ea0fdc70547885024a99d
Reviewed-on: https://dart-review.googlesource.com/20906
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-11-15 01:51:24 +00:00
Zachary Anderson 0af5298845 [dart:io] Adds optional withTrustedRoots parameter to SecurityContext()
The parameter defaults to false. This enables creating a
SecurityContext that includes the trusted root certificates that can
be modified per-connection.

fixes #24693

Change-Id: I22e5736838755ce4055f77b1b17aeb5176329240
Reviewed-on: https://dart-review.googlesource.com/20580
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-11-14 18:09:34 +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