Skip to content

Commit 93c2900

Browse files
rakudramacommit-bot@chromium.org
authored andcommitted
[benchmark] Make BigIntPrintParse be NNBD-agnostic
Change-Id: I6e93972bf904cbf09316517798a43116ee7fa61a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141027 Commit-Queue: Stephen Adams <[email protected]> Reviewed-by: Jonas Termansen <[email protected]>
1 parent 12e81d3 commit 93c2900

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

benchmarks/BigIntParsePrint/dart/native_version_dummy.dart

+12-14
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,21 @@ class _DummyMethods implements NativeBigIntMethods {
1111

1212
bool get enabled => false;
1313

14-
static Object bad(String message) {
15-
throw UnimplementedError(message);
16-
}
14+
static Object bad(String message) => UnimplementedError(message);
1715

18-
Object parse(String string) => bad('parse');
19-
String toStringMethod(Object value) => bad('toStringMethod');
16+
Object parse(String string) => throw bad('parse');
17+
String toStringMethod(Object value) => throw bad('toStringMethod');
2018

21-
Object fromInt(int i) => bad('fromInt');
19+
Object fromInt(int i) => throw bad('fromInt');
2220

23-
Object get one => bad('one');
24-
Object get eight => bad('eight');
21+
Object get one => throw bad('one');
22+
Object get eight => throw bad('eight');
2523

26-
int bitLength(Object value) => bad('bitLength');
27-
bool isEven(Object value) => bad('isEven');
24+
int bitLength(Object value) => throw bad('bitLength');
25+
bool isEven(Object value) => throw bad('isEven');
2826

29-
Object add(Object left, Object right) => bad('add');
30-
Object shiftLeft(Object value, Object count) => bad('shiftLeft');
31-
Object shiftRight(Object value, Object count) => bad('shiftRight');
32-
Object subtract(Object left, Object right) => bad('subtract');
27+
Object add(Object left, Object right) => throw bad('add');
28+
Object shiftLeft(Object value, Object count) => throw bad('shiftLeft');
29+
Object shiftRight(Object value, Object count) => throw bad('shiftRight');
30+
Object subtract(Object left, Object right) => throw bad('subtract');
3331
}

benchmarks/BigIntParsePrint/dart/native_version_javascript.dart

+3-2
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,6 @@ void _setup() {
106106
_eval('self.bigint_isEven = function isEven(b) { return (b & 1n) == 0n; }');
107107
}
108108

109-
Object _one;
110-
Object _eight;
109+
// `dynamic` to allow null initialization pre- and post- NNBD.
110+
dynamic _one;
111+
dynamic _eight;

0 commit comments

Comments
 (0)