mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 708819 - Avoid recursion through Error.prototype.toString/toSource r=luke
--HG-- extra : rebase_source : 7e6437b497886bbd8109a6c8a392923fff537c84
This commit is contained in:
parent
46fa50e1b0
commit
1f4f431168
12
js/src/jit-test/tests/basic/bug708819.js
Normal file
12
js/src/jit-test/tests/basic/bug708819.js
Normal file
@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/licenses/publicdomain/
|
||||
*/
|
||||
|
||||
try {
|
||||
var e = new Error();
|
||||
e.name = e;
|
||||
"" + e;
|
||||
} catch (e) {
|
||||
assertEq(e.message, 'too much recursion');
|
||||
}
|
@ -803,6 +803,7 @@ Exception(JSContext *cx, uintN argc, Value *vp)
|
||||
static JSBool
|
||||
exn_toString(JSContext *cx, uintN argc, Value *vp)
|
||||
{
|
||||
JS_CHECK_RECURSION(cx, return false);
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
|
||||
/* Step 2. */
|
||||
@ -881,6 +882,7 @@ exn_toString(JSContext *cx, uintN argc, Value *vp)
|
||||
static JSBool
|
||||
exn_toSource(JSContext *cx, uintN argc, Value *vp)
|
||||
{
|
||||
JS_CHECK_RECURSION(cx, return false);
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
|
||||
JSObject *obj = ToObject(cx, &args.thisv());
|
||||
|
Loading…
Reference in New Issue
Block a user