mirror of
https://github.com/facebookarchive/prepack.git
synced 2024-11-10 14:09:42 +03:00
Join new properties with empty rather than undefined (#414)
This commit is contained in:
parent
f99e4b4a75
commit
fb14d00846
@ -309,15 +309,15 @@ export function joinDescriptors(realm: Realm,
|
||||
throw new Error("TODO: join computed properties");
|
||||
let dc = cloneDescriptor(d);
|
||||
invariant(dc !== undefined);
|
||||
dc.value = getAbstractValue(d.value, undefined);
|
||||
dc.value = getAbstractValue(d.value, realm.intrinsics.empty);
|
||||
return dc;
|
||||
}
|
||||
if (d1 === undefined) {
|
||||
if (d2 === undefined) return undefined;
|
||||
// d2 is a new property created in only one branch, join with undefined
|
||||
// d2 is a new property created in only one branch, join with empty
|
||||
return clone_with_abstract_value(d2);
|
||||
} else if (d2 === undefined) {
|
||||
// d1 is a new property created in only one branch, join with undefined
|
||||
// d1 is a new property created in only one branch, join with empty
|
||||
return clone_with_abstract_value(d1);
|
||||
} else {
|
||||
let d3 : Descriptor = { };
|
||||
|
5
test/serializer/abstract/PutValue11.js
Normal file
5
test/serializer/abstract/PutValue11.js
Normal file
@ -0,0 +1,5 @@
|
||||
var c = global.__abstract ? __abstract("boolean", "false") : false;
|
||||
a = {};
|
||||
if (c) a.f = a;
|
||||
|
||||
inspect = function() { return 'f' in a; }
|
Loading…
Reference in New Issue
Block a user