Bug 791845 - mozMatchesSelectorStub should return false on error. r=bholley

This commit is contained in:
Gabor Krizsanits 2012-09-19 10:53:42 +02:00
Родитель 6f9d988c50
Коммит f7c3bb7006
3 изменённых файлов: 21 добавлений и 2 удалений

Просмотреть файл

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<script>
function boom()
{
var ms = Components.lookupMethod(document.documentElement, "mozMatchesSelector");
ms.apply({});
}
</script>
</head>
<body onload="boom();"></body>
</html>

Просмотреть файл

@ -45,3 +45,4 @@ asserts(1) load 753162.html # We hit bug 675518 or bug 680086 here.
load 754311.html
load 776328.html
load 776333.html
load 791845.html

Просмотреть файл

@ -653,9 +653,11 @@ Is(JSObject *wrapper)
static JSBool
mozMatchesSelectorStub(JSContext *cx, unsigned argc, jsval *vp)
{
if (argc < 1)
if (argc < 1) {
JS_ReportError(cx, "Not enough arguments");
return false;
}
JSObject *wrapper = JS_THIS_OBJECT(cx, vp);
JSString *selector = JS_ValueToString(cx, JS_ARGV(cx, vp)[0]);
nsDependentJSString selectorStr;