mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +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;
|
||||
}
|
||||
} else {
|
||||
// Default class constructors should always haveSource.
|
||||
MOZ_ASSERT(!fun->infallibleIsDefaultClassConstructor(cx));
|
||||
// Default class constructors should always haveSource unless source
|
||||
// has been discarded for the whole compartment.
|
||||
MOZ_ASSERT(!fun->infallibleIsDefaultClassConstructor(cx) ||
|
||||
fun->compartment()->behaviors().discardSource());
|
||||
|
||||
if (!AppendPrelude() ||
|
||||
!out.append("() {\n "))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue