mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
Bug 1177907 - Handle ObjectClassIs exception in date_toString. r=till
--HG-- extra : rebase_source : ae93a8075b640110c0e2ffa9af329bc2ee97ee98
This commit is contained in:
parent
9bb1d88ef2
commit
c85151b95d
4
js/src/jit-test/tests/basic/bug1177907.js
Normal file
4
js/src/jit-test/tests/basic/bug1177907.js
Normal file
@ -0,0 +1,4 @@
|
||||
// |jit-test| error: InternalError
|
||||
|
||||
var Date_toString = newGlobal().Date.prototype.toString;
|
||||
(function f(){ f(Date_toString.call({})); })();
|
@ -2883,9 +2883,13 @@ date_toString(JSContext* cx, unsigned argc, Value* vp)
|
||||
if (ObjectClassIs(obj, ESClass_Date, cx)) {
|
||||
// Step 3.a.
|
||||
RootedValue unboxed(cx);
|
||||
Unbox(cx, obj, &unboxed);
|
||||
if (!Unbox(cx, obj, &unboxed))
|
||||
return false;
|
||||
tv = unboxed.toNumber();
|
||||
}
|
||||
// ObjectClassIs can throw for objects from other compartments.
|
||||
if (cx->isExceptionPending())
|
||||
return false;
|
||||
}
|
||||
// Step 4.
|
||||
return date_format(cx, tv, FORMATSPEC_FULL, args.rval());
|
||||
|
Loading…
x
Reference in New Issue
Block a user