Bug 410929 - Bad C++isms in js/src, r=crowder

This commit is contained in:
benjamin@smedbergs.us 2008-01-06 08:28:46 -08:00
parent 44c5efe626
commit 3a92106058
2 changed files with 3 additions and 2 deletions

View File

@ -1232,7 +1232,8 @@ array_sort(JSContext *cx, uintN argc, jsval *vp)
} while (i != 0);
JS_ASSERT(tvr.u.array == vec);
vec = JS_realloc(cx, vec, 4 * (size_t) newlen * sizeof(jsval));
vec = (jsval *) JS_realloc(cx, vec,
4 * (size_t) newlen * sizeof(jsval));
if (!vec) {
vec = tvr.u.array;
ok = JS_FALSE;

View File

@ -3275,7 +3275,7 @@ EmitDestructuringDecl(JSContext *cx, JSCodeGenerator *cg, JSOp prologOp,
JSOp decltype;
JS_ASSERT(pn->pn_type == TOK_NAME);
decltype = (prologOp == JSOP_NOP) ? LET_DECL : VAR_DECL;
decltype = (prologOp == JSOP_NOP) ? (JSOp) LET_DECL : (JSOp) VAR_DECL;
if (!BindNameToSlot(cx, cg, pn, decltype))
return JS_FALSE;