Bug 583126 - parseInt(string) traceable native ignores OOM. rs=jorendorff

--HG--
extra : rebase_source : b9244f62e7f4bc0e0db96a7b5fa21b43ffc1b7de
This commit is contained in:
Jeff Walden 2010-07-30 17:25:20 -07:00
parent 482da28f6d
commit 9bb90b0bc3

View File

@ -68,6 +68,7 @@
#include "jsprf.h"
#include "jsscope.h"
#include "jsstr.h"
#include "jstracer.h"
#include "jsvector.h"
#include "jsobjinlines.h"
@ -469,8 +470,10 @@ ParseInt(JSContext* cx, JSString* str)
str->getCharsAndEnd(start, end);
jsdouble d;
if (!ParseIntStringHelper(cx, start, end, 0, true, &d))
return js_NaN; // FIXME bug 583126: ignores OOM!
if (!ParseIntStringHelper(cx, start, end, 0, true, &d)) {
SetBuiltinError(cx);
return js_NaN;
}
return d;
}