Commit graph

18366 commits

Author SHA1 Message Date
Brian Wilkerson a39bf4764b Add some recovery tests inspired by an issue
Change-Id: Ic5fe3fde8dc6223fb78647f90052cd1a2e758dca
Reviewed-on: https://dart-review.googlesource.com/29600
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-14 19:19:06 +00:00
Dan Rubel b709bc4bbe Fix AstBuilder interpolation expression construction
Add a new handleInterpolationExpression fasta parser event
so that AstBuilder can correctly construct interpolation expressions
with left and right brackets.

Change-Id: Icca977067fe3a28dbab83488108c7286ec135dca
Reviewed-on: https://dart-review.googlesource.com/29541
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-14 19:18:16 +00:00
Terry Lucas 642b768e87 Fixed default parameter messagePorts for MessageEvent factory.
R=vsm@google.com

Change-Id: Ic94ccbe4c29302e44c58791658ce75dff86d9ac2
Reviewed-on: https://dart-review.googlesource.com/29544
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-12-14 18:21:25 +00:00
Devon Carew 38df6ea1f4 Only show closing labels that have nesting.
Bug:
Change-Id: Ifc9177973961f2a74be3e2871aa2d58c28007478
Reviewed-on: https://dart-review.googlesource.com/29540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-14 15:54:50 +00:00
Brian Wilkerson df479ca916 Accept a trailing comma in asserts in initializer lists (issue 31320)
Change-Id: I6166aac91abc65c0817d14e1d98f5944236016bf
Reviewed-on: https://dart-review.googlesource.com/29520
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-14 15:49:45 +00:00
Florian Loitsch 1a61b425d1 Reland BigInt class.
Moved `parseRadix` into a separate test where it doesn't do 10 iterations.
This reverts commit ab4061471b.

Change-Id: Ie48216c2f4f077dc86f915a54021c39706c432e8
Reviewed-on: https://dart-review.googlesource.com/29593
Reviewed-by: Florian Loitsch <floitsch@google.com>
Commit-Queue: Florian Loitsch <floitsch@google.com>
2017-12-14 15:44:15 +00:00
Paul Berry 09e432a914 Remove StrongModeCode.UNSAFE_BLOCK_CLOSURE_INFERENCE, which is no longer used.
Change-Id: I289a194670dbdec7cda3522bea614beae09a18c3
Reviewed-on: https://dart-review.googlesource.com/29543
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-12-14 15:08:46 +00:00
Sam Rawlins eb834e1886 Analyzer: allow identifier references in comments
When referencing an identifier in a documentation comment that precedes the
identifier, but exists in the same scope, do not raise an error.

Bug: https://github.com/dart-lang/sdk/issues/24880
Change-Id: I1cf9b54e0af280ea9f9a64f5e2a751e9573a1e5b
Reviewed-on: https://dart-review.googlesource.com/29561
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2017-12-14 15:05:55 +00:00
Aske Simon Christensen d5fd7a3007 Eliminate error flag from library builder.
Change-Id: I4fe70ba733c80dcfa95b86447d1094b7338d83f2
Reviewed-on: https://dart-review.googlesource.com/29588
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2017-12-14 14:53:46 +00:00
Kevin Millikin bc2560069a Add a representation for an instantiated generic function
Kernel allows instantiating a tearoff to type arguments.  This
construct is not yet produced by the front end or supported in any
back end.

Closes issue #31550

Bug: https://github.com/dart-lang/sdk/issues/31550
Change-Id: I5e50d26cdc77a84ba92fa0ea5eea49b42ca83551
Reviewed-on: https://dart-review.googlesource.com/29587
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2017-12-14 14:51:45 +00:00
Jens Johansen 4b8415dd5a [DDC] Sourcemap tests no longer spawn external dart process
Previously a separate dart process would be spawned to compile a dart
file to JS.
This CL internalize it instead, giving a massive speedup.

Bug:
Change-Id: Ib0c073b1f99ecc0c0531aa83a8299278d90762c8
Reviewed-on: https://dart-review.googlesource.com/29200
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-12-14 14:20:18 +00:00
Peter von der Ahé f42359cdd1 Remove collectAllClasses
Change-Id: I12390cc3a3f6dde2b2abe5ed5da4e6c5ce114ba7
Reviewed-on: https://dart-review.googlesource.com/28725
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-14 10:18:25 +00:00
Johnni Winther b13a6015cc Support subtyping for function type variables.
Change-Id: I0e00330d76cc9b1f3d48bb1f0d87f6334976de54
Reviewed-on: https://dart-review.googlesource.com/29281
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 10:09:55 +00:00
Johnni Winther 5f06d51d1a Enable inlining by default
Change-Id: I4810959da23193d8a1b572b4feea329a2f4b2f31
Reviewed-on: https://dart-review.googlesource.com/29320
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 10:02:54 +00:00
Johnni Winther b759f8fb15 Use sorted named parameters on inlining.
Change-Id: I066383b86b55e1d76633c281f30ebbc3fa5d46e3
Reviewed-on: https://dart-review.googlesource.com/29280
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 09:21:44 +00:00
Jens Johansen 627fb6ac6c [DDC-kernel] Fix sourcemaps after fileUri was added to Constructors
When fileUri was added to Constructors a few tests had to be marked as
failing. This CL fixes the issue.

Bug:
Change-Id: I1168fab05a8edfcd17416476b3abbaf9322d88b9
Reviewed-on: https://dart-review.googlesource.com/29580
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-12-14 09:07:17 +00:00
Johnni Winther 5c0f33934b Register inlined constructor types
Change-Id: I097394c868a0fabe0e83814a65ec7884b64741af
Reviewed-on: https://dart-review.googlesource.com/29121
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 09:07:03 +00:00
Johnni Winther 0edef589d4 Ensure type variables for inlined constructors and mixin fields
Change-Id: I348acffb7842ff1c9f28ebf73c507e282c6a045e
Reviewed-on: https://dart-review.googlesource.com/29080
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 08:53:21 +00:00
Peter von der Ahé 7a40a6c3da Report an error on all classes involved in a cycle
Change-Id: I80221caf1f17acfe50b3c77da8e86e1bff54c67f
Reviewed-on: https://dart-review.googlesource.com/28724
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-14 08:47:25 +00:00
Dan Rubel 3f273903bb Add fasta parser incomplete field recovery
Change-Id: Ifb948c752d8cda3afcd39f80d4681a25fac9e3a8
Reviewed-on: https://dart-review.googlesource.com/29445
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-14 01:25:45 +00:00
Sam Rawlins 14629098dd Enforce @visibleForTesting annotations.
In particular, enforce that a method annotated with @visibleForTesting can only
be referenced from within the declaring library, or within a file that has
"/test" in its path. This allows @visibleForTesting methods to be accessed from
test files, or files in "/testing" folders, etc.

Bug: https://github.com/dart-lang/sdk/issues/28273
Change-Id: I3c19f73be330c49face7e3203879742d514bca74
Reviewed-on: https://dart-review.googlesource.com/27201
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-14 00:17:24 +00:00
pq 3be583a006 Account for missing option includes (#31648)
Fixes: #31648.
Bug:
Change-Id: I1fae4c0aeff4935ca212b3d9ef52645492f7465c
Reviewed-on: https://dart-review.googlesource.com/29500
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-13 23:36:14 +00:00
Sigmund Cherem 08bd966708 Count return/throw and their children in inlining heuristic.
I discovered this because a deferred method was being inlined accidentally: we
thought it was empty and inlined it when we shouldn't have.

Change-Id: I9795b62f4ffb81222100afedd3b42cb8828900bd
Reviewed-on: https://dart-review.googlesource.com/27925
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-13 23:26:54 +00:00
Brian Wilkerson 77d3b70220 Add previewDart2 to remaining kernel tests
Change-Id: I097df911af5d90f38eb177a6744c798a29a5804e
Reviewed-on: https://dart-review.googlesource.com/29460
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-13 22:46:14 +00:00
Devon Carew 6346b18028 Restore a strong mode analyzer cli test.
Bug:
Change-Id: If9b459d99a3120071ba8f3a7bd9aa1d2e776bbd6
Reviewed-on: https://dart-review.googlesource.com/29443
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2017-12-13 22:26:56 +00:00
Konstantin Shcheglov 4804108735 Support for more than one variable defined in a statement.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I9c5163099e46639a58487d217c1895b21bbc754d
Reviewed-on: https://dart-review.googlesource.com/29440
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-13 22:14:24 +00:00
Konstantin Shcheglov 577ceed6cd Apply resolution to multiple top-level and class fields.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Ib6c60b433215c4cd2af8d8a160b0cd9419c64095
Reviewed-on: https://dart-review.googlesource.com/29441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-13 21:47:34 +00:00
Bob Nystrom 4d5bcd5958 Make minitest.dart a little more resilient against misues.
We don't want to silently pass tests that think they are async when
the test framework doesn't know it's async.

Change-Id: I6556f8223d8d930ba252496adf233a5cb1108929
Reviewed-on: https://dart-review.googlesource.com/27923
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-13 21:32:54 +00:00
Sigmund Cherem e0e94eca46 Workaround issue #31579.
Temporarily use the patch URI for procedures and constructors and adjust
file-offset on class metadata to workaround issue #31579.

This change should be reverted when we have proper tracking of both origin and
patch URIs for each patched element.

Change-Id: I451a39b57cb121c2de3b1a324adc8cdbb5e8962c
Reviewed-on: https://dart-review.googlesource.com/29004
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-13 21:30:24 +00:00
Konstantin Shcheglov 3f90f36380 Apply resolution to not procedures/methods invocations.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I419245d819c68a28ecb328e78073cbe5373f7455
Reviewed-on: https://dart-review.googlesource.com/29360
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-13 21:13:14 +00:00
pq ab4061471b Revert "Add BigInt class." [TBR].
This reverts commit f189bb57a4.

Bug:
Change-Id: I7b1cc4ab69adb5142ff7b5abd563d3bf7371ebb9
Reviewed-on: https://dart-review.googlesource.com/29442
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2017-12-13 21:12:02 +00:00
Brian Wilkerson 9267fe0dbb Add flag to CompileTimeErrorCodeTest_Kernel
Change-Id: I926d4072d93c1c32107d7bcf8fba5add906c7fd0
Reviewed-on: https://dart-review.googlesource.com/29380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-13 20:44:24 +00:00
Samir Jindel 56ecbbde4b [kernel] Support 64-bit integer literals correctly in Fasta.
Bug:
Change-Id: Idfb037e79d247889fe6a7d9a9b475ca4f8637080
Reviewed-on: https://dart-review.googlesource.com/27800
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-13 20:35:19 +00:00
Sigmund Cherem f34af36ef9 [pkg:kernel] Add fileUri to Constructors
We have a fileUri for fields and procedures and it was missing in constructors.

This is needed to be able to correctly store the patch URI in patched
constructors and to be able to workaround
https://github.com/dart-lang/sdk/issues/31579.
Change-Id: Ic80d3dc87450ada8b39b555e9b16e162d0e40b45
Reviewed-on: https://dart-review.googlesource.com/29003
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-13 19:35:34 +00:00
Konstantin Shcheglov 1b7ae4e98b Fix for the test that does not fail anymore.
TBR

R=brianwilkerson@google.com, pquitslund@google.com

Bug:
Change-Id: I0a17afcd8379fcebf0547735bd4b5f7bfcc05bf1
Reviewed-on: https://dart-review.googlesource.com/29341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-13 19:17:36 +00:00
Dan Rubel 3ab29148f4 Add fasta parser cascade recovery
Change-Id: I1cf32604acf2124a9d61621fbb4cfb9343d98d33
Reviewed-on: https://dart-review.googlesource.com/28840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-13 18:30:25 +00:00
Florian Loitsch f189bb57a4 Add BigInt class.
Change-Id: I6e7fed3913cdb8e69ea15f0c69e060cccd91a356
Reviewed-on: https://dart-review.googlesource.com/9820
Commit-Queue: Florian Loitsch <floitsch@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2017-12-13 18:23:51 +00:00
Konstantin Shcheglov 88575a3f4c Fix resynthesis for 'dynamic op value' constant expressions.
1. Move error checking before.

2. Remove check for operator using resolution, because there is no
   resolution for dynamic target. _toBinaryOperatorTokenType() will
   throw if the operatorName is not actually the name of an operator.

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

Bug:
Change-Id: Iaa7d909ec8a6c13f306fd73122a10a0de170e7e1
Reviewed-on: https://dart-review.googlesource.com/29181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-13 18:18:35 +00:00
Brian Wilkerson 24a510a91e Enable previewDart2 for more tests
Change-Id: I1f2003040246b5b12f2866d513ff3502246ac39f
Reviewed-on: https://dart-review.googlesource.com/29220
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-13 18:15:45 +00:00
Peter von der Ahé e816c3fbc1 Remove unused argumentsWithMissingDefaultValues
Change-Id: I0961e74144fd9d86942e88cf525fe71e9a9c2b41
Reviewed-on: https://dart-review.googlesource.com/28740
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-12-13 16:48:24 +00:00
Konstantin Shcheglov 74dcc87393 Triage several tests in NonErrorResolverTest_Kernel.
I opened several issues for missing errors and providing actual source
span, not just single offset. We need them anyway, and it is better to
let the FrontEnd know about them sooner, so that they have time to
plan implementing them.

https://github.com/dart-lang/sdk/issues/31626

R=brianwilkerson@google.com

Bug:
Change-Id: I9238a06c8489679fa2a19f853ead2a2b93c39e39
Reviewed-on: https://dart-review.googlesource.com/29042
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-13 15:38:48 +00:00
Konstantin Shcheglov fe7e7df11c Give function expression elements unique names to ensure unique identity.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I1bf76b14a63e35403629bb5864f7f1122cf28d5e
Reviewed-on: https://dart-review.googlesource.com/29002
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-13 15:37:47 +00:00
Dan Rubel ebddad2329 Fix fasta parser recovery of redirection in non factory
Change-Id: Ia9943fb3c600a042b71bd2901cf962c06f61b523
Reviewed-on: https://dart-review.googlesource.com/28940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-13 15:24:55 +00:00
danrubel 1d174010cc fasta parser parseMethod cleanup
Change-Id: I67527349274f7422ca5ce33263c66fb8e88e23f9
Reviewed-on: https://dart-review.googlesource.com/28980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-13 15:07:05 +00:00
Brian Wilkerson 941b3b25c3 Clean up some failing tests
Change-Id: I79d951bab655ac322750222f921e055ad6ed6ef9
Reviewed-on: https://dart-review.googlesource.com/29040
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-13 14:16:36 +00:00
Erik Ernst f95a3cc1e6 dart2js no longer warns that function type variables are not reified
Change-Id: I69746c92912fcbbc35e1f6c37e310352f92708f6
Reviewed-on: https://dart-review.googlesource.com/28641
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-12-13 14:01:16 +00:00
Vijay Menon e9d03b4120 Forward native static methods
We don't generate these.  Rather than do that, this CL forwards to the
actual JS method instead.

This is the diff on the generated dart_sdk.js:

59732c59732

<     return html$.LengthValue._fromDictionary_1(dictionary_1);

---

>     return dart.global.LengthValue.fromDictionary(dictionary_1);

59894c59894

<     html$.MediaStreamTrack._getSources(dart.fn(value => {

---

>     dart.global.MediaStreamTrack.getSources(dart.fn(value => {

80232c80232

<     html$.Notification._requestPermission(dart.fn(value => {

---

>     dart.global.Notification.requestPermission(dart.fn(value => {

Change-Id: I9e857a808557e4702fb2b99aa518c25b49ff3db7
Reviewed-on: https://dart-review.googlesource.com/29020
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-12-13 13:38:36 +00:00
Jens Johansen 970e1aabf7 [DDC-kernel] Deal with null fileUris
When building source maps it is currently assumed that the fileUri is
non-null (or at least that the location extracted from the Uri and
offset is non-null.
That might not always be the case (e.g. see CL 29003).

Bug:
Change-Id: I29c928a0d5fcd2bd5e1d1ef6c6d6ac97d2e7408c
Reviewed-on: https://dart-review.googlesource.com/29120
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-12-13 12:37:14 +00:00
Johnni Winther 5599c80edd Don't create HParameterValue nodes for type arguments when inlining
Change-Id: If44fc4cbb39336f7ac01b906702f5aaa2ed1cd90
Reviewed-on: https://dart-review.googlesource.com/28721
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-13 10:10:23 +00:00
Johnni Winther a1f5474f80 Allow inlining of platform library functions
Change-Id: I2803d66f54d2e1052ca8af5fb719bded8f400171
Reviewed-on: https://dart-review.googlesource.com/28563
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-13 09:35:59 +00:00