Commit graph

7783 commits

Author SHA1 Message Date
Johnni Winther d4c9dc92e1 Fix rti encoding of generic methods
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2565413002 .
2016-12-13 10:27:59 +01:00
Florian Loitsch 6a966d2914 Add FutureOr<T> class to dart:async.
`FutureOr<T>` is a magical class, but having a concrete implementation
makes it easier for many tools (like dartdoc, code navigation, ...) to
deal with it.

Fixes #28029
BUG= http://dartbug.com/28029
R=lrn@google.com

Review URL: https://codereview.chromium.org/2562703002 .
2016-12-12 14:05:48 +01:00
Matthias Hausner 156fdef01d Revert "Add optional message argument to assert statements in the VM."
This reverts commit 67e83dd79d.

BUG=

Review-Url: https://codereview.chromium.org/2558993005 .
2016-12-09 09:50:27 -08:00
Matthias Hausner 67e83dd79d Add optional message argument to assert statements in the VM.
Add flag --assert-message to control the feature.

Fixes issue #24215
BUG= http://dartbug.com/24215

This replaces Lasse’s CL  1307363005

patch from issue 1307363005 at patchset 140001 (http://crrev.com/1307363005#ps140001)

R=lrn@google.com

Review-Url: https://codereview.chromium.org/2564623003 .
2016-12-09 09:25:58 -08:00
Lasse R.H. Nielsen b82e581d33 Improve documentation of Isolate.current.
And fix typo in num.==.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2560703003 .
2016-12-09 13:02:56 +01:00
Lasse R.H. Nielsen 283bba0944 Revert "Let Isolate.errors close on isolate exit."
This reverts commit aeb544351e.

Wasn't ready for landing yet, and triggers bug in VM.

Review URL: https://codereview.chromium.org/2563723003 .
2016-12-09 13:02:20 +01:00
Lasse R.H. Nielsen aeb544351e Let Isolate.errors close on isolate exit.
It's not perfect because it won't catch an isolate exit that happens while nobody is listening.

Add test.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2555493003 .
2016-12-09 13:00:43 +01:00
Lasse R.H. Nielsen b70311fe90 Update documentation around Isolate capabilities.
BUG= http://dartbug.com/28003
R=floitsch@google.com

Review URL: https://codereview.chromium.org/2549363003 .
2016-12-07 09:35:15 +01:00
Michael Thomsen 2bb90fe989 Fix typo (#28004)
Fixes https://github.com/dart-lang/sdk/issues/28000
2016-12-06 14:54:23 +01:00
Lasse Reichstein Holst Nielsen 9412b54f1f Fix DoubleLinkedListQueue misbehavior on concurrent modification.
Documented forEachEntry, firstEntry and lastEntry.
Made forEachEntry more useful by making it compatible with removing and adding
around the current entry, and documented how it interacts.

BUG= http://dartbug.com/27920
R=floitsch@google.com

Review URL: https://codereview.chromium.org/2540993002 .
2016-12-06 09:27:04 +01:00
Stephen Adams 3e7aaeebe4 Handle synthetic nodes use to throw exceptions
- Implement:
- - _genericNoSuchMethod
- - _unresolvedConstructorError
- - _malformedTypeError

- Temporarily change NoSuchMethod.toString to avoid a closure.
- Temporarily provide argument to StringBuffer to work around bug.

BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2545153002 .
2016-12-02 16:11:26 -08:00
Seth Ladd 2e9064ae13 Update docs for Map values, keys (#27972)
Closes https://github.com/dart-lang/sdk/issues/27968
2016-12-02 10:01:23 -08:00
Florian Loitsch db8782f6e6 Update num.compareTo documentation.
Fixes #27924
BUG= http://dartbug.com/27924
R=lrn@google.com

Review URL: https://codereview.chromium.org/2537813002 .
2016-12-01 17:26:59 -08:00
Ryan Macnak e5a16b1ca5 Remove exitCode setter from dart:io's Process.
Fixes #27950

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2542323002 .
2016-12-01 14:35:12 -08:00
John McCutchan 6bf86eacd7 Add getIsolateID to Service class in dart:developer
Fixes https://github.com/dart-lang/sdk/issues/23924

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2542003002 .
2016-12-01 12:48:49 -08:00
Florian Loitsch 222d80ad9d Update documentation for num.clamp.
(partially) fixes #27923
BUG= http://dartbug.com/27923
R=lrn@google.com

Review URL: https://codereview.chromium.org/2541513002 .
2016-12-01 11:01:44 -08:00
Lasse R.H. Nielsen c6412af7bb Don't use [operator==] to refer to [==] in DartDoc. It doesn't work.
R=eernst@google.com

Review URL: https://codereview.chromium.org/2548433002 .
2016-12-01 11:00:33 +01:00
Lasse Reichstein Holst Nielsen 7957a1c256 Make EfficientLength extend Iterable.
This should help least-upper-bound computations to not think of EfficientLength
as completely separate from Iterable even though they are always used together.

It doesn't solve all problems with the least-upper-bound computation,
but at least some of the more often occuring ones.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2467113003 .

Committed: b08fb1373f
2016-11-28 08:04:04 +01:00
Matan Lurey d92107e01d Remove scary warning from dart:convert#Codec (#27897)
Seems unnecessarily scary given that a breaking change here would now be a huge breaking change.
2016-11-25 15:42:01 -08:00
Mohamed Hayibor 5595b9698d Fix typos 'overriden' to 'overridden' and '@mustCall super' to '@mustCallSuper' (#27853)
* fix overriden typos to overridden
* Fix @mustCall super to @mustCallSuper
2016-11-18 09:36:25 -08:00
Vyacheslav Egorov 57af30e2d5 VM: [Kernel] Make NativeFieldWrapperClass[1-4] constructible when running from Kernel.
For unclear reason sdk/lib/html/dartium/nativewrappers.dart had these classes
with constructors that would throw. In reality on Kernel ever uses this file so
nobody would use these constructors before anyway.

When running Kernel binaries we need to be able to construct subclasses of
these classes - so they need to have non-throwing constructors.

R=kustermann@google.com
BUG=http://dartbug.com/27590

Review URL: https://codereview.chromium.org/2511083003 .
2016-11-17 18:59:08 +01:00
Sigmund Cherem d89dab56b5 Fix IE11 issue: this complements the CL I sent last week. It turns out that
there are two places where we do this check. This is why the test that I added
appears to be failing in the bots.

BUG=
R=jakemac@google.com

Review URL: https://codereview.chromium.org/2504883002 .
2016-11-16 08:38:24 -08:00
Vyacheslav Egorov 6f1efe295c VM: Remove _nativeScript external. JS has no equivalent.
It was added to @patch member in the VM patches.

The right fix is to remove @patch annotation from the _nativeScript.

TBR=kustermann@google.com
BUG=

Review URL: https://codereview.chromium.org/2506033002 .
2016-11-16 16:36:10 +01:00
Vyacheslav Egorov 23fd1a184b VM: Support bootstrapping core libraries from Kernel binaries instead of source.
BUG=http://dartbug.com/27590
R=asiva@google.com

Review URL: https://codereview.chromium.org/2485993002 .
2016-11-16 13:56:20 +01:00
Sigmund Cherem f460a8706d Add implementation of Isolate.resolvePackageUri for dart2js.
This uses 'packages/' as the default base to resolve uris from, but also exposes
a hook to allow users to overwrite it.

BUG= https://github.com/dart-lang/sdk/issues/25594
R=het@google.com, lrn@google.com

Review URL: https://codereview.chromium.org/2495383003 .
2016-11-14 15:11:49 -08:00
Sigmund Cherem 008da86c03 Support extending TemplateElement in IE11 + webcomponents-lite.js
Addresses issue reported in the polymer repo: https://github.com/dart-lang/polymer-dart/issues/682

R=jakemac@google.com, sra@google.com

Review URL: https://codereview.chromium.org/2493703004 .
2016-11-14 07:32:09 -08:00
Siva Annamalai a7107fdd95 Fix some comments.
BUG=

Review URL: https://codereview.chromium.org/2499763002 .
2016-11-11 15:38:55 -08:00
Lasse R.H. Nielsen c3bb3ddb41 Make Stopwatch logic simpler.
The `Stopwatch` class had more states than necessary because it started with
the `_start` and `_stop` fields being `null`, a state that couldn't happen later,
and it had to handle those cases specially.
Now just starts in a state equivalent to a stopped, reset timer.
Also use ?? and ??= because they are there,and don't call the overridable `isRunning` from other methods.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2485063003 .
2016-11-11 10:01:25 +01:00
Stephen Adams 8ccd41c2ae Avoid using constructor.name on ff & safari
TBR=jacobr@google.com

Review URL: https://codereview.chromium.org/2492163002 .
2016-11-10 21:26:23 -08:00
Stephen Adams f734606d0e Add native_testing library to mock @Native classes
Convert 114 tests to use native_testing.dart library.

Includes reviewed code from
https://codereview.chromium.org/2332953002/

Committed: ddfc70f164

Review URL: https://codereview.chromium.org/2379173002 .

Reverted:  74deaad759
2016-11-10 14:16:08 -08:00
John McCutchan 14297ee480 Add an environment variable toggle to control new service protocol auth token
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2486443002 .
2016-11-07 14:45:52 -08:00
Lasse Reichstein Holst Nielsen 88ef4e98fa Make Stream.take(0) still listen and close the stream.
It shouldn't matter, but for some streams (e.g., a `ReceivePort`)
it does make a big difference whether it's closed or not.
We can't make a port not keep the isolate alive unless it has been listened to.
If we could, this wouldn't be necessary.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2481083003 .
2016-11-07 17:01:19 +01:00
Lasse R.H. Nielsen 9ebef9af7c Handle the case of Stream.take(0) better.
The current implementation listens to the stream and waits for it to complete.
The change makes it listen and then immediately cancel, and then return a
subscription that only sends done.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2444363004 .

Committed: 8cead4090c
2016-11-04 15:55:05 +01:00
William Hesse 3bd04426a8 Revert "Handle the case of Stream.take(0) better." This reverts commit 8cead4090c.
The test co19/LibTest/async/Stream/take_A01_t02 was failing after this
commit, on macos and windows, and perhaps everywhere.

BUG=
TBR=lrn@google.com

Review URL: https://codereview.chromium.org/2475303002 .
2016-11-04 15:47:46 +01:00
Lasse R.H. Nielsen 8cead4090c Handle the case of Stream.take(0) better.
The current implementation listens to the stream and waits for it to complete.
The change makes it listen and then immediately cancel, and then return a
subscription that only sends done.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2444363004 .
2016-11-04 14:54:58 +01:00
Florian Loitsch fb968553ae Add generic argument to Codec.fuse.
Fixes #27722
BUG= http://dartbug.com/27722
R=lrn@google.com

Review URL: https://codereview.chromium.org/2472023004 .
2016-11-04 10:19:03 +01:00
Anders Thorhauge Sandholm 4682ea9953 Update http.dart
Fixing #27711
2016-11-03 07:52:49 -07:00
Ryan Macnak 6cf5c3baa3 Revert "Make EfficientLength extend Iterable."
This reverts commit b08fb1373f.

TBR=lrn@google.com

Review URL: https://codereview.chromium.org/2467283003 .
2016-11-02 13:20:41 -07:00
Lasse R.H. Nielsen b08fb1373f Make EfficientLength extend Iterable.
This should help least-upper-bound computations to not think of EfficientLength
as completely separate from Iterable even though they are always used together.

It doesn't solve all problems with the least-upper-bound computation,
but at least some of the more often occuring ones.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2467113003 .
2016-11-02 14:05:35 +01:00
Johnni Winther 8be67929a2 Fix import in sdk/lib/developer
This broke dart2js/analyze_api_test

Review URL: https://codereview.chromium.org/2464083002 .
2016-11-01 12:31:12 +01:00
John McCutchan a0d9975af4 Fix analyzer bots
BUG=

Review URL: https://codereview.chromium.org/2467613002 .
2016-10-31 13:24:39 -07:00
John McCutchan 63e4f69e5e Provide an API to dart:developer to control the web server hosting the Service Protocol
- [x] Add `ServiceProtocolnfo` class to dart:developer.
- [x] Add `Service` class to dart:developer.
- [x] Add `Service.getInfo` static method to dart:developer.
- [x] Add `Service.controlWebServer` static method to dart:developer.

API:

```dart

/// Information about the service protocol.
class ServiceProtocolInfo {
  /// The major version of the protocol.
  final int majorVersion;
  /// The minor version of the protocol.
  final int minorVersion;
  /// The Uri to access the service. If the web server is not running, this
  /// will be null.
  final Uri serverUri;
}

/// Access information about the service protocol and control the web server.
class Service {
  /// Get information about the service protocol.
  static Future<ServiceProtocolInfo> getInfo();

  /// Control the web server that the service protocol is accessed through.
  static Future<ServiceProtocolInfo> controlWebServer({bool enable: false});
}
```

... and add a randomly generated authentication token path prefix that must be passed in to access the service protocol.

Old base url:

Observatory listening on http://127.0.0.1:54804/

New base url:

Observatory listening on http://127.0.0.1:54804/<token>/

For example:

Observatory listening on http://127.0.0.1:54804/PTwjm8Ii8qg=/

Many tools will need to be updated.

Fixes #23320

BUG=
R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/2438613002 .
2016-10-31 12:32:23 -07:00
Florian Loitsch f9cf78a1af Fix docs for Stream.handleError.
Fixes #27699
BUG= http://dartbug.com/27699
R=lrn@google.com

Review URL: https://codereview.chromium.org/2467453002 .
2016-10-31 16:03:05 +01:00
Jan-Hendrik Dolling 89560c68a0 change "the the" to the 2016-10-28 21:47:50 +02:00
Zachary Anderson 8169499ef8 GN: Format more gn files
Missed these on the first pass.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2454703004 .
2016-10-27 04:25:34 -07:00
Vyacheslav Egorov eb8c24e133 Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork."
R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2451623006 .
2016-10-27 10:09:22 +02:00
Vyacheslav Egorov 12968edb9c Revert "Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork.""
This reverts commit 4e7a31262e.

Windows bots are broken now.

R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2451893004 .
2016-10-26 17:07:18 +02:00
Vyacheslav Egorov 4e7a31262e Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork."
This relands commit 2fed1c3905 with fixes to ensure that analyzer summaries are correctly created and XARM build does not try to use target binaries on the host.

R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2453773002 .
2016-10-26 16:48:28 +02:00
Vyacheslav Egorov cf7ff42e60 Revert "Merge more Kernel infrastructure from kernel_sdk SDK fork."
This reverts commit 2fed1c3905.

SDK builds are failing

TBR=zra@google.com

Review URL: https://codereview.chromium.org/2455593002 .
2016-10-26 13:06:27 +02:00
Vyacheslav Egorov 2fed1c3905 Merge more Kernel infrastructure from kernel_sdk SDK fork.
- bring patched SDK generation scripts and VM patch tweaks that allow VM patch files to be parsed by analyzer front-end;
  Patched SDK is an SDK with all VM patches spliced into it. Kernel compiler is based on the analyzer front-end which does
  not have any patch files support/model so for it to produce Kernel files that match VM we need to generate a such patched SDKs.

- bring test script modifications that allow to test Kernel pipeline

BUG=
R=asiva@google.com, kmillikin@google.com, whesse@google.com, zra@google.com

Review URL: https://codereview.chromium.org/2434123003 .
2016-10-26 13:02:54 +02:00