Bug 1140482 followup: Update ResolveInterpretedFunctionPrototype() failure-cases to return false instead of nullptr, now that return type is bool. rs=jorendorff

Landing on CLOSED TREE
This commit is contained in:
Daniel Holbert 2015-05-27 11:21:31 -07:00
Родитель 1f0ef48e79
Коммит 298090b8ae
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -388,12 +388,12 @@ ResolveInterpretedFunctionPrototype(JSContext* cx, HandleFunction fun, HandleId
else
objProto = fun->global().getOrCreateObjectPrototype(cx);
if (!objProto)
return nullptr;
return false;
RootedPlainObject proto(cx, NewObjectWithGivenProto<PlainObject>(cx, objProto,
SingletonObject));
if (!proto)
return nullptr;
return false;
// Per ES5 13.2 the prototype's .constructor property is configurable,
// non-enumerable, and writable. However, per the 15 July 2013 ES6 draft,
@ -402,7 +402,7 @@ ResolveInterpretedFunctionPrototype(JSContext* cx, HandleFunction fun, HandleId
if (!isStarGenerator) {
RootedValue objVal(cx, ObjectValue(*fun));
if (!DefineProperty(cx, proto, cx->names().constructor, objVal, nullptr, nullptr, 0))
return nullptr;
return false;
}
// Per ES5 15.3.5.2 a user-defined function's .prototype property is