mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 19:47:32 +09:00
1359622 - Fix assert for calling Function.toString on class constructors when the compartment has had source discarded.
This commit is contained in:
parent
3f8f224e12
commit
6d7cc2b0ab
2 changed files with 8 additions and 2 deletions
4
js/src/jit-test/tests/class/bug1359622.js
Normal file
4
js/src/jit-test/tests/class/bug1359622.js
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
setDiscardSource(true)
|
||||||
|
evaluate(`
|
||||||
|
unescape(class get { static staticMethod() {} });
|
||||||
|
`);
|
||||||
|
|
@ -1022,8 +1022,10 @@ js::FunctionToString(JSContext* cx, HandleFunction fun, bool prettyPrint)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Default class constructors should always haveSource.
|
// Default class constructors should always haveSource unless source
|
||||||
MOZ_ASSERT(!fun->infallibleIsDefaultClassConstructor(cx));
|
// has been discarded for the whole compartment.
|
||||||
|
MOZ_ASSERT(!fun->infallibleIsDefaultClassConstructor(cx) ||
|
||||||
|
fun->compartment()->behaviors().discardSource());
|
||||||
|
|
||||||
if (!AppendPrelude() ||
|
if (!AppendPrelude() ||
|
||||||
!out.append("() {\n "))
|
!out.append("() {\n "))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue