Commit Graph

4698 Commits

Author SHA1 Message Date
Johnni Winther 81a81c93eb Handle instance field initialization in inferrer
This normalizes `var field = null;` and `var field;` to `var field;` for
both the AST- and IR-based inferences.

Change-Id: I753637c130a9f44ed01d18946c234353048f8971
Reviewed-on: https://dart-review.googlesource.com/6480
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-21 08:46:22 +00:00
Emily Fortuna ac98f741d5 Make JRecordFields not instance members (they were falsely categorized as such because the boxes were "classes").
Bug:
Change-Id: I5ea7ab26e5bb7c52a59b4f81b1489190b2d00fd0
Reviewed-on: https://dart-review.googlesource.com/7220
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-20 19:26:08 +00:00
Florian Loitsch 38bf70d7ac Use generic functions in zones.
Migrated from https://chromiumcodereview.appspot.com/2893893002/

Change-Id: I0bd6dc1438eb1e6762e7760a08b5a760b07d4b10
Reviewed-on: https://dart-review.googlesource.com/4942
Reviewed-by: Florian Loitsch <floitsch@google.com>
Commit-Queue: Florian Loitsch <floitsch@google.com>
2017-09-20 15:46:06 +00:00
Stephen Adams 617f6ac197 Weaken constructor initializer assertion
Accept a missing super-constructor call if one of the constructor
initializers always throws.  This matches dynamic error code generated
for various warnings, including duplicate final initializers.

Change-Id: If188c9d8d6d02bf9667123fbf679f1c103b5ef5a
Reviewed-on: https://dart-review.googlesource.com/7240
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-20 02:18:21 +00:00
Emily Fortuna 9a531f9b50 Get async/await working with the entity model.
Bug:
Change-Id: I803cb8f8a681563d76d6eed56116267f64a9ba8a
Reviewed-on: https://dart-review.googlesource.com/7106
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-19 22:29:34 +00:00
Emily Fortuna 5402179bd4 Properly pass on this as a free variable when inside closures.
Bug:
Change-Id: Iba32dbc40e9361030a885b50a9e816c0ac123884
Reviewed-on: https://dart-review.googlesource.com/7102
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-19 20:16:45 +00:00
Brian Wilkerson bd33fb43bd Pass the left brace in an enum declaration to the listeners (rather than the right brace)
Change-Id: I3bec6cbde6beb1233c48e7ed8926f0e98fd8e3a5
Reviewed-on: https://dart-review.googlesource.com/6741
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-09-19 15:35:33 +00:00
Johnni Winther 639ddd3067 Pass rti info for local functions to the closure converter
Change-Id: I593ad134a16ee10b43b50213db9774e7c2671f22
Reviewed-on: https://dart-review.googlesource.com/6600
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-19 12:00:03 +00:00
Johnni Winther f9a490128e Compute closure classes before creating JsClosedWorld.
Change-Id: I28f0188d2f6b669c1bbc77c3050c0d90230ccdf1
Reviewed-on: https://dart-review.googlesource.com/5768
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-19 09:03:54 +00:00
Johnni Winther 5cad3ee498 Avoid continue in switch
Change-Id: Ibe6a89916efc133ef8234d0c73bbf091a103d6b4
Reviewed-on: https://dart-review.googlesource.com/6440
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-19 06:30:46 +00:00
Stephen Adams eab4615f74 Add missing abstract method to interface
Fixes analyzer warning.

Bug:
Change-Id: I404855f42190be10a11658cf8f144c2627b73117
Reviewed-on: https://dart-review.googlesource.com/6820
Reviewed-by: Stephen Adams <sra@google.com>
2017-09-19 03:35:59 +00:00
Stephen Adams f115e1926f Make DirectPropertyGet a compile time crash rather than a runtime crash
These are infrequent, so can be better tracked as a compile-time issue.

Change-Id: I79a25c3cad1e7b003244cc5baa1a8a788586a0af
Reviewed-on: https://dart-review.googlesource.com/6761
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-19 00:25:12 +00:00
Emily Fortuna 942963fa2e Add TypeVariable analysis in closure conversion.
Bug:
Change-Id: I4155ceb042295934cc3c9125d275dc5f034675dd
Reviewed-on: https://dart-review.googlesource.com/6025
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-09-18 20:26:33 +00:00
Harry Terkelsen b49dd9fe98 register SUPER_NO_SUCH_METHOD feature when appropriate
Change-Id: If620aa0bb051d8bd014070e0a2c3e4c525dc6729
Reviewed-on: https://dart-review.googlesource.com/6643
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2017-09-18 19:54:12 +00:00
Brian Wilkerson 0995bbd6ef Pass the left paren in to listeners
Change-Id: I7de73b11c001f56fd45f60f58623c905b5a29f31
Reviewed-on: https://dart-review.googlesource.com/5325
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-09-18 16:34:26 +00:00
Stephen Adams 69b50ed990 dart2js-kernel: Fix bug with finding optional parameter default values
Change-Id: Iefa443318124838aeafa9998e08d1143c1976dc4
Reviewed-on: https://dart-review.googlesource.com/6346
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-15 23:54:22 +00:00
Stephen Adams dccce129e4 dart2js-kernel: Don't crash on non-constant constants
Change-Id: I7919ccdcd72f6653d2baa3c25c5d18df982ccda4
Reviewed-on: https://dart-review.googlesource.com/5941
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-09-15 21:44:24 +00:00
Harry Terkelsen 3a25ead178 Generate super.noSuchMethod if super call is malformed
This doesn't fix all of the errors with 
'Error: ".function" called on null' stacktraces. 

Change-Id: I7ddc0405db7e2f028eb27028c854dab29a0adf16
Reviewed-on: https://dart-review.googlesource.com/5522
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2017-09-15 20:03:51 +00:00
Johnni Winther bc1f9f4d45 Handle factory constructor calls in inferrer
Change-Id: I04f0cbd760a1ba6bc93ca23a826946a547d9d543
Reviewed-on: https://dart-review.googlesource.com/5763
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2017-09-15 18:14:39 +00:00
Brian Wilkerson b30fab9320 Pass the of keyword in part-of directives to listeners
Change-Id: I0774f6ee806aff52981bc2f049ef402f4f52c102
Reviewed-on: https://dart-review.googlesource.com/5340
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-09-15 15:54:43 +00:00
Dan Rubel db7129d8a4 cleanup endMetadataStar event
Change-Id: I9fcd69219858cdb063d3e37f2788750f72132d65
Reviewed-on: https://dart-review.googlesource.com/6140
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-09-15 12:37:37 +00:00
Johnni Winther a7f3d53e7e Use --use-kernel in closed_world2_test
Change-Id: I5b94b7b208c993afcd325d69c9a19a83e8960364
Reviewed-on: https://dart-review.googlesource.com/5440
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-15 09:53:36 +00:00
Johnni Winther 30fb709226 Update impact_test to use --use-kernel
Second attempt

Change-Id: Iec21e5c875e56d972fdea2e15b310ee7dc2eea38
Reviewed-on: https://dart-review.googlesource.com/5400
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-15 08:52:07 +00:00
Johnni Winther 5c057e7ca4 Refactor handling of type variable access.
Change-Id: I41a796346979fb060f717ab38f7ca1a47f6b2d80
Reviewed-on: https://dart-review.googlesource.com/5740
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-15 08:27:26 +00:00
Johnni Winther 5fc6698b8a Handle parameters in inferrer.
Change-Id: Icec402d7f226e3a39fd64671b86623d7d9d35ffe
Reviewed-on: https://dart-review.googlesource.com/5800
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-15 07:53:25 +00:00
Emily Fortuna 83f5b64ea1 When accessing "super" properties, capture "this".
Bug:
Change-Id: I770aed67e2e4d078feba7d04662029e9a0a454fc
Reviewed-on: https://dart-review.googlesource.com/5601
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-14 17:37:07 +00:00
Dan Rubel d69a0aa3d5 revise parser to use handleNativeClause
modify the fasta parser to use handleNativeClause
when parsing methods with a native clause.

Change-Id: Ia631c471f9f8ea7a9e261d112a8ccd96f9eafa46
Reviewed-on: https://dart-review.googlesource.com/3786
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-14 13:25:48 +00:00
Johnni Winther 5aa3259698 Handle break to labeled statement
No tests yet. Kernel doesn't support file-offsets on labeled statement.

Change-Id: I5dcfcc21433aec5ad0be26bfef5bbca0b609ba35
Reviewed-on: https://dart-review.googlesource.com/5161
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-14 08:59:11 +00:00
Johnni Winther 2acf735159 Remove Local.memberContext and Local.executableContext
Change-Id: Icd1ff9ac06fb218731c618c5fc87e4d69bb47e77
Reviewed-on: https://dart-review.googlesource.com/5240
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-14 08:14:15 +00:00
Stephen Adams 45d6ed8a01 Allow 'lookup' of native classes declared in dart2js_native and dart2js_extra tests'
R=johnniwinther@google.com

Change-Id: I510fd1f76c5369fdf37b833ccce10dc788810099
Reviewed-on: https://dart-review.googlesource.com/5640
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-14 03:59:00 +00:00
Stephen Adams 26d220445c dart2js-kernel: Handle type variables with names like '#U0'
R=sigmund@google.com

Bug:
Change-Id: I91972d7b0324e0ba7f4969529e203da40923ad55
Reviewed-on: https://dart-review.googlesource.com/5580
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-13 23:18:21 +00:00
Harry Terkelsen c0edd4ee0e ensure type arguments for instantiations are in the class hierarchy
Change-Id: Ife2da89018278fa5e5a9b940f7052006f2f7f841
Reviewed-on: https://dart-review.googlesource.com/5485
Commit-Queue: Harry Terkelsen <het@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-09-13 18:55:48 +00:00
Stephen Adams 5ab592a3b5 Compute field initializers in correct order with respect to type parameters and other initializers
Change-Id: I253515188d4428de88bcca4799dac6204d3e7329
Reviewed-on: https://dart-review.googlesource.com/5299
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-13 02:16:32 +00:00
Harry Terkelsen b7666dd327 dart2js: Remove lookup map support
Change-Id: Id435dc0f54165285c0d291d2e1c984da92bfd22a
Reviewed-on: https://dart-review.googlesource.com/5284
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2017-09-12 20:16:12 +00:00
Brian Wilkerson bb915a394c Pass the comma in a catch clause to listeners
Change-Id: I33173614c22a9132f850750a441f443b539ed666
Reviewed-on: https://dart-review.googlesource.com/4980
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-09-12 18:46:20 +00:00
Emily Fortuna 50d35a9e23 Provide access to the context in which this closure originally existed.
Bug:
Change-Id: Iebed156ffdcc54968397c230b41a8b12f828e1ec
Reviewed-on: https://dart-review.googlesource.com/5100
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-09-12 18:27:21 +00:00
Brian Wilkerson 8f6f4d9d24 Pass the parens in conditional uris to listeners
Change-Id: I1cf41c32ae60ba1c0e8389a583d9188ad4f9ba89
Reviewed-on: https://dart-review.googlesource.com/5003
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-09-12 16:49:38 +00:00
Johnni Winther abd20df0f8 Revert "Update impact_test to use --use-kernel"
This reverts commit 7222ff6136.

Change-Id: I2c419961230f1d7e240fc6dbb892fa8e43cb6896
Reviewed-on: https://dart-review.googlesource.com/5201
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-09-12 12:13:10 +00:00
Johnni Winther 7222ff6136 Update impact_test to use --use-kernel
Change-Id: Ib4e40783602a1ec821584aa7f4724a92387c6b0b
Reviewed-on: https://dart-review.googlesource.com/3940
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-12 11:20:06 +00:00
Johnni Winther 31fc92f886 Remove LocalsHandler.contextClass
Change-Id: I006a9a442e9871c2b60b72a8453333046cd84578
Reviewed-on: https://dart-review.googlesource.com/4742
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-09-12 10:24:02 +00:00
Johnni Winther 80e795fe0c Handle for-in in inferrer
- includes static calls and simple new expressions.

Change-Id: I5c26cc1a3fa311c5f11f6e84c4e6ff5f748ca64d
Reviewed-on: https://dart-review.googlesource.com/4780
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-12 07:32:48 +00:00
Emily Fortuna 553e4a0967 Don't make field entities for variables in boxes.
Bug:
Change-Id: Ie31e88438da93a1d54c8c688a5ccd212bb81bb28
Reviewed-on: https://dart-review.googlesource.com/4241
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-09-11 23:32:51 +00:00
Johnni Winther 54b57079a3 Handle used postfix and (used) prefix in inferrer
Change-Id: Ia8befd70a937aeb4a8f0f32f98b28f0e6ec39f73
Reviewed-on: https://dart-review.googlesource.com/3886
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-11 07:57:15 +00:00
Harry Terkelsen d1a34a2c7f add type variables for all classes in the hierarchy for a constructor
Change-Id: I4c8df08e5893297c0d662bec469c8e06992369cf
Reviewed-on: https://dart-review.googlesource.com/4605
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-08 23:19:20 +00:00
Paul Berry 16d505327b Rename handleBinary{Operator,Expression} to {begin,end}BinaryExpression.
This makes the names more consistent with the other parser listener
methods.

Change-Id: Ic9f636a520bcc40e0ed281963ff079d4ce0202db
Reviewed-on: https://dart-review.googlesource.com/4120
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-09-08 18:03:51 +00:00
Johnni Winther 35733a265f Split cached SourceFileProvider input into utf8 and binary
This (re-)enables the [autoReadFromFile] functionality when using
--use-kernel by allowing to read source files when these have already
been read as binary.

The fasta front-end pulls input as binary meaning that the diagnostics 
handler doesn't know how to print source locations. Splitting the cache
allows us to fetch the source as string when needed for diagnostics.

Change-Id: Ib3bea2fb999be10f86e82ea623ee24a5c1ad9bf4
Reviewed-on: https://dart-review.googlesource.com/3880
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-08 08:41:32 +00:00
Harry Terkelsen 607e3ecd69 Fixed the test by checking if typedefs are malformed.
This prevents the getFunctionTypeOfTypedef call from failing in
checked mode by returning a MalformedType.

Revert "Revert "Add types referenced in is-checks to the class hierarchy""

This reverts commit e0a4839c3e.

Change-Id: I1e94ba5ba345c36e04e54da6e8c0580a21836838
Reviewed-on: https://dart-review.googlesource.com/3422
Reviewed-by: Harry Terkelsen <het@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-07 19:56:26 +00:00
Emily Fortuna 4e9524b516 Fix Dart analyzer error with change in https://github.com/dart-lang/sdk/commit/d7e28e386d7a05e092f75da42b1ab9eb4c7ee9e9
Bug:
Change-Id: Ia584d16b4c760d1b17b2a08dd54b6ff8b97f020e
Reviewed-on: https://dart-review.googlesource.com/4101
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-07 18:30:04 +00:00
Emily Fortuna d7e28e386d Make constructor entities and constructor body entities share the same locals map lookup.
Bug:
Change-Id: Icdd1bfe64aaa0e2362d71f005a1037d1ab947402
Reviewed-on: https://dart-review.googlesource.com/3425
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-09-07 18:10:35 +00:00
Dan Rubel 6cfee12257 remove duplicate dart2js external method check
This removes an error generated by the front-end that is already
reported by dart2js and fixes a failing test.

Change-Id: I8082cab9546b962a0b3d4011044fe224867e7613
Reviewed-on: https://dart-review.googlesource.com/3960
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-09-07 13:24:45 +00:00