From d793fc0ed5409b2dbbb94e790078c97339d0b20d Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Mon, 1 Dec 2025 10:20:11 -0800 Subject: [PATCH] [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=https://github.com/dart-lang/sdk/issues/61541 CoreLibraryReviewExempt: vm-only pragma Change-Id: I30b8f0c36b0f980a1f5a13cec3cb07e214324ce0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/461180 Reviewed-by: Slava Egorov Commit-Queue: Alexander Aprelev --- sdk/lib/convert/base64.dart | 1 + tests/ffi/run_isolate_group_run_test.dart | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/sdk/lib/convert/base64.dart b/sdk/lib/convert/base64.dart index e861cf4c9e7..d398f6812dd 100644 --- a/sdk/lib/convert/base64.dart +++ b/sdk/lib/convert/base64.dart @@ -589,6 +589,7 @@ class _Base64Decoder { /// 62nd and 63rd alphabet characters), and considers `%` a padding /// character, which must then be followed by `3D`, the percent-escape /// for `=`. + @pragma('vm:shared') static final List _inverseAlphabet = Int8List.fromList([ __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, // __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, // diff --git a/tests/ffi/run_isolate_group_run_test.dart b/tests/ffi/run_isolate_group_run_test.dart index d82e3d3ded6..18999f6908e 100644 --- a/tests/ffi/run_isolate_group_run_test.dart +++ b/tests/ffi/run_isolate_group_run_test.dart @@ -13,6 +13,7 @@ // VMOptions=--experimental-shared-data --profiler --profile_vm=false import 'package:dart_internal/isolate_group.dart' show IsolateGroup; +import 'dart:convert'; import 'dart:developer'; import 'dart:isolate'; @@ -259,5 +260,12 @@ main(List args) { }); Expect.isTrue(resultIdentical); + Expect.listEquals( + "abcdefghijklmnopqrstuvwxyz".codeUnits, + IsolateGroup.runSync(() { + return Base64Decoder().convert("YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo="); + }), + ); + print("All tests completed :)"); }