This does not include enabling the FFI on Fuchsia. So these tests will
fail without the dependent CL.
This CL adds an `all_positive.dart` test file to be packaged in the
.far file, such that it is easier to run all FFI tests in one go.
We don't run tests on the bots, but we do build this test package on
the bots.
To build the .far files locally:
```
tools/build.py --os=fuchsia -m debug fuchsia_ffi_test_package
tools/build.py --os=fuchsia -m debug -a arm64 fuchsia_ffi_test_package
```
Issue: https://github.com/dart-lang/sdk/issues/44434
Change-Id: Iec418e0c10d77afbf811fb83151664bcc2710b99
Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175484
Reviewed-by: Liam Appelbe <liama@google.com>
UnmodifiableSetView does not have backend specific implementations
(simillar to UnmodifiableMapView, unlike UnmodifiableListView).
Closes https://github.com/dart-lang/sdk/issues/36901
Change-Id: I041bb6dc95d6a67a395ca75581ffe8e5933acdc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164103
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Changes 'is' checks for JS types such that it no longer does an
instance of check and instead only checks to see if the object
in question is a JS object or appropriate subtype. This means that
any two @JS objects will pass an is check and therefore can be
casted as one another. This makes it consistent with expected
behavior and dart2js.
Also amends the README to reflect the unified behavior.
Change-Id: I11aa105d6cafbbafde482b27dcc1182c0960cce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173140
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
js_mock_test currently tests mocks on native types by defining
the native types using JS interop. This is error-prone, as the
underlying native type has different type semantics than JS
interop types. Also moves these tests to lib/js and adds some
additional checks.
Change-Id: If4bba54d589a38d7f7fbf1c26c6c6f755ec6b9ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173361
Reviewed-by: Nicholas Shahan <nshahan@google.com>
* Add `/*late final*/ hints for fields which are manually lazily
initialized in a public getter.
* Switch List(size) constructor with [] list literal.
* Force a few non-nullable types.
* Remove `null` assignments in embedder_tests.dart which change type of
fields.
* Remove `null` Tokens in tests where null should not be.
Change-Id: I260657d222f6b8ca10e31d06991dc9e2cb575e5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171140
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
In a big app there are a few hundred closures with names like 'closure321'.
These come from the initializer expressions of top-level variables.
Add the field name to these so the are a little more stable.
This is just for unminified closure class names and has no effect on
minified names.
Change-Id: I3fef4a950ef372cd9b53f984540f6197dd2a2f64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175581
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Also sort test file.
Change-Id: Id8133d699ae1a71d1852ef29ce1f843c7ede98cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175561
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This test was broken since Dart 2.0.
It may be worth checking whether this provides any additional value to tests
available under the language suite.
Change-Id: I7c7c893d314041c4400c38e9293a4e5eda3cc072
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175007
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Hopefully this will avoid bugs in the future if the lowering of
late variables changes.
This does not change the current optimization for late variables
with list literal initializers. That lowering introduces a final
variable that is not marked as late that appears as the receiver
in this logic.
Change-Id: Ib99d0987b166d3f38b60d0dce3fedb166d772e64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175444
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Checks that the null safety mode of every module loaded matches the mode
of the SDK.
This relands https://dart-review.googlesource.com/c/sdk/+/173120 with
additional fix to correctly set the mode of a new component created
in the frontend_server.
Change-Id: I855b226f724ce0b6c83dbdc11ff6113853892dbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174881
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Related issue: https://github.com/dart-lang/sdk/issues/44435
TEST=Unfortunately we have no tests set up for shadow call stack.
Change-Id: Ibea3662ba2ef563702288b7a52f816df3217aa41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175367
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
According to the specification:
Otherwise, it is a compile-time error if R
denotes a generative constructor and D is abstract.
Not sure why we have these constructors at al.
Change-Id: I0ec671245c9b482c6455f7f5725b83db63b3c9db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175361
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
+ emit only one message per method given that it now always has the
same root cause, namely that the combined member signature does not
exist.
Closes#31797
Change-Id: Id89a5557c5fdda1db087c20cbe92847dd08216a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175305
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This is a reland of fd2a6c6815
Original change's description:
> Flow analysis: Track expression variables separately from promotion info.
>
> Previously, we used a single class hierarchy, ExpressionInfo, to store
> all the information that flow analysis needs to know about a variable,
> including:
>
> 1. What is known about the program state if the expression evaluates
> to true/false
>
> 2. Whether the expression is a `null` literal
>
> 3. Whether the expression is a reference to a variable.
>
> However, in order to address
> https://github.com/dart-lang/language/issues/1274 (Infer
> non-nullability from local boolean variables), we'll need #3 to be
> tracked orthogonally from #1, so that when a local boolean is referred
> to later, we can track information of type #1 and #3 simultaneously.
>
> However, it makes sense to keep #1 and #2 in the same data structure,
> because future work is planned to represent them in a more uniform
> way, as part of addressing
> https://github.com/dart-lang/language/issues/1224 (Using `if (foo?.bar
> == somethingNotNull)` should promote `foo`).
>
> Change-Id: I432f6e2e80543bb1d565b49403180c520eef66a5
> Bug: https://github.com/dart-lang/language/issues/1274
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175008
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>
Bug: https://github.com/dart-lang/language/issues/1274
Change-Id: I002adbde782887def50dc80ab6673411b321c341
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175362
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This removes our temporary scaffolding support for JIT isolate groups
(which was implemented by creating a new isolate group, loading the
application kernel into it and then merging the heap into the original
isolate group - maintaining a different object store)
It makes all isolates within a group share the same object store, same
libraries and JITed code. It will be conservative to start with, only
allow running unoptimized code, etc.
We will gradually remove the restrictions imposed by this CL:
https://dart-review.googlesource.com/c/sdk/+/173970
Issue https://github.com/dart-lang/sdk/issues/36097
TEST=Tests using --enable-isolate-groups with JIT sharing.
Change-Id: I2bf69a6fe3c905067c4cec2e81613f731c52e5ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175302
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This introduces a way to see what paths have been searched for by
the `BazelWorkspace` and adds a polling-based watcher to detect
when files generated by Bazel appear (or have changed). This allows
us to re-analyze things automatically instead of, e.g., restarting
the server.
Change-Id: I60eae29b0e4fcc3a91d8d2275c6898e45548ea03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168649
Commit-Queue: Michal Terepeta <michalt@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Fixes a test for compatibility with google3.
Change-Id: Id85c531b6768b6a59f2f63e991de96dd92ab3232
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175446
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
Before Null Safety, `_EventStreamSubscription.cancel()` used a trick
to run with synchronous timing even though it was typed to return a
`Future`. During the migration of the SDK to support Null Safety it
kept the synchronous timing in weak mode, but was changed to
asynchronous in sound mode so that the behavior matched the method
signature. In hindsight, changing the timing when opting into Null
Safety is problematic:
* A shared package has no control over what mode it runs in. Libraries
may be opted in and run their tests with sound null safety but the
apps they are used in could still be running in weak mode. This
results in library unit tests that behave differently than the
production app that deploys the code.
* This codepath can be triggered by EventTarget.dispatchEvent() from
dart:html which should have synchronous timings for the event
listeners before returning to the calling code. The asynchronous
timing when running with sound null safety is inconsistent with the
browser API.
This change reverses that migration decision and keeps the synchronous
timing in both modes. To support this in sound mode it returns a
special future value that is internal to the SDK and known to be used
for synchronous timing.
This change also removes the workaround introduced in DDC to avoid
warning/failing when `_EventStreamSubscription.cancel()` returned
null and the extra warnings/errors features were enabled in weak
null safety mode.
Change-Id: I6b08a2ada5b10120bea787ad59d1d58e6e181de5
Fixes: https://github.com/dart-lang/sdk/issues/44157
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175323
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Removes API migration from the description and ensures the disclaimer appears when run in a help context.
Sample output:
```
$ dart bin/dartdev.dart fix
Fix Dart source code.
This tool looks for and fixes analysis issues that have associated automated fixes.
To use the tool, run either 'dart fix --dry-run' for a preview of the proposed changes for a project, or
'dart fix --apply' to apply the changes.
Note: The `fix` command is provisional and subject to change or removal in future releases. Feedback is
welcome!
Usage: dart fix [arguments]
-h, --help Print this usage information.
-n, --dry-run Preview the proposed changes but make no changes.
--apply Apply the proposed changes.
Run "dart help" to see global options.
$ dart bin/dartdev.dart fix -n
Note: The `fix` command is provisional and subject to change or removal in future releases. Feedback is welcome!
Computing fixes in dartdev (dry run)... 15.2s
Nothing to fix!
$ dart bin/dartdev.dart fix --help
Fix Dart source code.
This tool looks for and fixes analysis issues that have associated automated fixes.
To use the tool, run either 'dart fix --dry-run' for a preview of the proposed changes for a project, or
'dart fix --apply' to apply the changes.
Note: The `fix` command is provisional and subject to change or removal in future releases. Feedback is
welcome!
Usage: dart fix [arguments]
-h, --help Print this usage information.
-n, --dry-run Preview the proposed changes but make no changes.
--apply Apply the proposed changes.
Run "dart help" to see global options.
```
Change-Id: I2fc03651d8a1605a9729bb4d62e382f533509d99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175343
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>