Bug 928426 - Don't create template objects for singleton-typed this values. (r=bhackett)

This commit is contained in:
Shu-yu Guo 2013-10-19 13:56:57 -07:00
parent 777dc154bc
commit e1f1057dd5

View File

@ -7454,7 +7454,9 @@ GetTemplateObjectForNative(JSContext *cx, HandleScript script, jsbytecode *pc,
}
if (native == js::array_concat) {
if (args.thisv().isObject() && args.thisv().toObject().is<ArrayObject>()) {
if (args.thisv().isObject() && args.thisv().toObject().is<ArrayObject>() &&
!args.thisv().toObject().hasSingletonType())
{
res.set(NewDenseEmptyArray(cx, args.thisv().toObject().getProto(), TenuredObject));
if (!res)
return false;