Commit Graph

117 Commits

Author SHA1 Message Date
Jacob Richman 0dbb32f406 Run formatter on dev_compiler.
BUG=
R=vsm@google.com

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

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

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

For example: given:

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

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

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

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

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

R=srawlins@google.com

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

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

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

R=vsm@google.com

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

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

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

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

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

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

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

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

BUG=
R=jacobr@google.com

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

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

BUG=

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

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

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

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

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

R=vsm@google.com

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

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

R=rnystrom@google.com

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

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

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/2481703003 .
2016-11-07 10:59:22 -08:00
Jan-Hendrik Dolling 89560c68a0 change "the the" to the 2016-10-28 21:47:50 +02:00
Bob Nystrom 9b6317d571 Stop using unittest in point_test and rectangle_test.
This also makes rectangle_test strong mode clean. Alas, the test isn't
passing because of another bug, but once that bug is fixed, it should.

R=vsm@google.com

Review URL: https://codereview.chromium.org/2407913002 .
2016-10-10 11:02:37 -07:00
Bob Nystrom 20e402c43d Fix type errors in math.min() and math.max().
Really, this works around them, but the workaround is all round better
code.

Remove the Dart implementations of min() and max() and just forward to
the JS ones. In DDC, all numbers are double, so the type checks to
handle them specifically aren't meaningful. Also, we don't need the
other special case checks in there to help dart2js optimize them.

R=vsm@google.com

Review URL: https://codereview.chromium.org/2386493003 .
2016-09-30 13:18:07 -07:00
Bob Nystrom 33ff9a3d4f Fix type errors in sort().
If a comparer isn't provided, it was silently assuming the element type
implements Comparable, even though that isn't required. Fixed to add a
manual cast at each comparison.

A stricter faster approach might be to check that the type argument
itself is a type that implements Comparable, but I don't know if that's
too pessimistic, or even possible to do.

R=vsm@google.com

Review URL: https://codereview.chromium.org/2311513002 .
2016-09-08 17:14:36 -07:00
Bob Nystrom 4b321d0ecd Import "NoInline" into core so StackTrace's use of it resolves.
R=vsm@google.com

Review URL: https://codereview.chromium.org/2277753005 .
2016-08-25 17:08:52 -07:00
Jacob Richman 87577db2b2 Add dart:js_util library and tests to ddc. This library is already added to dart2js and dartium.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/2269963005 .
2016-08-24 09:13:06 -07:00
John Messerly 9b421ebb4f fixes #627, update DDC Future.then signature
R=leafp@google.com

Review URL: https://codereview.chromium.org/2259433002 .
2016-08-17 10:25:10 -07:00
Vijay Menon 144cca4b62 Roll DDC to latest dart:html
R=jacobr@google.com

Review URL: https://codereview.chromium.org/2207273002 .
2016-08-03 17:55:05 -07:00
John Messerly 86d9eb10d0 don't use JS_CONST in dart:html
R=jacobr@google.com

Review URL: https://codereview.chromium.org/2113913003 .
2016-07-01 10:53:27 -07:00
Jacob Richman f0cde883e9 Change allowInterop to a generic method.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/2106613002 .
2016-06-29 14:41:32 -07:00
Stephen Adams aea2fa1291 Update Symbol.hashCode
New dart2js version avoids inefficient String.hashCode

TBR=vsm@google.com

Review URL: https://codereview.chromium.org/2040963005 .
2016-06-06 12:34:59 -07:00
Jacob Richman d4dd53ede6 Add generic types to Sort and Comparable. Fix crasher bug in codegen.
BUG=
R=leafp@google.com

Review URL: https://codereview.chromium.org/2011973002 .
2016-05-25 10:42:23 -07:00
Stephen Adams 0235eba4b9 Updates to collection_patch.dart
BUG=
R=leafp@google.com

Review URL: https://codereview.chromium.org/1987043002 .
2016-05-18 15:10:40 -07:00
Stephen Adams 5ed8b5ecab Misc doc-only updatee, rerun build_sdk.
TBR=vsm@google.com

Review URL: https://codereview.chromium.org/1994473002 .
2016-05-17 20:51:53 -07:00
Stephen Adams 69d11e8df8 Misc updates (mostly doc)
TBR=vsm@google.com

Review URL: https://codereview.chromium.org/1987963003 .
2016-05-17 20:27:23 -07:00
Bob Nystrom d95a368e70 Update dart:collection.
This doesn't include the copious changes in collection_patch.dart
because I believe (1) those are quite old and (2) are dart2js specific.

The changes here have basically no effect on DDC, but it at least gets
us a little better test coverage and reduces noise in the diffs.

R=sra@google.com

Review URL: https://codereview.chromium.org/1977003002 .
2016-05-17 15:39:52 -07:00
Paul Berry 3b9d8f23f8 Remove unsupported libraries from libraries.dart.
These libraries are not supported by dev_compiler, hence the source
files that declare them don't exist in tool/input_sdk/lib.  Removing
them from `libraries.dart` will allow the analyzer to build a summary of
dev_compiler's fork of the SDK.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1980963002 .
2016-05-16 11:19:25 -07:00
Vijay Menon 88870d0194 Migrate dart2js stubs for dart:io
Modifies tests to use our SDK.  Didn't prune io dependences to make
sure the stubs above work.  :-)

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1976103003 .
2016-05-16 08:23:41 -07:00
Bob Nystrom 4a51a187d3 Upgrade to the latest dart:convert.
This fixes html_escape_test as well as codec1_test.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1978963002 .
2016-05-13 16:33:35 -07:00
Bob Nystrom 2883b19b9c Upgrade StackTrace to the latest SDK version.
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1967383002 .
2016-05-12 10:31:04 -07:00
Jacob Richman 548f1393a3 Work around is check issue causing zone error handlers to never fire. Update test expectations to reflect the correct expectations.
BUG=
R=leafp@google.com

Review URL: https://codereview.chromium.org/1968323002 .
2016-05-12 09:33:05 -07:00
Harry Terkelsen 382996f41c update dart:math
BUG=
R=rnystrom@google.com

Review URL: https://codereview.chromium.org/1967773005 .
2016-05-12 09:03:11 -07:00
Harry Terkelsen 97ec1f79d6 always emit lazy field if overriding static
We used to emit an eager field if a static was overriding a static field
in a superclass because this is valid ES6. However, even if the static
field is not synthetic in the superclass, it might still be emitted as a
lazy static. The safest way is just to emit a lazy field for static
overrides always.

fixes #522

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1966763004 .
2016-05-11 11:09:03 -07:00
Harry Terkelsen 32fd2f8215 update Map
R=sra@google.com

Review URL: https://codereview.chromium.org/1963723003 .
2016-05-10 16:19:19 -07:00
Bob Nystrom e535970604 Update dart:convert and dart:core Uri.
I started trying to get the convert tests all cleaned up and passing
but realized I was going down a rathole. So, for now, all of the slow
or failing ones are just skipped.

BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/1965563003 .
2016-05-10 10:25:38 -07:00
Stephen Adams 783a1f45c2 Update linked_list, queue, splay_tree
Now identical to (pending) CL from main branch.

TBR=vsm@google.com

Review URL: https://codereview.chromium.org/1966473002 .
2016-05-09 14:14:29 -07:00
Stephen Adams c2e170fb1f Update mirrors.dart
This is a comments-only update.
Several APIs need to be visited to be made to work for DDC.
These are much clearer now.

TBR=vsm@google.com

BUG=

Review URL: https://codereview.chromium.org/1955293003 .
2016-05-08 18:31:18 -07:00