зеркало из https://github.com/mozilla/pjs.git
Fix bug 25353, check if jsval is a string before converting it to one. a:rickg, r:vidur
This commit is contained in:
Родитель
1ef6ae3972
Коммит
0457a08e3c
|
@ -606,6 +606,10 @@ nsHTMLFormElement::EnumerateProperty(JSContext *aContext, JSObject *aObj)
|
|||
PRBool
|
||||
nsHTMLFormElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID)
|
||||
{
|
||||
if (!JSVAL_IS_STRING(aID)) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PRBool ret;
|
||||
JSObject* obj;
|
||||
char* str = JS_GetStringBytes(JS_ValueToString(aContext, aID));
|
||||
|
|
|
@ -2620,6 +2620,10 @@ nsHTMLDocument::GetScriptObject(nsIScriptContext *aContext, void** aScriptObject
|
|||
PRBool
|
||||
nsHTMLDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID)
|
||||
{
|
||||
if (!JSVAL_IS_STRING(aID)) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
nsresult result;
|
||||
nsCOMPtr<nsIDOMElement> element;
|
||||
char* str = JS_GetStringBytes(JSVAL_TO_STRING(aID));
|
||||
|
|
|
@ -606,6 +606,10 @@ nsHTMLFormElement::EnumerateProperty(JSContext *aContext, JSObject *aObj)
|
|||
PRBool
|
||||
nsHTMLFormElement::Resolve(JSContext *aContext, JSObject *aObj, jsval aID)
|
||||
{
|
||||
if (!JSVAL_IS_STRING(aID)) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PRBool ret;
|
||||
JSObject* obj;
|
||||
char* str = JS_GetStringBytes(JS_ValueToString(aContext, aID));
|
||||
|
|
|
@ -2620,6 +2620,10 @@ nsHTMLDocument::GetScriptObject(nsIScriptContext *aContext, void** aScriptObject
|
|||
PRBool
|
||||
nsHTMLDocument::Resolve(JSContext *aContext, JSObject *aObj, jsval aID)
|
||||
{
|
||||
if (!JSVAL_IS_STRING(aID)) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
nsresult result;
|
||||
nsCOMPtr<nsIDOMElement> element;
|
||||
char* str = JS_GetStringBytes(JSVAL_TO_STRING(aID));
|
||||
|
|
Загрузка…
Ссылка в новой задаче