Commit Graph

899 Commits

Author SHA1 Message Date
Jacob Richman 3c7353d987 Update all tests
Support //# multitests for better dartfmt compatibility and fewer multitest false positives

All files under tests were manually updated with

find . -iregex '.*\.dart$' -print0 | xargs -0 perl -pi -e 's/(\S\s+)\/\/\/ /$1\/\/# /'

For now both old and new styles are allowed to accommodate CO19 tests.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2765693002 .
2017-03-21 12:39:28 -07:00
Konstantin Shcheglov a9dfc31525 Infer fields/getters/setters types according to the new top-level inference rules.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/28219

Review-Url: https://codereview.chromium.org/2761633002 .
2017-03-19 10:09:48 -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
Vijay Menon 2fd1f5ebf1 Fix FutureOr runtime check
Fixes #29062

This is taken straight from Jen's CL here:

https://codereview.chromium.org/2456803004/

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2750393003 .
2017-03-16 12:54:22 -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 6cf2ac1f62 Fix FF test status and re-enable
With sra's num parse fixes and couple more, FF should be green again (as well as Chrome Canary).

R=alanknight@google.com

Review-Url: https://codereview.chromium.org/2750503009 .
2017-03-14 09:28:10 -07:00
Vijay Menon f9cb23d2eb Fix DDC status, take 2
They *do* pass on Chrome 59.

TBR=sra@google.com

Review-Url: https://codereview.chromium.org/2749853002 .
2017-03-14 07:35:29 -07:00
Vijay Menon 9c1a75bf34 Fix DDC status
These tests appear to pass on FF, but fail on Chrome.

TBR=sra@google.com

Review-Url: https://codereview.chromium.org/2748133002 .
2017-03-14 07:28:58 -07:00
Vijay Menon f331ecea20 Invoke native methods directly
In DDC, if the receiver is typed and the target method simply forwards to a JS call, invoke that call directly instead of via a symbol.

This is a step toward #28307.

Paul: can you look the the analyzer / summary code change?

dart:html uses "native".  other libraries (e.g., typed_data) use "external" for more or less the same thing.  The analyzer element model doesn't provide a way to test for "native" methods, but it does for "external".  I map native to external here.  Not sure if it's better to treat them as separate (I believe native predated external).  Longer term, it may make sense to try to remove "native" in favor of "external".

R=brianwilkerson@google.com, jacobr@google.com, jmesserly@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2748713002 .
2017-03-13 15:11:37 -07:00
Jacob Richman 1f38879094 Inline source maps as part of each script.
Unfortunately this is required as even with ideal caching, performing
XHRs to load all source maps increased load times by ~5 seconds for large
applications. Performance hit is now minimal.

BUG=

Review-Url: https://codereview.chromium.org/2747513003 .
Review-Url: https://codereview.chromium.org/2746033003 .
2017-03-13 10:46:02 -07:00
Vijay Menon 406a82723f Fix expectations
TBR=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2744853002 .
2017-03-10 08:53:08 -08:00
Vijay Menon b4163fa8bb Fix test expectation
TBR=jacobr@google.com

Review-Url: https://codereview.chromium.org/2739103003 .
2017-03-09 14:55:21 -08:00
Vijay Menon 402e025c63 Add option to suppress type-check whitelisting
Run most tests without the whitelisting.

See #27223

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2739863003 .
2017-03-08 17:51:32 -08: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
Vijay Menon d5372c79ae Bump timeout
This test seems to timeout often on travis lately.

TBR=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2731243003 .
2017-03-06 16:45:59 -08:00
Vijay Menon 2acb2eb669 Update for latest tests and sdk
TBR=leafp@google.com

Review-Url: https://codereview.chromium.org/2731333002 .
2017-03-06 09:36:14 -08:00
Jacob Richman a6a206062d Custom formatter cleanup Fix case where displaying a class constructor generated unreadable huge output. Fix case where exceptions were throw. Correct display of statics, fix indentation bugs. Add improved custom formatter test to main repro. As a drive by fix, switch hashCode to use a symbol instead of the name $identityHash as $identityHash was making custom formatter test output unstable.
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2703263002 .
2017-02-28 17:47:53 -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
Vijay Menon 53971cb67e Fix Function.apply
Fixes #27257.

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

Review-Url: https://codereview.chromium.org/2716583006 .
2017-02-24 19:24:48 -08:00
Leaf Petersen ef120f105f When metadata is not requested, elide signature information that is
not needed for dynamic checks (static fields/getters/setters and constructors).

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2711253004 .
2017-02-24 12:59:09 -08:00
Vijay Menon 1ec614fd7b Enable DDC output to run on v8/d8 using ES6 modules
Fixes #27309

V8 / D8 tip supports ES6 modules natively.  It's a little cumbersome
to set up, but hello world runs.  :-)

> ln -s $DDC_PATH/lib/js/es6/ddc_sdk.js ddc_sdk
> dart  $DDC_PATH/bin/dartdevc.dart --dart-sdk-summary $DDC_PATH/lib/sdk/ddc_sdk.sum --modules es6 -o hello hello.dart
> cat > run.js
import { hello } from 'hello';
hello.main();
> d8 --module run.js

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2701963002 .
2017-02-17 16:54:21 -08:00
William Hesse 72b58ee3b6 Fix corelib_strong/sort_test on dev_compiler
BUG=
R=jacobr@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2683583009 .
2017-02-08 23:06:52 +01:00
Jennifer Messerly 5817ba47e2 fix #28642, handling of top and bottom types in DDC
in particular: void, Null, and combinations with FutureOr<T>

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2671113002 .
2017-02-06 14:56:10 -08:00
Leaf Petersen a3b4366f11 Infer Null for return type of functions with empty returns.
This allows inference to infer Null as the return type of functions
which have no return statements, or which return with no value.

Also allows inference to propagate Null.

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

BUG=
R=brianwilkerson@google.com, jmesserly@google.com

Review-Url: https://codereview.chromium.org/2667343005 .
2017-02-06 12:24:39 -08:00
Leaf Petersen 3fa3964a70 Suppress NO_DEFAULT_BOUND errors.
This suppresses the emission of NO_DEFAULT_BOUND errors, and makes the
default instantation for recursive bounds backwards (and possibly
forwards) compatible.  Also adds a couple of currently failing tests
for cases that should be made erroneous regardless of whether we
choose to support malbounded type constructor applications.

BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2662973005 .
2017-02-01 10:18:05 -08:00
Vijay Menon c88a17ff55 Some test cleanup
These tests occasionally time out on travis.  uri_test as well, but
there are two tests with that name, so I added code to disambiguate in
the logs.

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2666593002 .
2017-01-31 10:23:26 -08:00
Vijay Menon 154cd39db8 Fix test status
Started breaking with leaf's cl on Fri.

Note, a	 very recent test (I think) is not strong clean any more.  Rewrite it?

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

Review-Url: https://codereview.chromium.org/2662873002 .
2017-01-30 08:08:16 -08:00
Vijay Menon 50ccf6d9b5 Fix DOM constructors in inline JS
R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2659063002 .
2017-01-27 09:47:13 -08:00
Vijay Menon fd94337b42 Fix for Animation and other polyfills
The polyfill code needs to run before dart_sdk is loaded.  Otherwise, the registerExtension step on these types does not work.

Also fixes #27605

R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2649613003 .
2017-01-25 16:18:49 -08:00
Vijay Menon a91cc9cc9e Use microtasks in dart.async
Not quite sure about this, but it makes ordering match for the example in  #28509

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2653253002 .
2017-01-25 16:14:01 -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
Jacob Richman d90ed8c295 Fix noSuchMethod handling of methods that are also extension methods. Fix noSuchMethod handling of methods with names that are rewritten in DDC e.g. "_get" instead of "[]" Fix some mirror system handling of symbols with names that are rewritten in DDC
BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2623053004 .
2017-01-24 11:16:21 -08:00
Vijay Menon a27adee736 Update tests for FF 51
A handful of tests started working in FF 51.

TBR=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2655673003 .
2017-01-24 08:32:17 -08:00
Konstantin Shcheglov 5c722b4118 Issue 28478. Add new strong mode bounds failing tests.
R=brianwilkerson@google.com, vsm@google.com
BUG=

Review-Url: https://codereview.chromium.org/2651503004 .
2017-01-23 15:15:13 -08:00
Konstantin Shcheglov e8cf6b43a3 Mark dartbug/27526 tests as failing in DDC.
R=vsm@google.com
BUG=

Review-Url: https://codereview.chromium.org/2641073006 .
2017-01-19 20:20:37 -08:00
Bob Nystrom 590a188066 Use "Object" as the reified type of covariant override parameters.
This ensures the runtime type is of the tear-off expression's static
type, even when accessed through a superclass.

I also moved the two tests into a subdirectory so they are easier to
find. (It is inscrutable to me why we would have a single directory
with 1,868 test files in it.) That involved enabling recursive
directory listing in codegen_test, which exposed a couple of things.

Fix #27484.

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2641543003 .
2017-01-18 14:48:42 -08:00
Vijay Menon 5b34e47f40 Fix subtyping check on number
language_strong/null_is_test started failing on Konstantin's recent change.  Another test started passing.

Does this fix make sense to you guys?

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

Review-Url: https://codereview.chromium.org/2638393004 .
2017-01-18 13:27:27 -08:00
Vijay Menon 21e1ebc3aa Fixes to status
TBR=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2643793002 .
2017-01-18 06:16:56 -08:00
Vijay Menon c83dac537f Throw TypeError on arg mismatch
Improvement on #28286 - this is still not quite right as we'll throw a
TypeError instead of a NSM in certain cases depending on the order.
The spec will only throw a TypeError if NSM doesn't apply.

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2636313002 .
2017-01-17 16:26:22 -08:00
Vijay Menon 83f8ca4652 Fix status
See #27259

TBR=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2634303002 .
2017-01-17 06:01:04 -08:00
Vijay Menon 14cf17d898 Fix FF tests
TBR=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2638493002 .
2017-01-13 15:17:39 -08:00
Vijay Menon 1f5562e29c More test refactoring to catch failures
Skip fewer tests.  Many are now passing.  Mark the rest as fail and test that they're still failing.

R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2634433002 .
2017-01-13 09:02:45 -08:00
Vijay Menon 0703ec5b1a Track crashing tests
tbr'ing to fix bots

TBR=brianwilkerson@google.com,rnystrom@google.com

Review-Url: https://codereview.chromium.org/2629173003 .
2017-01-12 16:00:15 -08:00
Vijay Menon 580186a655 Defend against false positives
If a seemingly non-async test returns a Future, wait on it.  I noticed this on an earlier CL today related to the await_in_cascade_test - the test was broken, but we were falsely passing.

This still doesn't handle false negatives (e.g., tests that are expected to fail).  That's why many of these are marked skip_fail.  If the exception happens after main returns, we currently don't see it.

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2629023002 .
2017-01-11 14:34:07 -08:00
Vijay Menon be95523221 Cleanup references to the old DDC repo
Reachable issues migrated over.

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2621543004 .
2017-01-10 12:56:29 -08:00
Vijay Menon 33c8f425b6 Disable auto "debugger" call for tests
R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2621823002 .
2017-01-09 15:42:42 -08:00
Vijay Menon 038a66b305 Regen DDC error expectations
Is this due to recent inference changes?

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

Review-Url: https://codereview.chromium.org/2619923002 .
2017-01-09 15:32:05 -08:00
Bob Nystrom d1030e9be0 Don't hardcode 'dart' as the executable name to spawn.
I don't think it's on the PATH on the buildbots.

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2617013003 .
2017-01-05 16:44:09 -08:00
Dan Rubel 55ef6e193c support --options flag and other analysis options flags in DDC
This updates DDC options processing to support:
* --options /path/to/analysis/options/file.yaml
* --enable-strict-call-checks
* --supermixin
* --no-implicit-casts
* --no-implicit-dynamic

As well as general refactoring and cleanup of DDC options processing

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2598593003 .
2017-01-04 18:15:21 -05: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