Skip to content

Commit 18994e6

Browse files
rakudramaCommit Queue
authored and
Commit Queue
committed
[typed_data] Remove UnmodifiableXXXView classes
In most cases, the (now removed) SDK class was patched so that the constructor redirected to a platform-specific implementation of the unmodifiable view. Uses of the SDK class in the platform code could be rewritten to the more direct use of the implementation class. The big +/- file changes are from moving the implementation classes from the patch file (typed_data_patch.dart), where they are no longer needed, to the internal file (typed_data.dart). TEST=ci Bug: #53785 Change-Id: Iaa7370de25b7fc2d26b24f7733c2892868e593cb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370661 Reviewed-by: Ömer Ağacan <[email protected]> Reviewed-by: Lasse Nielsen <[email protected]> Reviewed-by: Siva Annamalai <[email protected]> Commit-Queue: Stephen Adams <[email protected]> Reviewed-by: Brian Quinlan <[email protected]>
1 parent 7ae9900 commit 18994e6

22 files changed

+993
-2144
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@
3636

3737
[#44876]: https://github.com/dart-lang/sdk/issues/44876
3838

39+
#### `dart:typed_data`
40+
41+
- **BREAKING CHANGE** [#53785][]: The unmodifiable view classes for typed data
42+
have been removed. These classes were deprecated in Dart 3.4.
43+
44+
To create an unmodifiable view of a typed-data object, use the
45+
`asUnmodifiableView()` methods added in Dart 3.3.
46+
47+
[#53785]: https://github.com/dart-lang/sdk/issues/53785
48+
3949
### Tools
4050

4151
#### Linter

runtime/vm/dart_api_impl_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,7 +2064,7 @@ TEST_CASE(DartAPI_UnmodifiableTypedDataViewListIsTypedData) {
20642064
"import 'dart:typed_data';\n"
20652065
"List testMain(int size) {\n"
20662066
" var a = new Int8List(size);\n"
2067-
" var view = new UnmodifiableInt8ListView(a);\n"
2067+
" var view = a.asUnmodifiableView();\n"
20682068
" return view;\n"
20692069
"}\n";
20702070
// Create a test library and Load up a test script in it.
@@ -2709,7 +2709,7 @@ static void TestUnmodifiableTypedDataViewDirectAccess() {
27092709
" for (var i = 0; i < 100; i++) {"
27102710
" list[i] = i;"
27112711
" }"
2712-
" return new UnmodifiableInt8ListView(list);"
2712+
" return list.asUnmodifiableView();"
27132713
"}\n";
27142714
// Create a test library and Load up a test script in it.
27152715
Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, nullptr);

0 commit comments

Comments
 (0)