Skip to content

Commit d793fc0

Browse files
aamCommit Queue
authored andcommitted
[sdk/vm] Make Base64._inverseAlphabet shared.
This is so that Base64 decoding is available for isolategroup-bound callbacks. TEST=run_isolate_group_run_test BUG=#61541 CoreLibraryReviewExempt: vm-only pragma Change-Id: I30b8f0c36b0f980a1f5a13cec3cb07e214324ce0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/461180 Reviewed-by: Slava Egorov <[email protected]> Commit-Queue: Alexander Aprelev <[email protected]>
1 parent c5268b2 commit d793fc0

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

sdk/lib/convert/base64.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ class _Base64Decoder {
589589
/// 62nd and 63rd alphabet characters), and considers `%` a padding
590590
/// character, which must then be followed by `3D`, the percent-escape
591591
/// for `=`.
592+
@pragma('vm:shared')
592593
static final List<int> _inverseAlphabet = Int8List.fromList([
593594
__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, //
594595
__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, //

tests/ffi/run_isolate_group_run_test.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// VMOptions=--experimental-shared-data --profiler --profile_vm=false
1414

1515
import 'package:dart_internal/isolate_group.dart' show IsolateGroup;
16+
import 'dart:convert';
1617
import 'dart:developer';
1718
import 'dart:isolate';
1819

@@ -259,5 +260,12 @@ main(List<String> args) {
259260
});
260261
Expect.isTrue(resultIdentical);
261262

263+
Expect.listEquals(
264+
"abcdefghijklmnopqrstuvwxyz".codeUnits,
265+
IsolateGroup.runSync(() {
266+
return Base64Decoder().convert("YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo=");
267+
}),
268+
);
269+
262270
print("All tests completed :)");
263271
}

0 commit comments

Comments
 (0)