Skip to content

Commit 8fb3eb3

Browse files
committed
1 parent 6410051 commit 8fb3eb3

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

pkg/dev_compiler/lib/runtime/dart/_utils.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,20 @@ dart_library.library('dart/_utils', null, /* Imports */[
6868
}
6969
function copyTheseProperties(to, from, names) {
7070
for (let name of names) {
71-
defineProperty(to, name, getOwnPropertyDescriptor(from, name));
71+
var desc = getOwnPropertyDescriptor(from, name);
72+
if (desc != void 0) {
73+
defineProperty(to, name, desc);
74+
} else {
75+
defineLazyProperty(to, name, () => from[name]);
76+
}
7277
}
7378
return to;
7479
}
7580
function copyProperties(to, from) {
7681
return copyTheseProperties(to, from, getOwnNamesAndSymbols(from));
7782
}
7883
function export_(to, from, show, hide) {
79-
if (show == void 0) {
84+
if (show == void 0 || show.length == 0) {
8085
show = getOwnNamesAndSymbols(from);
8186
}
8287
if (hide != void 0) {

pkg/dev_compiler/tool/input_sdk/private/utils.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ defineMemoizedGetter(obj, String name, getter) =>
9797

9898
copyTheseProperties(to, from, names) => JS('', '''((to, from, names) => {
9999
for (let name of names) {
100-
defineProperty(to, name, getOwnPropertyDescriptor(from, name));
100+
var desc = getOwnPropertyDescriptor(from, name);
101+
if (desc != void 0) {
102+
defineProperty(to, name, desc);
103+
} else {
104+
defineLazyProperty(to, name, () => from[name]);
105+
}
101106
}
102107
return to;
103108
})(#, #, #)''', to, from, names);
@@ -112,7 +117,7 @@ copyProperties(to, from) => JS('', '''((to, from) => {
112117
// TODO(ochafik): Re-introduce a @JS annotation in the SDK (same as package:js)
113118
// so that this is named 'export' in JavaScript.
114119
export_(to, from, show, hide) => JS('', '''((to, from, show, hide) => {
115-
if (show == void 0) {
120+
if (show == void 0 || show.length == 0) {
116121
show = getOwnNamesAndSymbols(from);
117122
}
118123
if (hide != void 0) {

0 commit comments

Comments
 (0)