Skip to content

Commit

Permalink
Version 3.2.0-236.0.dev
Browse files Browse the repository at this point in the history
Merge 6885e82 into dev
  • Loading branch information
Dart CI committed Oct 6, 2023
2 parents b57aec1 + 6885e82 commit dc5026f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
5 changes: 0 additions & 5 deletions sdk/lib/_internal/wasm/lib/js_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -552,11 +552,6 @@ F _wrapDartFunction<F extends Function>(F f, WasmExternRef ref) {
WasmExternRef? getConstructorRaw(String name) =>
getPropertyRaw(globalThisRaw(), name.toExternRef);

/// Equivalent to `Object.keys(object)`.
// TODO(joshualitt): Make this a static helper on 'JSObject'.
@js.JS('Object.keys')
external JSArray objectKeys(JSObject object);

/// Takes a [codeTemplate] string which must represent a valid JS function, and
/// a list of optional arguments. The [codeTemplate] will be inserted into the
/// JS runtime, and the call to [JS] will be replaced by a call to an external
Expand Down
5 changes: 4 additions & 1 deletion sdk/lib/_internal/wasm/lib/js_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,14 @@ class JSAny {
external factory JSAny._();
}

@JS()
@JS('Object')
@staticInterop
class JSObject implements JSAny {
/// Returns a new object literal.
factory JSObject() => js.JSValue(js.newObjectRaw()) as JSObject;

/// Equivalent to `Object.keys(object)`.
external static JSArray keys(JSObject o);
}

@JS()
Expand Down
2 changes: 1 addition & 1 deletion sdk/lib/_internal/wasm/lib/regexp_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class _MatchImplementation implements RegExpMatch {
Iterable<String> get groupNames {
JSObject? groups = _match.groups;
if (groups.isDefinedAndNotNull) {
return JSArrayIterableAdapter<String>(objectKeys(groups!));
return JSArrayIterableAdapter<String>(JSObject.keys(groups!));
}
return Iterable.empty();
}
Expand Down
3 changes: 1 addition & 2 deletions tests/web/wasm/js_util_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ void dartObjectRoundTripTest() {

void deepConversionsTest() {
// Dart to JS.
// TODO(joshualitt): Consider supporting `null` in jsify.
// Expect.isNull(dartify(jsify(null)));
Expect.isNull(dartify(jsify(null)));
Expect.equals(true, dartify(jsify(true)));
Expect.equals(2.0, dartify(jsify(2.0)));
Expect.equals('foo', dartify(jsify('foo')));
Expand Down
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ CHANNEL dev
MAJOR 3
MINOR 2
PATCH 0
PRERELEASE 235
PRERELEASE 236
PRERELEASE_PATCH 0

0 comments on commit dc5026f

Please sign in to comment.