Files
sdk/pkg/compiler/test/codegen/data/array_add.dart
T
Joshua Litt 6604d5be1a [dart2js] Fix bug with prioritizing holders.
Change-Id: I3f7f151e54e5592716138386c962708ea7f50a38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212621
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-09-07 23:07:14 +00:00

37 lines
902 B
Dart

// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// In prod mode, List.add is lowered to Array.push.
//
// TODO(sra): Lower when type of input does not need a generic covariant check.
@pragma('dart2js:noInline')
/*spec.member: test1:function() {
var t1 = H._setArrayType([], type$.JSArray_int);
C.JSArray_methods.add$1(t1, 1);
return t1;
}*/
/*prod.member: test1:function() {
var t1 = [];
t1.push(1);
return t1;
}*/
/*canary.member: test1:function() {
var t1 = A._setArrayType([], type$.JSArray_int);
B.JSArray_methods.add$1(t1, 1);
return t1;
}*/
test1() {
return <int>[]..add(1);
}
/*spec|prod.member: main:function() {
F.test1();
}*/
/*canary.member: main:function() {
A.test1();
}*/
main() {
test1();
}