Skip to content

Commit

Permalink
Revert "[dart:js_interop] Add Since('3.6') annotations to new APIs"
Browse files Browse the repository at this point in the history
This reverts commit 14cf3b4.

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 (flutter/engine#54590) so for now, revert.

Original change's description:
> [dart:js_interop] Add Since('3.6') annotations to new APIs
>
> Closes #56484
>
> Change-Id: I9d3da568aafeccbb855892ea5c2ba647371170bc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380900
> Reviewed-by: Kevin Moore <[email protected]>
> Reviewed-by: Leaf Petersen <[email protected]>
> Reviewed-by: Sigmund Cherem <[email protected]>
> Commit-Queue: Srujan Gaddam <[email protected]>
> Reviewed-by: Martin Kustermann <[email protected]>

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 <[email protected]>
Bot-Commit: Rubber Stamper <[email protected]>
Commit-Queue: Srujan Gaddam <[email protected]>
  • Loading branch information
srujzs authored and Commit Queue committed Aug 16, 2024
1 parent 14cf3b4 commit 7600900
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions sdk/lib/js_interop/js_interop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,22 +160,18 @@ extension type JSArray<T extends JSAny?>._(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);
}

Expand Down Expand Up @@ -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]);
}

Expand All @@ -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]);
}

Expand All @@ -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);
}

Expand All @@ -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);
}

Expand All @@ -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);
}

Expand All @@ -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);
}

Expand All @@ -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);
}

Expand All @@ -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);
}

Expand All @@ -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);
}

Expand All @@ -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);
}

Expand All @@ -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);
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 7600900

Please sign in to comment.