Skip to content

Commit d33ed63

Browse files
devoncarewCommit Queue
authored and
Commit Queue
committed
[js_interop] adjust some dartdoc comments
Change-Id: Icba8e411ba0ec71acc4b7d5a9512f53182943c77 CoreLibraryReviewExempt: dartdoc comments for a web-only library Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288322 Reviewed-by: Joshua Litt <[email protected]> Commit-Queue: Devon Carew <[email protected]>
1 parent 1d4654c commit d33ed63

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

sdk/lib/js_interop/js_interop.dart

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
/// **WARNING**:
6-
/// The following types will be sealed in the near future. Do *not* subtype
7-
/// the types in this library as the subtypes will be broken.
8-
95
/// A library for JS interop. Includes a JS type hierarchy to facilitate sound
106
/// interop with JS. The JS type hierarchy is modeled after the actual type
117
/// hierarchy in JS, and not the Dart type hierarchy.
@@ -14,6 +10,14 @@
1410
/// implementation. JS backends currently support conflating Dart types and JS
1511
/// types, whereas Wasm backends do not. Over time we will try and unify backend
1612
/// semantics as much as possible.
13+
///
14+
/// **WARNING**:
15+
/// The following types will be sealed in the near future. Do *not* subtype
16+
/// the types in this library as the subtypes will be broken.
17+
///
18+
/// {@category Web}
19+
library dart.js_interop;
20+
1721
import 'dart:_js_types' as js_types;
1822
import 'dart:typed_data';
1923

@@ -33,11 +37,11 @@ typedef JSAny = js_types.JSAny;
3337
/// primitives. This is the only allowed `on` type for inline classes written by
3438
/// users to model JS interop objects. See https://dart.dev/web/js-interop for
3539
/// more details on how to use JS interop.
36-
/// TODO(srujzs): This class _must_ be sealed before we can make this library
37-
/// public. Either use the CFE mechanisms that exist today, or use the Dart 3
38-
/// sealed classes feature.
39-
/// TODO(joshualitt): Do we need to seal any other JS types on JS backends? We
40-
/// probably want to seal all JS types on Wasm backends.
40+
// TODO(srujzs): This class _must_ be sealed before we can make this library
41+
// public. Either use the CFE mechanisms that exist today, or use the Dart 3
42+
// sealed classes feature.
43+
// TODO(joshualitt): Do we need to seal any other JS types on JS backends? We
44+
// probably want to seal all JS types on Wasm backends.
4145
typedef JSObject = js_types.JSObject;
4246

4347
/// The type of all JS functions, [JSFunction] <: [JSObject].
@@ -46,7 +50,7 @@ typedef JSFunction = js_types.JSFunction;
4650
/// The type of all Dart functions adapted to be callable from JS. We only allow
4751
/// a subset of Dart functions to be callable from JS, [JSExportedDartFunction]
4852
/// <: [JSFunction].
49-
/// TODO(joshualitt): Detail exactly what are the requirements.
53+
// TODO(joshualitt): Detail exactly what are the requirements.
5054
typedef JSExportedDartFunction = js_types.JSExportedDartFunction;
5155

5256
/// The type of JS promises and promise-like objects, [JSPromise] <: [JSObject].
@@ -80,9 +84,9 @@ typedef JSUint32Array = js_types.JSUint32Array;
8084
typedef JSFloat32Array = js_types.JSFloat32Array;
8185
typedef JSFloat64Array = js_types.JSFloat64Array;
8286

83-
/// The various JS primitive types. Crucially, unlike the Dart type hierarchy,
84-
/// none of these are subtypes of [JSObject], but rather they are logically
85-
/// subtypes of [JSAny].
87+
// The various JS primitive types. Crucially, unlike the Dart type hierarchy,
88+
// none of these are subtypes of [JSObject], but rather they are logically
89+
// subtypes of [JSAny].
8690

8791
/// The type of JS numbers, [JSNumber] <: [JSAny].
8892
typedef JSNumber = js_types.JSNumber;
@@ -100,8 +104,8 @@ typedef JSString = js_types.JSString;
100104
/// null`, users should use the provided helpers below to determine if it is
101105
/// safe to downcast a potentially `JSNullable` or `JSUndefineable` object to a
102106
/// defined and non-null JS type.
103-
/// TODO(joshualitt): Investigate whether or not it will be possible to reify
104-
/// `JSUndefined` and `JSNull` on all backends.
107+
// TODO(joshualitt): Investigate whether or not it will be possible to reify
108+
// `JSUndefined` and `JSNull` on all backends.
105109
extension NullableUndefineableJSAnyExtension on JSAny? {
106110
external bool get isUndefined;
107111
external bool get isNull;
@@ -113,10 +117,10 @@ extension NullableUndefineableJSAnyExtension on JSAny? {
113117
/// no actual object will be returned.
114118
typedef JSVoid = js_types.JSVoid;
115119

116-
/// Extension members to support conversions between Dart types and JS types.
117-
/// Not all Dart types can be converted to JS types and vice versa.
118-
/// TODO(joshualitt): We might want to investigate using inline classes instead
119-
/// of extension methods for these methods.
120+
// Extension members to support conversions between Dart types and JS types.
121+
// Not all Dart types can be converted to JS types and vice versa.
122+
// TODO(joshualitt): We might want to investigate using inline classes instead
123+
// of extension methods for these methods.
120124

121125
/// [JSExportedDartFunction] <-> [Function]
122126
extension JSExportedDartFunctionToFunction on JSExportedDartFunction {
@@ -141,9 +145,9 @@ extension JSPromiseToFuture on JSPromise {
141145
external Future<JSAny?> get toDart;
142146
}
143147

144-
/// TODO(joshualitt): On Wasm backends List / Array conversion methods will
145-
/// copy, and on JS backends they will not. We should find a path towards
146-
/// consistent semantics.
148+
// TODO(joshualitt): On Wasm backends List / Array conversion methods will
149+
// copy, and on JS backends they will not. We should find a path towards
150+
// consistent semantics.
147151
/// [JSArrayBuffer] <-> [ByteBuffer]
148152
extension JSArrayBufferToByteBuffer on JSArrayBuffer {
149153
external ByteBuffer get toDart;

0 commit comments

Comments
 (0)