summaryrefslogtreecommitdiffstats
path: root/js/src/jsatom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsatom.cpp')
-rw-r--r--js/src/jsatom.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/js/src/jsatom.cpp b/js/src/jsatom.cpp
index 3f8e8d8f8..2a3c58638 100644
--- a/js/src/jsatom.cpp
+++ b/js/src/jsatom.cpp
@@ -510,6 +510,14 @@ ToAtomSlow(ExclusiveContext* cx, typename MaybeRooted<Value, allowGC>::HandleTyp
return v.toBoolean() ? cx->names().true_ : cx->names().false_;
if (v.isNull())
return cx->names().null;
+ if (v.isSymbol()) {
+ if (cx->shouldBeJSContext() && allowGC) {
+ JS_ReportErrorNumberASCII(cx->asJSContext(), GetErrorMessage, nullptr,
+ JSMSG_SYMBOL_TO_STRING);
+ }
+ return nullptr;
+ }
+ MOZ_ASSERT(v.isUndefined());
return cx->names().undefined;
}