Handle an interpreted constructor returning an object. r=brendan

This commit is contained in:
Blake Kaplan 2008-09-03 18:21:15 -07:00
parent 1d44de3cb6
commit d9be63b689

View File

@ -3687,11 +3687,9 @@ TraceRecorder::record_JSOP_RETURN()
{
jsval& rval = stackval(-1);
JSStackFrame *fp = cx->fp;
if (cx->fp->flags & JSFRAME_CONSTRUCTING) {
if (JSVAL_IS_PRIMITIVE(rval)) {
JS_ASSERT(OBJECT_TO_JSVAL(fp->thisp) == fp->argv[-1]);
rval_ins = get(&fp->argv[-1]);
}
if ((cx->fp->flags & JSFRAME_CONSTRUCTING) && JSVAL_IS_PRIMITIVE(rval)) {
JS_ASSERT(OBJECT_TO_JSVAL(fp->thisp) == fp->argv[-1]);
rval_ins = get(&fp->argv[-1]);
} else {
rval_ins = get(&rval);
}