[tests][web-fixit] make int_modulo_arith_test aware of production mode.

The `gcd` method has a parameter of type `int`, when trusting
type annotations, we don't validate that the parameter is not
a `double`.

This change guards against this scenario and makes this test pass in
dart2js-production-linux-d8.

Change-Id: I70ab76b5b389d33c316b625ebb6188959a1ae949
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335620
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This commit is contained in:
Sigmund Cherem 2023-11-13 20:13:04 +00:00 committed by Commit Queue
parent 2cec317548
commit 8d0b898d91

View file

@ -124,7 +124,11 @@ testGcd() {
// Test that gcd of value and other (non-negative) throws.
testThrows(value, other) {
callCombos(value, other, (a, b) {
Expect.throws(() => a.gcd(b));
if (!dart2jsProductionMode || a is! int) {
Expect.throws(() => a.gcd(b));
} else {
a.gcd(b);
}
});
}