Bug 936403 - Make sure undefined global properties are tracked when generating baseline ICs, r=jandem.

This commit is contained in:
Brian Hackett 2013-11-17 15:59:52 -07:00
Родитель 3ec9e9b3af
Коммит 36a8a7fbec
2 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,21 @@
s = newGlobal()
function f(code) {
evalcx(code, s)
}
f("\
c = [];\
var x;\
for each(z in[\
x,,[],,new Number,,,,new Number,,,,new Number,new Number,[],\
,,,[],,new Number,,new Number,,[],new Number,[],,,,,,[],\
new Number,,new Number,[],,[],,,,[],,[],,,,,,,,,[],[],,[],\
[],[],,new Number,[],[],,[],,new Number,new Number,new Number,\
new Number,new Number,,,new Number,new Number,,[],[],[],,,[],\
[],[],new Number,,new Number,,,,,[],new Number,new Number,[],\
[],[],[],,x,[]]\
) {\
c = z\
};\
");
f("c");

Просмотреть файл

@ -1365,6 +1365,11 @@ ICUpdatedStub::addUpdateStubForValue(JSContext *cx, HandleScript script, HandleO
types::EnsureTrackPropertyTypes(cx, obj, id);
// Make sure that undefined values are explicitly included in the property
// types for an object if generating a stub to write an undefined value.
if (val.isUndefined() && types::CanHaveEmptyPropertyTypesForOwnProperty(obj))
types::AddTypePropertyId(cx, obj, id, val);
if (val.isPrimitive()) {
JSValueType type = val.isDouble() ? JSVAL_TYPE_DOUBLE : val.extractNonDoubleType();