Bug 898734 - Fix segfault in error handling. r=nmatsakis

--HG--
extra : rebase_source : dfecbc3c3150deb19e352a3d885e35f24983e2e9
This commit is contained in:
Nikhil Marathe 2013-07-29 10:28:03 -07:00
parent 2e263fa17d
commit 705f09f73c
2 changed files with 3 additions and 3 deletions

View File

@ -410,10 +410,8 @@ NumericType<T>::call(JSContext *cx, unsigned argc, Value *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
if (args.length() < 1) {
char *fnName = JS_EncodeString(cx, args.callee().as<JSFunction>().atom());
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_MORE_ARGS_NEEDED,
fnName, "0", "s");
JS_free(cx, (void *) fnName);
args.callee().getClass()->name, "0", "s");
return false;
}

View File

@ -85,6 +85,7 @@ function runTests()
check(function() type(/abcd/) == 0);
checkThrows(function() new type());
checkThrows(function() type());
}
var floatTypes = [float32, float64];
@ -105,6 +106,7 @@ function runTests()
check(function() Number.isNaN(type(/abcd/)));
checkThrows(function() new type());
checkThrows(function() type());
}
///// test ranges and creation