Bug 968097 - Fix blatantly mistaken error-handling path. (f=Jesse, r=jwalden, a=sylvestre)
authorEric Faust <efaustbmo@gmail.com>
Tue, 11 Feb 2014 15:20:17 -0800
changeset 182783 c7f9bf24fa3ed947b271a8d265e570289be5271a
parent 182782 cae2cfa89583246d6ff1a9db7a4cce0dcbbb4af4
child 182784 7a6043b28459dd9063a34c8b4976d9ba91b0b9be
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden, sylvestre
bugs968097
milestone29.0a2
Bug 968097 - Fix blatantly mistaken error-handling path. (f=Jesse, r=jwalden, a=sylvestre)
js/src/jsapi.cpp
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -2347,17 +2347,18 @@ JS_SetPrototype(JSContext *cx, JS::Handl
     CHECK_REQUEST(cx);
     assertSameCompartment(cx, obj, proto);
 
     bool succeeded;
     if (!JSObject::setProto(cx, obj, proto, &succeeded))
         return false;
 
     if (!succeeded) {
-        JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_SETPROTOTYPEOF_FAIL);
+        RootedValue val(cx, ObjectValue(*obj));
+        js_ReportValueError(cx, JSMSG_SETPROTOTYPEOF_FAIL, JSDVG_IGNORE_STACK, val, js::NullPtr());
         return false;
     }
 
     return true;
 }
 
 JS_PUBLIC_API(JSObject *)
 JS_GetParent(JSObject *obj)