Commit graph

7916 commits

Author SHA1 Message Date
Lasse R.H. Nielsen add2854671 Fix bug in doWhile where it completes an error synchronously with an error.
Review-Url: https://codereview.chromium.org/2796363005 .
2017-04-06 12:47:57 +02:00
Lasse R.H. Nielsen f380e61b57 Make Future.doWhile not delay when the return value is not a future.
Ditto for Future.forEach, which is based on Future.doWhile.

Update documentation.

Fixes issue #29239
BUG= http://dartbug.com/29239
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2795193002 .
2017-04-06 12:00:16 +02:00
Konstantin Shcheglov 565408593b Remove _StdSink._isTranslatable field.
The field is not used since 141b6351ba,
but it is final and not initialized, so this causes an error during
analyzer tests.

R=paulberry@google.com, zra@google.com
BUG=

Review-Url: https://codereview.chromium.org/2800453002 .
2017-04-04 12:56:44 -07:00
Lasse R.H. Nielsen 08beb9eadf Clean up documentation of Platform in dart:io.
The class is just a static-only container, and should really be rewritten as
either top-level getters instead of static getters, or as instance getters
on an interface (in case we ever want to mock it).

Also, the isOSName getters for each individual supported OS doesn't scale.
We should consider removing them and only support the `operatingSystem` getter.

R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2751913006 .
2017-04-04 09:24:39 +02:00
Lasse R.H. Nielsen d509ddb3fa Use FutureOr more and make Future.sync return the resulting Future directly.
When the computation passed to Future.sync returns a Future of the correct type,
then it's returned directly instead of wrapping it again.
(Until strong mode, we have an extra case for when it returns a Future of an
incorrect type, but that will eventually be removed).

This should improve the performance of Future.sync a bit.

Also adds missing Zone intercept for when the Future.sync computation throws.

Updates documentation for Future.doWhile.

Fixes #29202
BUG= http://dartbug.com/29202
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2790663003 .
2017-03-31 12:41:07 +02:00
Zach Anderson bc923bed16 [dart:io] Reland: Adds Platform.localeName
The Mac OS build broke because a typedef wasn't added until 10.12.

related #29126

Review-Url: https://codereview.chromium.org/2786183003 .
2017-03-30 13:51:46 -07:00
Zachary Anderson e75df3cce3 Revert "[dart:io] Adds Platform.localeName"
This reverts commit ae6d854ec6.

The build failed on the mac build bots. Need to investigate.

Review-Url: https://codereview.chromium.org/2791453002 .
2017-03-30 13:35:02 -07:00
Zachary Anderson ae6d854ec6 [dart:io] Adds Platform.localeName
related #29126

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2785073002 .
2017-03-30 13:31:11 -07:00
Lasse R.H. Nielsen c6ef4c8dd9 Fix edge cases where a FormatException source argument starts with a newline.
Fixes #29195

BUG= http://dartbug.com/29195
R=eernst@google.com

Review-Url: https://codereview.chromium.org/2789523002 .
2017-03-30 15:17:38 +02:00
Zach Anderson 141b6351ba [dart:io][windows] Use WriteFile instead of _write
This CL changes File::Write on Windows to call directly to WriteFile()
instead of using _write(). This avoids a number of complexities:
1. Don't need to bother with text vs. binary mode.
2. Don't need to check both errno and GetLastError if _write() fails.
3. Don't need to convert to a wchar_t* for console output since we've
   already set the code page to UTF8.

fixes #29101

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2761673002 .
2017-03-29 13:19:25 -07:00
Jacob Richman b5d53b5348 Fix spew when running presubmit which triggers dartfmt.bat on windows. We should also backport this change to the sdks in tools/sdk or roll a new version of the tools/sdk
Error span you otherwise get with each dartfmt invocation:

find: ‘>     bin [’: No such file or directory

Note that the error doesn't occur all times dartfmt is run, only when it is
run from the directory triggered by the presubmit.

BUG=
R=rnystrom@google.com, whesse@google.com

Review-Url: https://codereview.chromium.org/2759333004 .
2017-03-28 08:30:10 -07:00
Martin Kustermann fac6cda661 Add documentation to ALPN functionality in dart:io
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2770573003 .
2017-03-25 12:38:37 +01:00
Florian Loitsch 353a2288be Add more documentation to Future.then and Future.catchError.
Fixes #29129
BUG= http://dartbug.com/29129
R=lrn@google.com

Review-Url: https://codereview.chromium.org/2772463002 .
2017-03-22 20:10:33 +01:00
Florian Loitsch 0e541c1eac More minor type improvements in dart:async.
Fixes #28122

BUG= http://dartbug.com/28122
R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2762953003 .
2017-03-22 17:24:18 +01:00
Florian Loitsch a382f7845c Revert "Fix some strong mode issues in the core libraries."
This reverts commit e5c091e048.

Review-Url: https://codereview.chromium.org/2767943002 .
2017-03-22 16:55:05 +01:00
Florian Loitsch e5c091e048 Fix some strong mode issues in the core libraries.
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2764943002 .
2017-03-22 15:59:10 +01:00
Zach Anderson b3093ecee6 [dart:io] Move Platform.ansiSupported to {Stdin,Stdout}.supportsAnsiEscapes
On Windows, some Windows 10 builds support only ANSI output, but not
input, so these need to be separated.

I'm also improving the detection on Mac and Linux to avoid hardcoding
the result. Instead, supportsAnsiEscapes will be true if isatty() and
the TERM environment variable contains the string 'xterm'.

related #28614

R=lrn@google.com

Review-Url: https://codereview.chromium.org/2753233002 .
2017-03-17 12:35:36 -07:00
Jacob Richman ea6991a245 Format all dart: library files
BUG=
R=floitsch@google.com, sra@google.com

Review-Url: https://codereview.chromium.org/2754013002 .
2017-03-16 10:22:19 -07:00
Peter von der Ahé 7b36038783 Fix incorrect signature in socket.dart.
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2752153003 .
2017-03-16 14:28:22 +01:00
Stephen Adams e933720d88 dart2js: replace calls to codeUnitAt when index has favourable type
If the index is known to be a non-negative integer, only a simple
bounds check is required, so call a simpler version of codeUnitAt.

In a large app, about 60% of calls meet this condition.

Benchmarks do not show speedups, but that is because they are too
simple so global type inference can usually tell that the index is not
null, and often that it is always a non-negative integer, so the full version of codeUnitAt is optimized to look like the simple version. This does not happen in large apps.

BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2746033006 .
2017-03-15 19:16:23 -07:00
Zach Anderson 9be35abd37 Fix dart2js test
Review-Url: https://codereview.chromium.org/2756483003 .
2017-03-15 09:49:48 -07:00
Zach Anderson a8bf498e56 [dart:io] Adds Platform.ansiSupported
This is so that flutter_tool can determine whether it can print
ANSI codes to the terminal on windows.

fixes #28614,#28984

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2739683005 .
2017-03-15 08:51:50 -07:00
Harry Terkelsen 9ab56aa655 Make getProperty and callMethod nullable
Fixes https://github.com/dart-lang/sdk/issues/29076

R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2755483003 .
2017-03-14 15:54:03 -07:00
Stephen Adams 8cadbf4f72 Redo "Remove U+180E from whitespace in js_runtime and tests"
TBR=alanknight@google.com
BUG=

Review-Url: https://codereview.chromium.org/2747983003 .
2017-03-13 21:43:05 -07:00
Stephen Adams 66539fb493 Revert "Remove U+180E from whitespace in js_runtime and tests"
Several VM and browser status updates needed.

TBR=alanknight@google.com
BUG=

Review-Url: https://codereview.chromium.org/2748003002 .
2017-03-13 21:11:10 -07:00
Stephen Adams c6a01283c1 Remove U+180E from whitespace in js_runtime and tests
BUG= https://github.com/dart-lang/sdk/issues/28983
R=alanknight@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2733353002 .
2017-03-13 20:18:19 -07:00
Stephen Adams a3571dc7c1 DateTime and Duration tweaks for better dart2js codegen
Changes help dart2js infer that DateTime._value is never null, leading to better code for the numerous compareTo calls in some apps.

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2738963002 .
2017-03-08 16:38:56 -08:00
John McCutchan 5128636521 Support DevFS paths encoded as URIs
Fixes #28972

Note that the path handling logic in DevFS is now complicated with three
possible sources of path information. After we roll this we should clean it
up and unify on Uri encoding

BUG=
R=turnidge@google.com

Review-Url: https://codereview.chromium.org/2733413003 .
2017-03-08 15:41:11 -08:00
Stephen Adams fc56b59a88 Type of InstanceMirror on class should still be a ClassMirror when class has call method
BUG= https://github.com/dart-lang/sdk/issues/28864
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2735983003 .
2017-03-07 17:08:44 -08:00
Lasse R.H. Nielsen 00cd7580c1 Use FutureOr in Completer.complete.
R=floitsch@google.com

Committed: a4a7d98dce
Review-Url: https://codereview.chromium.org/2722203002 .
2017-03-02 10:11:08 +01:00
Dmitry Stefantsov 9c340f9eb1 Revert last 4 commits by @lrn
Reverted commits:
* ef097edad6. ("Make Analyzer, VM and
  dart2js accept URI strings as part-of library identifier.")
* e8e1857814. ("Fix bad example of URI
  part-of to be bad, not good.")
* 58f7a92ede. ("Add changelog entry for
  allowing URI in part-of.")
* a4a7d98dce. ("Use FutureOr in
  Completer.complete.")

TBR=lrn@google.com

Review-Url: https://codereview.chromium.org/2724853002 .
2017-03-01 16:44:52 +01:00
Lasse R.H. Nielsen a4a7d98dce Use FutureOr in Completer.complete.
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2722203002 .
2017-03-01 14:36:46 +01:00
Jennifer Messerly 18c4f5cf08 fix future onError handler wrapping to avoid cast error
the return type was invalid, which caused a runtime cast failure. Many of the onError handlers return `void` which is not assignable to T.

This was discovered in internal testing as we attempted to run DDC against the unforked SDK sources.

R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2718643003 .
2017-02-28 14:59:48 -08:00
Jennifer Messerly 373149e003 fix ListMixin _filter and sort to work in strong mode
R=lrn@google.com

Review-Url: https://codereview.chromium.org/2715833004 .
2017-02-28 10:37:28 -08:00
Florian Loitsch 169bcf98b7 Fix typo in IoSink.flush documentation.
Review-Url: https://codereview.chromium.org/2720953004 .
2017-02-28 19:34:27 +01:00
Florian Loitsch 37b7a6719a Fix typo in URI documentation.
Fixes #28556
BUG= http://dartbug.com/28556
R=lrn@google.com

Review-Url: https://codereview.chromium.org/2723563003 .
2017-02-28 19:32:50 +01:00
Stephen Adams 1ae1ec7df4 Remove HRuntimeType implementation
Use the legacy RTI format, which should be replaced with something that lets types and tests be cached and amortized.

R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2722753002 .
2017-02-28 09:33:32 -08:00
Florian Loitsch 7fa4496e51 Add documentation for mutating operations of unmodifiable maps.
Simply states that the operation is not supported.

Fixed #28918
BUG= http://dartbug.com/28918
R=lrn@google.com

Review-Url: https://codereview.chromium.org/2722613004 .
2017-02-28 14:41:38 +01:00
Lasse R.H. Nielsen 804f3dfdd8 Update documentation of Object.hashCode.
Fixes #28844

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

Review-Url: https://codereview.chromium.org/2708233003 .
2017-02-28 11:48:40 +01:00
Stephen Adams 14c7c3c556 Redo "Refined types for most HtmlElement factory constructors"
Fix: ShadowElement is not always present.

Original:
Committed: b7b12b564a
Reverted:  963df1e3e1

BUG=

Review-Url: https://codereview.chromium.org/2718713003 .
2017-02-24 14:28:58 -08:00
Stephen Adams 963df1e3e1 Revert "Refined types for most HtmlElement factory constructors"
Need to fix ShadowElement

TBR=alanknight@google.com

Review-Url: https://codereview.chromium.org/2710323004 .
2017-02-24 14:15:37 -08:00
Stephen Adams b7b12b564a Refined types for most HtmlElement factory constructors
The body of new DivElement() is marked as returning a DivElement, instead of inferred to return Element.
The more precise receiver type allows svg polyfills to be excluded, allowsing the HtmlElement methods to be identified as the single target and inlined.

This tends to improve the code generated for idioms like

    new DivElement()..classes.add('foo')

    var e1 = new DivElement();
    e1.children.add(e2);

BUG=
R=alanknight@google.com

Review-Url: https://codereview.chromium.org/2705213003 .
2017-02-24 11:23:06 -08:00
Florian Loitsch fb003ef3cb Fix typo in comment.
Review-Url: https://codereview.chromium.org/2715683002 .
2017-02-23 14:00:16 +01:00
Florian Loitsch 6cf3c51414 Better comment for embedded names.
Review-Url: https://codereview.chromium.org/2712953002 .
2017-02-23 13:52:25 +01:00
Florian Loitsch 5de7bb5782 Don't use magic strings/properties to communicate between compiler and runtime.
R=sra@google.com

Review-Url: https://codereview.chromium.org/2700053003 .
2017-02-22 18:32:23 +01:00
Florian Loitsch 1213f20e4b Update utf8 codec.decode comments.
Fixes #28834
BUG= http://dartbug.com/28834

Review-Url: https://codereview.chromium.org/2714483002 .
2017-02-22 13:20:19 +01:00
Zach Anderson a18a8ae8ef [dart:io][windows] Fix analyzer warning for last commit
Review-Url: https://codereview.chromium.org/2708343002 .
2017-02-21 23:25:59 -08:00
Zach Anderson bc07953866 [dart:io][windows] Make unicode characters display correctly.
This change has two pieces.
- Set the console code page to UTF8.
  - This makes strings printed with print() display correctly
- Set the file translation mode to _O_WTEXT when writing to a
  stdout or stderr that is connected to a console.
  - This makes strings printed with e.g. stdout.writeln()
    display correctly.

fixes #28571

R=asiva@google.com, fschneider@google.com

Review-Url: https://codereview.chromium.org/2698813002 .
2017-02-21 22:47:03 -08:00
Peter von der Ahé b13b8d872a Add YAML file with VM patch file information.
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2698003003 .
2017-02-21 13:56:28 +01:00
Jens Johansen 5cd765ba4d Close receive port on error to avoid hanging forever
Closes https://github.com/dart-lang/sdk/issues/28789

R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2703133004 .
2017-02-21 11:05:51 +01:00