Commit Graph

4698 Commits

Author SHA1 Message Date
Peter von der Ahé fa08584fe6 Pass dart2js verbose flag to Fasta.
Change-Id: I96cae3c752dd42888108d0893f1200aa06da8f4b
Reviewed-on: https://dart-review.googlesource.com/11660
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-06 15:35:43 +00:00
Harry Terkelsen 52208dd84d Report error if const constructor has a non-const field
Change-Id: Ifa3a000210752a1ec389b28c290900d05244fee5
Reviewed-on: https://dart-review.googlesource.com/11243
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-05 19:53:26 +00:00
Johnni Winther 02d63285ab Handle switch in inferrer
Change-Id: I4e226b1bf15d3fdcd04edba08433298f0b2147e3
Reviewed-on: https://dart-review.googlesource.com/11060
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-05 08:45:23 +00:00
Johnni Winther 42c6bea376 Handle break, continue and labeled statements in inferrer
Change-Id: I16968260e774c9cb8a002fd1f027dcef2db605fe
Reviewed-on: https://dart-review.googlesource.com/10882
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-05 08:19:13 +00:00
Johnni Winther d2bb9ed06c Handle asserts in inferrer
Change-Id: If0d5eb8a15d5378a05a269aef976c914c21bb517
Reviewed-on: https://dart-review.googlesource.com/11000
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-05 07:50:19 +00:00
Johnni Winther 693cce1387 Handle as and rethrow in inferrer
Change-Id: I2528939c8e76e4445a434e48967187666356a049
Reviewed-on: https://dart-review.googlesource.com/10881
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-05 07:33:51 +00:00
Johnni Winther 85e77d5a8c Remove Rasta and friends
Change-Id: Ifb14444673c31f4e337fd4d3a2639938fc9e68dc
Reviewed-on: https://dart-review.googlesource.com/11040
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-05 07:03:55 +00:00
Johnni Winther 717b5aac61 Remove --use-kernel-in-ssa option
Change-Id: I3bfc78903cbdb6b15f428bd32d8074b5b9eb5156
Reviewed-on: https://dart-review.googlesource.com/10862
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-05 06:54:16 +00:00
Dan Rubel efeaa0eab3 Class header recovery
This updates the fasta parser to handle out of order clauses
in the class header similar to analyzer.

Also:
* Fix parseTopLevelDeclaration in parser test proxy
* Fix parseStuff to correctly update token stream
* Extract skipUnexpectedTokenOpt
Change-Id: Ic20c0ab1355e866aa241c591ceeada390890c46a
Reviewed-on: https://dart-review.googlesource.com/9880
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-04 21:33:09 +00:00
Emily Fortuna 0eca8a1748 Add RTI while walking closure info.
Bug:
Change-Id: If1b33706d3b7a784f292a9f133779109109d8d25
Reviewed-on: https://dart-review.googlesource.com/8321
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-04 19:24:31 +00:00
Sigmund Cherem 64fa2ad383 Delete the lazy emitter
Change-Id: I6aff22c1106ee03604c888226e961e208b621de4
Reviewed-on: https://dart-review.googlesource.com/10802
Reviewed-by: Emily Fortuna <efortuna@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-04 19:23:55 +00:00
Johnni Winther 9f9b7bf520 Handle super get/set/invoke in inferrer
Change-Id: I4c3cd2ae4d99abb4de4edffc644e646f6eeca029
Reviewed-on: https://dart-review.googlesource.com/10460
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-04 08:07:46 +00:00
Johnni Winther 8b96d1be59 Handle throw and enums
Change-Id: If7a957630f50a225422aaa233e3cb3ef2a005025
Reviewed-on: https://dart-review.googlesource.com/10400
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-04 07:52:42 +00:00
Johnni Winther 6f24e3d7db Handle static get/set in inferrer
Change-Id: I12566847ba34abfac8550a2ffd5df4a730a8644c
Reviewed-on: https://dart-review.googlesource.com/10360
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-04 07:31:27 +00:00
Harry Terkelsen 9e1bb63a2f Report invalid symbol constructor invocations
Change-Id: I03fe476639414969b831e93ed3461445cca89156
Reviewed-on: https://dart-review.googlesource.com/10801
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2017-10-03 23:43:02 +00:00
Harry Terkelsen dfb71004c7 Register seen classes as part of the impact.
This allows us to construct the class hierarchy from the impact results.

Change-Id: Id10a197eb80e60d5e25e093ffdadf8d0af092ecf
Reviewed-on: https://dart-review.googlesource.com/10208
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-03 21:36:33 +00:00
Brian Wilkerson b4d179e58a Recover from missing identifiers
Change-Id: I3c7a908449861eeed0915c4d74b10f4d1e46fde4
Reviewed-on: https://dart-review.googlesource.com/7558
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-10-03 13:41:02 +00:00
Florian Loitsch c0145281c0 Use function.name, instead of copying it into a new property.
This relands https://dart-review.googlesource.com/c/sdk/+/8221 with a small fix in the emitter.

Change-Id: I49f517c367a4f1ff3dcb942d899c84507e5f5b20
Reviewed-on: https://dart-review.googlesource.com/10100
Commit-Queue: Florian Loitsch <floitsch@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-10-03 08:29:48 +00:00
Johnni Winther dfb749b7c9 Handle try in inferrer
Change-Id: Ia58e9efcea893f9c0ba591a9b8e80ada9a27eca7
Reviewed-on: https://dart-review.googlesource.com/10080
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-03 07:54:43 +00:00
Johnni Winther 083e1e52ab Handle do/for statements in inferrer
Change-Id: I22e0e0feb3bf6f5a440a7dab95af9944040329b0
Reviewed-on: https://dart-review.googlesource.com/10020
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-03 07:46:17 +00:00
Aske Simon Christensen accddd1d97 Use error message templates for error tokens
Also fixes unicode U+ notation in error messages to use uppercase
letters for the hex code, as per the Unicode Standard conventions.

Closes https://github.com/dart-lang/sdk/issues/29985
Change-Id: I6397e03cb3e0d5eca156621bb4b19dfa643d9437
Reviewed-on: https://dart-review.googlesource.com/9320
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-02 14:23:26 +00:00
Johnni Winther 079022200d Handle while loop in inferrer
Change-Id: I203094e10442bc6ab9fb38d401643ab7c6f0c4b3
Reviewed-on: https://dart-review.googlesource.com/9280
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-02 09:20:49 +00:00
Johnni Winther 3bf733fe37 Handle simple local functions in inferrer
Change-Id: I02a264a1ddfa36442cdff30d1ab3be15dc95c2e9
Reviewed-on: https://dart-review.googlesource.com/9760
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-02 08:50:25 +00:00
Johnni Winther 3da55c7a88 Handle conditional expression in inferrer
Change-Id: Id23c2f2844c34074b187298ed0bb682e3782c53b
Reviewed-on: https://dart-review.googlesource.com/9261
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-02 08:16:36 +00:00
Johnni Winther 6b1068bbd1 Handle unary- and foreign calls
Change-Id: I88cf1e133d5c0b10815755e65ba6350f7b9cf03a
Reviewed-on: https://dart-review.googlesource.com/9200
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-02 07:57:15 +00:00
Dan Rubel 5a67a64957 Refactor parseClass
Refactored the parseClass method in preparation for
adding recovery, updating error messages, and analyzer integration.

* Added several new parser events
    - handleClassExtends
    - handleClassImplements
    - handleClassHeader

* Revised the endClassDeclaration event

Change-Id: Ib58893097650eefb45051b462e9df7260b7776b2
Reviewed-on: https://dart-review.googlesource.com/9580
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-29 19:34:15 +00:00
Johnni Winther 4b94004d4b Add tests for jsinterop errors
Change-Id: Icfa6b5a34ed56e43abb3a55eb8d48bc80eeac59f
Reviewed-on: https://dart-review.googlesource.com/9240
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-29 19:16:05 +00:00
Emily Fortuna 088989920a Fix boxing of variables in for-in and while loops.
Bug:
Change-Id: I8355f1b46a9dda03440fb8cadf1dbaf48572b41a
Reviewed-on: https://dart-review.googlesource.com/9430
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-09-29 19:11:53 +00:00
Johnni Winther d72adaf8ca Handle ordering of function types in constants.
Change-Id: If45607ff420ead098fb99e65293f517b7d003615
Reviewed-on: https://dart-review.googlesource.com/9640
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2017-09-29 15:35:34 +00:00
Dan Rubel 9527f37146 refactor parse import
* `as` clause and `deferred as` clause processing pushed
     into a new processImportPrefixOpt method.
* New handleImportPrefix event for communicating 
    `as` clause and `deferred as` clause to the listeners.
* Several new more detailed error messages for out of order
    clauses and keywords in the import directive.

Change-Id: I133842c7225403fa000ca1cf0e49af9f8a011386
Reviewed-on: https://dart-review.googlesource.com/8580
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-29 14:39:01 +00:00
Emily Fortuna b364883108 More changes to get angular app compiling.
The html status updates are unrelated, but the result of running our status update script.

Bug:
Change-Id: Ibeafda58f0bf750ebc7434c85bcf8fb08b14f590
Reviewed-on: https://dart-review.googlesource.com/8736
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-09-28 19:37:25 +00:00
Johnni Winther fd247b1539 Add ErroneousConstructorConstant
+ use source locations for fasta messages

Change-Id: I1abba76f4f5653f8d7278cb2b368ae25ce33160b
Reviewed-on: https://dart-review.googlesource.com/8840
Reviewed-by: Stephen Adams <sra@google.com>
2017-09-28 08:06:42 +00:00
Stephen Adams 56db0e80f5 Generate closure class names more like the AST version
Bug:
Change-Id: I95be2384fd67c17bc713732d902ec414e439d7af
Reviewed-on: https://dart-review.googlesource.com/9122
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-28 00:58:49 +00:00
William Hesse 0cfcea3b78 Revert "Use function.name, instead of copying it into a new property."
This reverts commit 174c37b9ed.

Reason for revert: This is failing on all the dart2js --fast-startup bots, as far as I can see. For example, https://luci-milo.appspot.com/buildbot/client.dart/dart2js-linux-jsshell-2-4-be/8417

Original change's description:
> Use function.name, instead of copying it into a new property.
> 
> Change-Id: I8004d31f65a36873f97ab607b4a81d8cc8b6a717
> Reviewed-on: https://dart-review.googlesource.com/8221
> Reviewed-by: Stephen Adams <sra@google.com>

TBR=floitsch@google.com,sra@google.com

Change-Id: Ie6d52919b6789aec9f394167256f6642c09ab275
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/8980
Reviewed-by: William Hesse <whesse@google.com>
2017-09-27 15:51:31 +00:00
Florian Loitsch 174c37b9ed Use function.name, instead of copying it into a new property.
Change-Id: I8004d31f65a36873f97ab607b4a81d8cc8b6a717
Reviewed-on: https://dart-review.googlesource.com/8221
Reviewed-by: Stephen Adams <sra@google.com>
2017-09-27 15:09:33 +00:00
Dan Rubel f0caee1b24 Improve import directive recovery and report analyzer errors
- New handleRecoverImport event
    for clauses in import directive that are out of order
- New error codes for
    Duplicate prefix
    Prefix after combinator

Change-Id: I0fea7ad4b4014a0b8578d3982e0515fe85044854
Reviewed-on: https://dart-review.googlesource.com/7980
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-27 12:56:46 +00:00
Johnni Winther 01ca690a67 Add test for break to labeled statements.
Change-Id: Ia1d7e5f93426d2781c7b3b583af10d88af142f28
Reviewed-on: https://dart-review.googlesource.com/8044
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-27 09:38:53 +00:00
Johnni Winther 7818726c3d Handle strings and maps in inferrer
Change-Id: Ic89f1f3b72dc243d239371886ff7d944153909c9
Reviewed-on: https://dart-review.googlesource.com/8040
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-27 09:07:15 +00:00
Sigmund Cherem 920d44c3d4 Include dart.io in dart2js platform
Change-Id: I7bd4356556023ff4a56d876684ea63bad1917b07
Reviewed-on: https://dart-review.googlesource.com/8341
Reviewed-by: Emily Fortuna <efortuna@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-09-27 02:06:10 +00:00
Stephen Adams 2ea83486e1 dart2js kernel: generate constants for default arguments in Function.apply
Change-Id: I5bd0a8deaf16069749a574eb2ed132738e2e0747
Reviewed-on: https://dart-review.googlesource.com/8280
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-09-27 00:35:53 +00:00
Emily Fortuna 614e4cc53f Add some fixes to getting JS-Interop compiling with angular apps.
Bug:
Change-Id: I9c5b068f33ee9cca75d95b9fb01ce19557267958
Reviewed-on: https://dart-review.googlesource.com/8400
Reviewed-by: Stephen Adams <sra@google.com>
2017-09-27 00:10:04 +00:00
Johnni Winther c0c63bf16e Fix handling of function type parameters
Closes #30826

Change-Id: I804bff2a204aa210ba59f691c5d680d8a53aadeb
Reviewed-on: https://dart-review.googlesource.com/7553
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-26 08:23:34 +00:00
Johnni Winther 9914532f05 Handle logical and/or in inferrer
Change-Id: Ia26df587b936b7b1e48018d102adb95a293c68d6
Reviewed-on: https://dart-review.googlesource.com/7860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-26 07:27:01 +00:00
Johnni Winther 772a0aff33 Handle and report erroneous compile time constants
Change-Id: I2ee86dbd714227e8e0894539ca64258fd11badfc
Reviewed-on: https://dart-review.googlesource.com/7820
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-09-22 18:57:37 +00:00
Dan Rubel 2140b878a7 cleanup parser event param
This removes the rightParen from parser events
and uses leftParen?.endGroup when needed

Change-Id: Ibc919edff4fffddc35d100453ac652eb5c5ac6e5
Reviewed-on: https://dart-review.googlesource.com/7560
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-09-22 15:50:37 +00:00
Stephen Adams aa0d5a428e Hack to fix incorrect getMightBePassedToApply under --disable-type-inference
R=sigmund@google.com

Bug:
Change-Id: Ie0378a923473e2b5ff7eaabdff499ddb01050f3e
Reviewed-on: https://dart-review.googlesource.com/7489
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-09-22 02:47:23 +00:00
Harry Terkelsen d7af5c8768 don't add invalid type expression to the stack
Change-Id: Ieb15cb79b6e319cba77ad94b5274c5b97bcea7c7
Reviewed-on: https://dart-review.googlesource.com/7585
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2017-09-21 18:12:36 +00:00
Emily Fortuna 1bf53724bb Use in correct version of CommonElements (J vs K entities) for backend.
Bug:
Change-Id: I8731624f7453d47019fbf24be4d9d6db4d5a0318
Reviewed-on: https://dart-review.googlesource.com/7488
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-09-21 17:57:26 +00:00
Johnni Winther fae35af7d6 Remove this local from factory constructors
Change-Id: I54a02e519066336aacc9e1729994225c49f856fd
Reviewed-on: https://dart-review.googlesource.com/7263
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-21 14:42:54 +00:00
Johnni Winther cffa7bc2b7 Handle if statements, is-tests and null-tests
Change-Id: Ia4fa866318b650f41ec75ff674ad233427640a4f
Reviewed-on: https://dart-review.googlesource.com/7269
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-21 11:17:26 +00:00