Remove test from dart2js matching test removed from dart2js_2

Change-Id: Ie6f862f11c12d3e3f24008cd7fb5e68274be13aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150665
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This commit is contained in:
Stephen Adams 2020-06-09 22:38:45 +00:00 committed by commit-bot@chromium.org
parent dd47387430
commit af8764eb05

View file

@ -1,32 +0,0 @@
// Copyright (c) 2013, 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.
import 'native_testing.dart';
import 'dart:_js_helper' show intTypeCheck;
bool get inComplianceMode {
try {
String a = (42 as dynamic);
} on TypeError catch (e) {
return true;
}
return false;
}
main() {
var a = [];
a.add(42);
a.add('foo');
// By calling directly [intTypeCheck] with an int, we're making the
// type inferrer infer that the parameter type of [intTypeCheck] is
// always an int, and therefore the method will be compiled to
// never throw. So when the backend actually uses the helper for
// implementing checked mode semantics (like in the check below),
// the check won't fail at runtime.
intTypeCheck(42);
if (inComplianceMode) {
int value;
Expect.throws(() => value = a[1], (e) => e is TypeError);
}
}