We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd27b43 commit 80d53a6Copy full SHA for 80d53a6
sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/records.dart
@@ -38,7 +38,17 @@ final class RecordImpl implements Record {
38
/// NOTE: Does not contain the cached result of the "safe" [_toString] call.
39
String? _printed;
40
41
- RecordImpl(this.shape, this.values);
+ RecordImpl(this.shape, this.values) {
42
+ var valueCount = JS<int>('!', '#.length', values);
43
+ // Coerce all undefined values to null because dynamic gets of record
44
+ // elements rely on the getter returning undefined to signal that the getter
45
+ // does not exist.
46
+ for (int i = 0; i < valueCount; i++) {
47
+ if (JS<bool>('!', '#[#] === void 0', values, i)) {
48
+ JS('', '#[#] = null', values, i);
49
+ }
50
51
52
53
@override
54
bool operator ==(Object? other) {
0 commit comments