mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 869784 - Fix rooting hazards in the profiler; r=BenWa,till
X-Git-Commit-ID: da732de921f64d9bd6ea028ed384d2d5c80de66f X-Mailer: git-send-email
This commit is contained in:
parent
66a299bc03
commit
8d14481739
@ -86,13 +86,13 @@ JSObjectBuilder::ArrayPush(JSCustomArray *aArray, int value)
|
||||
if (!mOk)
|
||||
return;
|
||||
|
||||
JS::Value objval = INT_TO_JSVAL(value);
|
||||
uint32_t length;
|
||||
mOk = JS_GetArrayLength(mCx, (JSObject*)aArray, &length);
|
||||
|
||||
if (!mOk)
|
||||
return;
|
||||
|
||||
JS::Value objval = INT_TO_JSVAL(value);
|
||||
mOk = JS_SetElement(mCx, (JSObject*)aArray, length, &objval);
|
||||
}
|
||||
|
||||
@ -102,19 +102,19 @@ JSObjectBuilder::ArrayPush(JSCustomArray *aArray, const char *value)
|
||||
if (!mOk)
|
||||
return;
|
||||
|
||||
JSString *string = JS_NewStringCopyN(mCx, value, strlen(value));
|
||||
JS::RootedString string(mCx, JS_NewStringCopyN(mCx, value, strlen(value)));
|
||||
if (!string) {
|
||||
mOk = JS_FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
JS::Value objval = STRING_TO_JSVAL(string);
|
||||
uint32_t length;
|
||||
mOk = JS_GetArrayLength(mCx, (JSObject*)aArray, &length);
|
||||
|
||||
if (!mOk)
|
||||
return;
|
||||
|
||||
JS::Value objval = STRING_TO_JSVAL(string);
|
||||
mOk = JS_SetElement(mCx, (JSObject*)aArray, length, &objval);
|
||||
}
|
||||
|
||||
@ -124,12 +124,13 @@ JSObjectBuilder::ArrayPush(JSCustomArray *aArray, JSCustomObject *aObject)
|
||||
if (!mOk)
|
||||
return;
|
||||
|
||||
JS::Value objval = OBJECT_TO_JSVAL((JSObject*)aObject); uint32_t length;
|
||||
uint32_t length;
|
||||
mOk = JS_GetArrayLength(mCx, (JSObject*)aArray, &length);
|
||||
|
||||
if (!mOk)
|
||||
return;
|
||||
|
||||
JS::Value objval = OBJECT_TO_JSVAL((JSObject*)aObject);
|
||||
mOk = JS_SetElement(mCx, (JSObject*)aArray, length, &objval);
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,6 @@ private:
|
||||
void operator delete[](void*);
|
||||
|
||||
JSContext *mCx;
|
||||
JSObject *mObj;
|
||||
int mOk;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user