зеркало из https://github.com/mozilla/pjs.git
Bug 700740 - Remove 'out' label from obj_toSource; r=jorendorff
This commit is contained in:
Родитель
ce8b9600f5
Коммит
5b0b485be4
|
@ -501,7 +501,6 @@ static JSBool
|
|||
obj_toSource(JSContext *cx, uintN argc, Value *vp)
|
||||
{
|
||||
JSBool ok;
|
||||
JSHashEntry *he;
|
||||
JSIdArray *ida;
|
||||
jschar *chars, *ochars, *vsharp;
|
||||
const jschar *idstrchars, *vchars;
|
||||
|
@ -527,10 +526,10 @@ obj_toSource(JSContext *cx, uintN argc, Value *vp)
|
|||
if (!obj)
|
||||
return false;
|
||||
|
||||
if (!(he = js_EnterSharpObject(cx, obj, &ida, &chars))) {
|
||||
ok = JS_FALSE;
|
||||
goto out;
|
||||
}
|
||||
JSHashEntry *he = js_EnterSharpObject(cx, obj, &ida, &chars);
|
||||
if (!he)
|
||||
return false;
|
||||
|
||||
if (!ida) {
|
||||
/*
|
||||
* We didn't enter -- obj is already "sharp", meaning we've visited it
|
||||
|
@ -816,25 +815,21 @@ obj_toSource(JSContext *cx, uintN argc, Value *vp)
|
|||
if (!ok) {
|
||||
if (chars)
|
||||
Foreground::free_(chars);
|
||||
goto out;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!chars) {
|
||||
JS_ReportOutOfMemory(cx);
|
||||
ok = JS_FALSE;
|
||||
goto out;
|
||||
return false;
|
||||
}
|
||||
make_string:
|
||||
str = js_NewString(cx, chars, nchars);
|
||||
if (!str) {
|
||||
cx->free_(chars);
|
||||
ok = JS_FALSE;
|
||||
goto out;
|
||||
return false;
|
||||
}
|
||||
vp->setString(str);
|
||||
ok = JS_TRUE;
|
||||
out:
|
||||
return ok;
|
||||
return true;
|
||||
|
||||
overflow:
|
||||
cx->free_(vsharp);
|
||||
|
|
Загрузка…
Ссылка в новой задаче