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 .
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/29202R=floitsch@google.com
Review-Url: https://codereview.chromium.org/2790663003 .
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#29101R=fschneider@google.com
Review-Url: https://codereview.chromium.org/2761673002 .
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 .
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 #28614R=lrn@google.com
Review-Url: https://codereview.chromium.org/2753233002 .
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 .
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 .
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 .
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#28571R=asiva@google.com, fschneider@google.com
Review-Url: https://codereview.chromium.org/2698813002 .