DescriptionAvoid modifying the set returned by getInterceptorsOn()
The returned set is shared.
This program generates a broken short-circuit interceptor ($n -> $din) due to modifying the cached shared set {n} to {d,i,n}
--------
J.toInt$0$n = function(receiver) {
return J.getInterceptor$din(receiver).toInt$0(receiver);
};
--------
import 'package:expect/expect.dart';
@NoInline()
@AssumeDynamic()
confuse(x) => x;
@NoInline()
foo(x) {
print(x.toInt());
bar(x);
}
@NoInline()
bar(x) {
print(x.toInt());
print(x.runtimeType);
}
main() {
int i = confuse(1);
foo(i);
double d = confuse(2.3);
foo(d);
}
--------
TBR=sigmund@google.com
Committed: https://github.com/dart-lang/sdk/commit/36f52dd43f1111cbc5b51796ab51d8136bac6b9f
Patch Set 1 #
Messages
Total messages: 7 (4 generated)
|