Derive whether legacy and nullable types are emitted based on the
provided sdk libraries and only enable the non-nullable experiment
when building the platform files.
The test matrix continues to enable the experiment temporarily
because test_runner currently doesn't support running with the
ReleaseX64NNBD configuration if it is not enabled in test.py
Change-Id: I7322906e928c68acab77087bcba76f06ef4bf983
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141850
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
- '_as' is now specialized on first use, like '_is'.
- '_is' specialization on `T?` that uses `T._is`
- recognize legacy versions of simple type tests (e.g. is int*)
The T? specialization makes a 2x improvement on some of the ListCopy
benchmarks on 'spec-mode' dart2js because some iterators have a T?
check.
Change-Id: I434a43de9e1322b34c3a5e11199415a75b7ed2c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140944
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Breaking change 40678 requires the constructors int.fromEnvironment and
String.fromEnvironment to get new default values for the named
parameter `defaultValue`. This CL changes usages of these constructors
such that they do not depend on the default value, such that it
becomes a non-breaking change for code in the SDK repo to perform the
change in sdk and in sdk_nnbd.
Change-Id: I82af0e1f92d6cd3618b65c0c50d754ae8c39eb0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140284
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
A NullableType can be a precise AbstactValue if the base type can be
precise.
The main effect is more lowering of field setters to HFieldSet,
(i.e. for fields with nullable types.
Change-Id: If1f92e1a79da87a73df02da3b9fc8fc3542f7b40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139326
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
We were accidentally dropping FutureOr on the `FutureOr<NullableR>*?` case. That is we had:
FutureOr<NullableR>*? => NullableR
instead of:
FutureOr<NullableR>*? => FutureOr<NullableR>
Change-Id: Idfe2748ccb03a9d4ee18b57022f9bdb7fbb55d42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140243
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
CastError is deprecated and _TypeError now implements CastError, so
it is possible to remove the distinction in generated code.
All checks now go via Rti._as(x) to some _asXXXX method.
Change-Id: I4ce6735b6c904bcbc366de92ed149716caf9ae81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139959
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
dart2js will migrate slowly to modern JavaScript.
The --legacy-javascript flag causes emitted code to be compatible with
IE11, our only supported non-modern target. This is a temporary flag
until IE11 is removed from support.
The negative flag --no-legacy-javascript allows the code to be
incompatible with legacy browsers and, over time, be improved to take
advantage of modern JavaScript features.
Initially --no-legacy-javascript will use some minimal features that
are incompatible with IE11 as a 'trip-wire' to ensure that
--legacy-javascript is always used for IE11. dart2js analytics can
then be used to assess how much --legacy-javascript is used. (The
'trip-wire' unsupported feature is unguarded use of JavaScript
Symbols.)
The default at this change is --legacy-javascript so that this change
is non-breaking. The default will be changed soon to
--no-legacy-javascript.
Change-Id: Ic13461362a5fa80293fb66b112945d1404a64a03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139867
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Turns out the invariant is not respected in practice. This is what caused hundreds of flaky failures in the old-rti bot when I added this assert.
The batchArguments include experiments whenever the first test in a shard has an experiment flag. If that happens and most other test in the same shard don't have the experiment, all those tests will appear to crash with this assertion. Because the assertion is outside the test itself, we get almost no feedback on the test logs.
TBR=fishythefish@google.com
Change-Id: I1230d79ed3cccbe388dddf19b5e8aa18c50f7329
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139566
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
There is currently a bug in the algorithm that is causing us to miss some constants in the deferred loading table. While I'm investigating, I'm defaulting missing constants to the main output unit. This should prevent downstream errors and unblock users that are hitting this.
Change-Id: I3a7eaf1f9fc98accadba2a494e249002b59eacfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139311
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Towards #40434
Towards #38875Fixes#33834
- Add a shared error message for a non-external constructor.
- Check for non-external non-factory constructors constructors in the JS interop
checks.
- Remove commented out code in Dart2JS that used to handle this check.
- Clean up skipped tests due to the missing static error. The status in
`legacy_status_dart2js.csv` has no behavior impact but is removed for
completeness.
- Add `external` to a few test cases.
- Remove unused dart2js error message.
- Add `annotating` to hardcoded spelling list.
- Ignore missing example for web specific error message.
- Switch some dart2js error expectations to GENERIC since the message is no
longer defined with other dart2js errors.
Non-external synthetic constructors are ignored for now. An upcoming change will
automatically convert these to external.
Change-Id: I3b4a042392826c528689d81c4255f5369a0a7a90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138043
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Use a JavaScript Symbol() for Array rti property. This makes the
property non-enumerable, avoiding making the property visible via
JS-interop.
The code is feature-tested so that IE11 still works with an enumerable
String property.
Bug: 40535
Change-Id: Ic8b64dac5751989fe4b8d023b0626c3db04676c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137245
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>