From 7600900d78793a9c7177963eb3f30cd74edc5903 Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Fri, 16 Aug 2024 22:21:26 +0000 Subject: [PATCH] Revert "[dart:js_interop] Add Since('3.6') annotations to new APIs" This reverts commit 14cf3b44d3e705c7ae1b450044c151f7f8a49c70. Reason for revert: web_ui uses some of these APIs, but the pubspec SDK version is not >= 3.6. Therefore, Flutter analyze fails, which would then result in a broken roll. Updating the pubspec versions leads to try bot failures (https://github.com/flutter/engine/pull/54590) so for now, revert. Original change's description: > [dart:js_interop] Add Since('3.6') annotations to new APIs > > Closes https://github.com/dart-lang/sdk/issues/56484 > > Change-Id: I9d3da568aafeccbb855892ea5c2ba647371170bc > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380900 > Reviewed-by: Kevin Moore > Reviewed-by: Leaf Petersen > Reviewed-by: Sigmund Cherem > Commit-Queue: Srujan Gaddam > Reviewed-by: Martin Kustermann Change-Id: Idfb021c5744d83a8004259f9c8774945a2612efd No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380967 Reviewed-by: Leaf Petersen Bot-Commit: Rubber Stamper Commit-Queue: Srujan Gaddam --- sdk/lib/js_interop/js_interop.dart | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/sdk/lib/js_interop/js_interop.dart b/sdk/lib/js_interop/js_interop.dart index 20eb6c1084a4..8fe6ccc83610 100644 --- a/sdk/lib/js_interop/js_interop.dart +++ b/sdk/lib/js_interop/js_interop.dart @@ -160,22 +160,18 @@ extension type JSArray._(JSArrayRepType _jsArray) external JSArray.withLength(int length); /// The length in elements of this `Array`. - @Since('3.6') external int get length; /// Sets the length in elements of this `Array`. /// /// Setting it smaller than the current length truncates this `Array`, and /// setting it larger adds empty slots, which requires [T] to be nullable. - @Since('3.6') external set length(int newLength); /// The value at [position] in this `Array`. - @Since('3.6') external T operator [](int position); /// Sets the [value] at [position] in this `Array`. - @Since('3.6') external void operator []=(int position, T value); } @@ -215,7 +211,6 @@ extension type JSArrayBuffer._(JSArrayBufferRepType _jsArrayBuffer) implements JSObject { /// Creates a JavaScript `ArrayBuffer` of size [length] using an optional /// [options] JavaScript object that sets the `maxByteLength`. - @Since('3.6') external JSArrayBuffer(int length, [JSObject options]); } @@ -224,7 +219,6 @@ extension type JSArrayBuffer._(JSArrayBufferRepType _jsArrayBuffer) extension type JSDataView._(JSDataViewRepType _jsDataView) implements JSObject { /// Creates a JavaScript `DataView` with [buffer] as its backing storage, /// offset by [byteOffset] bytes, of size [byteLength]. - @Since('3.6') external JSDataView(JSArrayBuffer buffer, [int byteOffset, int byteLength]); } @@ -240,12 +234,10 @@ extension type JSInt8Array._(JSInt8ArrayRepType _jsInt8Array) /// offset by [byteOffset] bytes, of size [length]. /// /// If no [buffer] is provided, creates an empty `Int8Array`. - @Since('3.6') external JSInt8Array([JSArrayBuffer buffer, int byteOffset, int length]); /// Creates a JavaScript `Int8Array` of size [length] whose elements are /// initialized to 0. - @Since('3.6') external JSInt8Array.withLength(int length); } @@ -257,12 +249,10 @@ extension type JSUint8Array._(JSUint8ArrayRepType _jsUint8Array) /// offset by [byteOffset] bytes, of size [length]. /// /// If no [buffer] is provided, creates an empty `Uint8Array`. - @Since('3.6') external JSUint8Array([JSArrayBuffer buffer, int byteOffset, int length]); /// Creates a JavaScript `Uint8Array` of size [length] whose elements are /// initialized to 0. - @Since('3.6') external JSUint8Array.withLength(int length); } @@ -274,13 +264,11 @@ extension type JSUint8ClampedArray._( /// storage, offset by [byteOffset] bytes, of size [length]. /// /// If no [buffer] is provided, creates an empty `Uint8ClampedArray`. - @Since('3.6') external JSUint8ClampedArray( [JSArrayBuffer buffer, int byteOffset, int length]); /// Creates a JavaScript `Uint8ClampedArray` of size [length] whose elements /// are initialized to 0. - @Since('3.6') external JSUint8ClampedArray.withLength(int length); } @@ -292,12 +280,10 @@ extension type JSInt16Array._(JSInt16ArrayRepType _jsInt16Array) /// offset by [byteOffset] bytes, of size [length]. /// /// If no [buffer] is provided, creates an empty `Int16Array`. - @Since('3.6') external JSInt16Array([JSArrayBuffer buffer, int byteOffset, int length]); /// Creates a JavaScript `Int16Array` of size [length] whose elements are /// initialized to 0. - @Since('3.6') external JSInt16Array.withLength(int length); } @@ -309,12 +295,10 @@ extension type JSUint16Array._(JSUint16ArrayRepType _jsUint16Array) /// offset by [byteOffset] bytes, of size [length]. /// /// If no [buffer] is provided, creates an empty `Uint16Array`. - @Since('3.6') external JSUint16Array([JSArrayBuffer buffer, int byteOffset, int length]); /// Creates a JavaScript `Uint16Array` of size [length] whose elements are /// initialized to 0. - @Since('3.6') external JSUint16Array.withLength(int length); } @@ -326,12 +310,10 @@ extension type JSInt32Array._(JSInt32ArrayRepType _jsInt32Array) /// offset by [byteOffset] bytes, of size [length]. /// /// If no [buffer] is provided, creates an empty `Int32Array`. - @Since('3.6') external JSInt32Array([JSArrayBuffer buffer, int byteOffset, int length]); /// Creates a JavaScript `Int32Array` of size [length] whose elements are /// initialized to 0. - @Since('3.6') external JSInt32Array.withLength(int length); } @@ -343,12 +325,10 @@ extension type JSUint32Array._(JSUint32ArrayRepType _jsUint32Array) /// offset by [byteOffset] bytes, of size [length]. /// /// If no [buffer] is provided, creates an empty `Uint32Array`. - @Since('3.6') external JSUint32Array([JSArrayBuffer buffer, int byteOffset, int length]); /// Creates a JavaScript `Uint32Array` of size [length] whose elements are /// initialized to 0. - @Since('3.6') external JSUint32Array.withLength(int length); } @@ -360,12 +340,10 @@ extension type JSFloat32Array._(JSFloat32ArrayRepType _jsFloat32Array) /// offset by [byteOffset] bytes, of size [length]. /// /// If no [buffer] is provided, creates an empty `Float32Array`. - @Since('3.6') external JSFloat32Array([JSArrayBuffer buffer, int byteOffset, int length]); /// Creates a JavaScript `Float32Array` of size [length] whose elements are /// initialized to 0. - @Since('3.6') external JSFloat32Array.withLength(int length); } @@ -377,12 +355,10 @@ extension type JSFloat64Array._(JSFloat64ArrayRepType _jsFloat64Array) /// offset by [byteOffset] bytes, of size [length]. /// /// If no [buffer] is provided, creates an empty `Float64Array`. - @Since('3.6') external JSFloat64Array([JSArrayBuffer buffer, int byteOffset, int length]); /// Creates a JavaScript `Float64Array` of size [length] whose elements are /// initialized to 0. - @Since('3.6') external JSFloat64Array.withLength(int length); } @@ -649,7 +625,6 @@ extension FunctionToJSExportedDartFunction on Function { /// [Function]. Any [Function] that is converted with this member should take /// in an extra parameter at the beginning of the parameter list to handle /// this. - @Since('3.6') external JSExportedDartFunction get toJSCaptureThis; }