mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 898734 - Fix segfault in error handling. r=nmatsakis
--HG-- extra : rebase_source : dfecbc3c3150deb19e352a3d885e35f24983e2e9
This commit is contained in:
parent
2e263fa17d
commit
705f09f73c
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user