Skip to content

Commit cf90ff2

Browse files
nshahanCommit Queue
authored andcommitted
[ddc] Cleanup type literals in JS() calls
One was an actual bug where an RTI was used when we wanted the JavaScript class representing Dart Object class. Issue: #46002 Change-Id: Ib5ece2578ff7421b6754258f95068a21ee55e055 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415380 Reviewed-by: Mark Zhou <[email protected]> Commit-Queue: Nicholas Shahan <[email protected]>
1 parent f7d9136 commit cf90ff2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ getGenericTypeCtor(value) => JS('', '#[#]', value, _genericTypeCtor);
164164
///
165165
/// This is typically an instance's JS constructor.
166166
getTypeSignatureContainer(obj) {
167-
if (obj == null) return JS('!', '#', Object);
167+
if (obj == null) return JS_CLASS_REF(Object);
168168

169169
// Object.create(null) produces a js object without a prototype.
170170
// In that case use the native Object constructor.

sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ bool dtest(obj) {
732732
asInt(obj) {
733733
// Note: null (and undefined) will fail this test.
734734
if (JS('!', 'Math.floor(#) != #', obj, obj)) {
735-
castError(obj, JS('', '#', int));
735+
castError(obj, TYPE_REF<int>());
736736
}
737737
return obj;
738738
}

0 commit comments

Comments
 (0)