Null receiver guards (which look like "t1.toString;") are removed in more cases
where the following JS fragment would throw a TypeError on the same value.
Change-Id: I3872f00c90432077199542f4485b8e991f82fa21
Reviewed-on: https://dart-review.googlesource.com/c/89765
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Support for ConditionalExpression.
Check for potential mutations in closures.
Un-promote on assignment.
Support for 'while' statement.
Support for 'do-while' statement.
R=paulberry@google.com
Change-Id: Ic9e33a08057dc3519efec759702c52ddada728ed
Reviewed-on: https://dart-review.googlesource.com/c/89763
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
In package-split mode, bytecode generation is performed separately for
each package. Previously, dropping AST was done right after generating
bytecode. However, dropping AST for a package makes it impossible to do
constant evaluation in other packages which import the package with dropped
AST. This breaks bytecode generation for subsequent packages.
To work around this problem, in package-split mode AST is removed
temporary until dillp file is written. After that, removed AST is restored
back.
Change-Id: I3d8b6a8ad98f2fe88b57f7b6393bbbe87b046c21
Reviewed-on: https://dart-review.googlesource.com/c/89822
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Change-Id: Ib46be800dcfe3369bcc9a222d1097ae4a0efdff6
Ensure licence/attribution is included in our copy of the spec
Change-Id: I48efdb6dad5c2ba04eb18cd397fc44f678a9a7f5
Reviewed-on: https://dart-review.googlesource.com/c/89533
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
Change-Id: I1447a4250ab0e8c8fcd26a85ff5949c587a6a77f
Reviewed-on: https://dart-review.googlesource.com/c/89517
Commit-Queue: Danny Tuppeny <dantup@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
The ResponseError.data field was typed `dynamic` (as in the LSP spec) but this allows us to accidentally put non-serializable classes in it which will result in server errors when we try to send them back.
This change forces them to Strings and it's up to the code constructing the error to convert any additional data to a string first.
In order to catch this in tests, the mocks now force serialisation of all types flowing from the server to the client (this already happened for client to server).
Change-Id: I5d7f322e1a4296b1479468e36d81daebdbb4ab52
Reviewed-on: https://dart-review.googlesource.com/c/89511
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I3a1893c6ea268b4bb1518aa8f098b3524aa4f1ba
Reviewed-on: https://dart-review.googlesource.com/c/88957
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
Fasta allows some non-const static field access in constant contexts
which leads to the constant evaluator trying to evaluate them. Signal
an error instead of crashing. This will double-report errors for the
cases that Fasta already catches, and we should fix that
double-reporting.
Fix unbounded recursion in printing unevaluated constants (writeNode
called visitUnevaluatedConstant which called defaultConstant which
called writeNode...).
Fix a spurious trailing comma in printing of instance constants.
Change-Id: Idff3169a3a56432ad67c27ff9c267ef355c4c1dc
Reviewed-on: https://dart-review.googlesource.com/c/89514
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Change-Id: Ibf1ad2a77ba5d1de3ae66ca64c43fe1b22a5da0a
Reviewed-on: https://dart-review.googlesource.com/c/89513
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Instance constants don't have any of the class's static fields, so we
should not try to print them.
Change-Id: Id52bf7c25c805a21cf3a48c58efe84a720d0d2dd
Reviewed-on: https://dart-review.googlesource.com/c/89508
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Change-Id: I02a403284a2cc71cac908be4a7ec9f858cb5db47
Reviewed-on: https://dart-review.googlesource.com/c/89509
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
This is a preparation for using the collected call structures to inline
optional parameters that are never passed a call sites.
Change-Id: I9603f931967cbab53e9593dc19b29ad3ce717fa3
Reviewed-on: https://dart-review.googlesource.com/c/89549
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
* _supertypes was accidentally a multiset instead of a set, but is no
longer needed (types.tail contains the same set)
* _reporter and reportMultiInheritanceIssue is no longer needed
Change-Id: Ic8310fe79f604a280938689a92c4868d8ed24ab4
Reviewed-on: https://dart-review.googlesource.com/c/89520
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Instead of simply printing a message, properly signal a Fasta problem for
constant errors. This causes 68 tests (presumably missing compile-time
errors) to start passing with --enable-experiment=constant-update-2018.
Change-Id: Ia9f1809305bbef7b4652ce49acf6fb9c18408207
Reviewed-on: https://dart-review.googlesource.com/c/89580
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
In CL https://dart-review.googlesource.com/c/sdk/+/89441 I added
assertions to check the elementUri for completion suggestions.
However, in the case of a file elementUri as in
local_reference_contributor_test.dart, we need to normalize the
file path for other operating systems (eg windows).
R=brianwilkerson@google.com
Change-Id: I88436fc3cf93aad98f072b4cd75d66217a3faabd
Reviewed-on: https://dart-review.googlesource.com/c/89761
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Ari Aye <ariaye@google.com>
Tests marked with the "new test" comment would not pass without the
unified specification, i.e. with type promotion implementation that
currently works in analyzer, or definite assignment analysis that I
implemented earlier.
R=brianwilkerson@google.com, paulberry@google.com
Change-Id: I9ba6fde991567e9a2761a7606af28ca1e260de54
Reviewed-on: https://dart-review.googlesource.com/c/89260
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Change-Id: Ibd8c23f691a68f5bea5964b10029b5d7bca53b38
Reviewed-on: https://dart-review.googlesource.com/c/89721
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I3fa03de568f72bfc3adb46efcfa2b61b781c706b
Reviewed-on: https://dart-review.googlesource.com/c/89020
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
This CL is a follow-up to https://dart-review.googlesource.com/c/sdk/+/88428
which added a new, optional elementUri to the CompletionSuggestion type
in analysis server protocol. Here, we're aiming to set the elementUri
whenever we have that information readily available.
R=brianwilkerson@google.com
Change-Id: I6dcf8a4029928432a80fc02ed97ee614eb75d986
Reviewed-on: https://dart-review.googlesource.com/c/89441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Ari Aye <ariaye@google.com>
- Fixed HTML API's with callback typedef to correctly convert Dart function to JS function.
- Expose HttpStatus from dart:html
- Expose DomName ondblclick and dblclickEvent for Angular analyzer.
- Fixed removeAll should be Iterable<Object> to match Set's removeAll not Iterable<E>.
- Fixed a number of DataTransferItem, Entry, FileEntry and DiretoryEntry returning NativeJavaScriptObject needed type registered in DDC.
- Added ability to allow local file access from Chrome browser added -local in ddb.
R=vsm@google.comFixes#30278Fixes#35484Fixes#34318Fixes#35510
Change-Id: Ide8c04716c54045e837781d489562f27b694b109
Reviewed-on: https://dart-review.googlesource.com/c/89340
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
The README was missing some methods (recent additions?) and also not quite in the same order - this fixes that. Also re-generates the classes based on current spec (mostly comments updates, but also non-nullability for `targetSelectionRange`.
Change-Id: I0dd4e24daf51b659783058362339550ec46fa1c8
Reviewed-on: https://dart-review.googlesource.com/c/89641
Commit-Queue: Danny Tuppeny <dantup@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This CL updates the dartfix NNBD implementation to skip types
in extends, implements, on, and with clauses
in addition to addressing comments in
https://dart-review.googlesource.com/c/sdk/+/89046
Change-Id: Ifa491ac3ffd2b2ef24b1e649c1355df65adefc13
Reviewed-on: https://dart-review.googlesource.com/c/89403
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Change-Id: I7966f2211104b54bfa4f2b026ad8a706d3f2bd6c
Reviewed-on: https://dart-review.googlesource.com/c/88956
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
Notice that no conflict is reported when an inherited
setter is in conflict with an inherited member. This is
implemented in a later CL.
Before we would only use InheritedMembersConflict when merging
interfaces, but as the new test cases demonstrate, that's not
sufficient.
Change-Id: I690dde1b59499d3ee0967b3f118b0b3b58898442
Reviewed-on: https://dart-review.googlesource.com/c/88941
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Make the constant evaluator take an explicit error reporter so we have
to opt in to using the "simple" one that reports errors in an ad hoc
way. This is the start of a change to use Fasta-controlled error
messages throughout and eventually get rid of the simple error
handler, and to continue constant evaluation after the first constant
error.
Change-Id: If6b1801edab6063754b642cf4a603abf9d63103a
Reviewed-on: https://dart-review.googlesource.com/c/89501
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>