Replace
var element = JS('', '#[#]', this, i);
with
var element = JS<E>('', '#[#]', this, i);
to ensure 'element' has the static type E.
I would prefer
E element = JS('', '#[#]', this, i);
but that makes legacy checked mode insert unneeded type assertions.
Change-Id: I74446ca7bfa748490347100093a94b9191ca6821
Reviewed-on: https://dart-review.googlesource.com/50860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Type arguments that require a subsitution need the interceptor to
access the substitution function.
- Add an interceptor input to HTypeInfoReadVariable
- Add an entry point getRuntimeTypeArgumentIntercepted that takes the interceptor.
- Optimize uses that do not need the interceptor.
The interceptor is cheap to get from the context in the common case
that the type variable access is directly in an instance method.
A typical use (broken)
var t1 = H.getRuntimeTypeArgument(receiver, "ListMixin", 0);
becomes
var t1 = H.getRuntimeTypeArgumentIntercepted(this, receiver, "ListMixin", 0);
Change-Id: I2abe6a2b6e8d2cdb0ede1b7248dd8337830f8a0c
Reviewed-on: https://dart-review.googlesource.com/50640
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Optimisitically always wrapped the `compare` argument, even if it was `null`.
Change-Id: I811affad97edc9e98af07abd323a25478e45a392
Reviewed-on: https://dart-review.googlesource.com/50724
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
- Add a type argument count to JSInvocationMirror.
- Change stubs to pass the argument count.
Change-Id: I448dbee9a2aa0be17c24ae79eae0c89e7574fa7c
Reviewed-on: https://dart-review.googlesource.com/49820
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
R=sra@google.com,sigmund@google.com
Change-Id: I2f5ccae15bcd993ab1e15ab556a25d6e0cd1d450
Reviewed-on: https://dart-review.googlesource.com/50504
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
"=Object" was inacurate and contradicted the inferred type <Function> in strong mode.
Change-Id: Ibee4351357dde4aaacf95ff7265cd335fc5d06ea
Reviewed-on: https://dart-review.googlesource.com/49832
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Fixes errors in RegExp and String.fromCharCodes.
TBR=sigmund@google.com
Change-Id: I7f84d2b9ee2dfead6d0cf634e36c06b9071bf991
Reviewed-on: https://dart-review.googlesource.com/49981
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Avoids issues where they are lazily created in a different current zone and that zone messes with, for example, schedule microtask, which the future uses to schedule invocations of its callbacks.
Change-Id: I6697ca469426472523089fcf7ca44312b9c6ff5f
Reviewed-on: https://dart-review.googlesource.com/49509
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
Also remove mentions in documentation.
Change-Id: I51ad3137fff505168acde7f2e21bebc42a49da3b
Reviewed-on: https://dart-review.googlesource.com/49721
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
The trick of detecting isIntercepted from the number of arguments does
not work with function type arguments. We fixed this in other places,
now fix it in the full emitter.
Change-Id: I35fcda11db1df0e7442b66317c9ea20674514722
Reviewed-on: https://dart-review.googlesource.com/48922
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
This disables most runtime features of dart:isolate, similar to dart:io.
For now, this supports `new ReceivePort()` and `ReceivePort.close` as
those are used by async tests to keep the Dart VM alive. Those are
no-ops in DDC. Also removes most of dart:_isolate_helper, except for
the JS API that's used to bootstrap DDC `main()`.
Change-Id: I84eab6cd39d05a70a6afe982e952076ddaaa8c0f
Reviewed-on: https://dart-review.googlesource.com/45754
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
This is so we correctly answer `const bool.fromEnvironment("dart.library.js")`
as true when --categories=Server is passed to the compiler.
Change-Id: Id12a0af65905fabc23ef5a1cd3e5fd837bc8b766
Reviewed-on: https://dart-review.googlesource.com/48265
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Change-Id: Ic8172f4574a35ac31910ac0d5934c0d63db40a23
Reviewed-on: https://dart-review.googlesource.com/48060
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
This uses the environment_overrides section that I'm adding to the libraries
specification files.
Change-Id: I95c175533f21320dd44eab9988afe2644ed0c9d3
Reviewed-on: https://dart-review.googlesource.com/47406
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
This change is needed to be able to introduce a new platform "dart2js_server"
that represents compiling to dart2js for non-browser targets (like nodejs). Some
users (like Dart Sass) depend on this feature.
The old front-end made this work by using "--categories=all", this change should
make it possible to compile with "--categories=Server".
Change-Id: I41bf25ab19016154206c419a48884bdc4afbd444
Reviewed-on: https://dart-review.googlesource.com/47700
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Long ago I accidentally only made the change to _cfe.dart in the .json file and
not in the .yaml file (which is technically the source of truth).
Change-Id: I0e8abdc84b9b0f20019c712246493979debaf1cd
Reviewed-on: https://dart-review.googlesource.com/47323
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Add tests.
Change-Id: If27b6c987c944ebb84d43acde012f5b44730c4e7
Reviewed-on: https://dart-review.googlesource.com/45501
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Fix all deprecation warnings in the kernel and vm packages.
Change-Id: I44e5b128cc8fbc1360ad4c49ecdf2aa7cfd269d8
Reviewed-on: https://dart-review.googlesource.com/46720
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
This reverts commit 60a2cfa219.
Change-Id: I6d83653c72d5e8576952a631d23be5be5d9c71f6
Reviewed-on: https://dart-review.googlesource.com/46384
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Fixes#32464
BUG: http://dartbug.com/32464
Change-Id: I1462452c3f6a7838aeaaa84e3fb0e092a3f85338
Reviewed-on: https://dart-review.googlesource.com/45704
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Change-Id: Ic9a180cbb758cf8fe51369d904fa4b51fd1b8e27
Reviewed-on: https://dart-review.googlesource.com/44480
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>