summaryrefslogtreecommitdiffstats
path: root/js/src/jsfun.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsfun.cpp')
-rw-r--r--js/src/jsfun.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp
index 0886923fd..06dc40162 100644
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -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 "))