Change-Id: I9656f648fabc935868b9b38b074d866d431c5bc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256963
Commit-Queue: Mark Zhou <markzipan@google.com>
Auto-Submit: Mark Zhou <markzipan@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
I'm not sure how to test for this, but I'm guessing that we can't easily
test it until the parser is updated to parse the `const` token.
Change-Id: Iab1e2f7fd1965ebb2c29b1ef88869633a6a1b117
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256700
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This CL adds checks to ensure that the tracked total size of externally
allocated objects never exceeds the amount of memory on the system. When
the limit is exceeded, then FinalizablePersistentHandle::New() will
return nullptr.
Resolves https://github.com/dart-lang/sdk/issues/49332
TEST=ci
Change-Id: Ib6cc92325b1d5efcb2965098fa45cfecc90995e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256201
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Diagnostic codes which are not in a link do not have a diagnostics page.
Change-Id: Ifedf15e8c956e91a9c498c2496ab9fa3e65844a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256782
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
The asynchronous stream controllers were forwarding stream events
from an `addStream` stream through the same path as user-added event,
which added an extra asynchronous delay that is unnecessary for forwarding existing events.
Change-Id: I8edd1936d0d155d051d3cb8f7f82c577334d5f8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256560
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Change-Id: I2d8ae1db222fc70729fda9eeb62296285de9da33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256760
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
There should be no control characters or delimiters in method name
provided to open/openUrl methods.
Fixes https://github.com/dart-lang/sdk/issues/45744
TEST=http_open_method_validate_test
Change-Id: I0db98f2376c980a054420fb447d4f7ef9321f1a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256429
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Also updates the logic for resolving Angular Info items
Change-Id: Idb5fe1c00db04adc6dcbcf508b01bbf3f8055c2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256603
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
This change adds logic to compute whether a pattern is refutable or
irrefutable, and reports the error `` if a refutable pattern is used
in an irrefutable context.
Additionally, the methods `handleConstOrLiteralPattern` and
`handleVariablePattern` are adjusted so that they report the static
type of the matcher back to the client.
A lot of internal type analysis logic previously referred to the
static type of a pattern as its "inferred type"; this nomenclature is
corrected to match the spec.
Change-Id: Icaa1118d1da41b28bea2b4f14c47578dacd85807
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256641
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
TEST=docs only
Change-Id: I40561595ecc8075f2f50b7c3dcc32f081d8ac85b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256649
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
- Make previous behavior non-conditional
(already default and flag uses are removed)
- Use relative paths instead of package uris as module names
under --debugging-module-names flag, false by default.
(used as server paths in the browser, need to match relative
paths in source maps)
- Pass packageConfig to Javascript bundle API
- Add tests
Closes: https://github.com/dart-lang/sdk/issues/49667
Change-Id: I57c2e2629ba5dd756cce9a8ec6ae891fb092e1d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255826
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This correctly registers inferred super parameter types on the type
builder in face of erroneous case, thereby ensuring that dependent
type builders are notified.
Closes#49357
Change-Id: I2d153e9d41ada99808d0c9cba2601ccc15284379
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256663
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Weekly bot fails because of fuzz crashes on macros/scope_access which
crashes with this error:
weak suite stdout> Crashed with 'Bad state: Found 3 entries for file:///b/s/w/ir/cache/builder/sdk/pkg/front_end/testcases/macros/scope_access.dart::Class
weak suite stdout> ' when fuzz compiling.
weak suite stdout>
weak suite stdout> #0 ClosedWorldClassHierarchy.sanityChecks (package:kernel/class_hierarchy.dart:1046:21)
weak suite stdout> #1 ClosedWorldClassHierarchy.applyTreeChanges (package:kernel/class_hierarchy.dart:980:12)
weak suite stdout> #2 IncrementalCompiler._computeTransitiveClosure (package:front_end/src/fasta/incremental_compiler.dart:1759:15)
weak suite stdout> #3 IncrementalCompiler._calculateOutputLibrariesAndIssueLibraryProblems (package:front_end/src/fasta/incremental_compiler.dart:724:25)
weak suite stdout> #4 IncrementalCompiler.computeDelta.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:469:11)
As this area is in flux I've just marked them as crashing.
Change-Id: Ifb30d931c9097c04d227833722ff956619ea7b86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256662
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Support for `when` clauses requires flow analysis integration, so that
`when` clauses can promote variables, e.g.:
f(int x, String? y) {
switch (x) {
case 0 when y != null:
// y is known to be non-null here
}
}
Support for labels in switch statements had a small flaw: we weren't
reporting an error in the case where a label shared a case body with a
pattern that tried to bind a variable, e.g.:
f(int x) {
switch (x) {
L: // Error: does not mind the variable `y`
case var y:
...
}
}
Change-Id: I0b2bb4721a6b3a8f7898df682b24b75ddb6e44ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256605
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This change introduces the TypeAnalyzer methods
analyzeConstOrLiteralPattern, analyzeExpression,
analyzeInitializedVariableDeclaration, analyzeSwitchExpression,
analyzeSwitchStatement, analyzeUninitializedVariableDeclaration, and
analyzeVariablePattern. These are sufficient to analyze legacy switch
statements and legacy variable declarations, as well as switch
statements and switch expressions involving either constants or
variable patterns.
Although the code is not used in the analyzer or front end yet, it is
unit tested in isolation, and it's integrated into the existing flow
analysis unit tests.
A few minor tweaks had to be made to flow analysis to support this new
functionality. There should be no visible effect to existing analyzer
or front end behavior.
Change-Id: Ie8ec31ca92d5f2f7a7f6f6a20ca1baba3c6b28f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256604
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>