[benchmark] Make BigIntPrintParse be NNBD-agnostic

Change-Id: I6e93972bf904cbf09316517798a43116ee7fa61a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141027
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
This commit is contained in:
Stephen Adams 2020-03-26 17:55:33 +00:00 committed by commit-bot@chromium.org
parent 12e81d336f
commit 93c2900477
2 changed files with 15 additions and 16 deletions

View file

@ -11,23 +11,21 @@ class _DummyMethods implements NativeBigIntMethods {
bool get enabled => false; bool get enabled => false;
static Object bad(String message) { static Object bad(String message) => UnimplementedError(message);
throw UnimplementedError(message);
}
Object parse(String string) => bad('parse'); Object parse(String string) => throw bad('parse');
String toStringMethod(Object value) => bad('toStringMethod'); String toStringMethod(Object value) => throw bad('toStringMethod');
Object fromInt(int i) => bad('fromInt'); Object fromInt(int i) => throw bad('fromInt');
Object get one => bad('one'); Object get one => throw bad('one');
Object get eight => bad('eight'); Object get eight => throw bad('eight');
int bitLength(Object value) => bad('bitLength'); int bitLength(Object value) => throw bad('bitLength');
bool isEven(Object value) => bad('isEven'); bool isEven(Object value) => throw bad('isEven');
Object add(Object left, Object right) => bad('add'); Object add(Object left, Object right) => throw bad('add');
Object shiftLeft(Object value, Object count) => bad('shiftLeft'); Object shiftLeft(Object value, Object count) => throw bad('shiftLeft');
Object shiftRight(Object value, Object count) => bad('shiftRight'); Object shiftRight(Object value, Object count) => throw bad('shiftRight');
Object subtract(Object left, Object right) => bad('subtract'); Object subtract(Object left, Object right) => throw bad('subtract');
} }

View file

@ -106,5 +106,6 @@ void _setup() {
_eval('self.bigint_isEven = function isEven(b) { return (b & 1n) == 0n; }'); _eval('self.bigint_isEven = function isEven(b) { return (b & 1n) == 0n; }');
} }
Object _one; // `dynamic` to allow null initialization pre- and post- NNBD.
Object _eight; dynamic _one;
dynamic _eight;