diff options
Diffstat (limited to 'js/src/jsatom.cpp')
-rw-r--r-- | js/src/jsatom.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/js/src/jsatom.cpp b/js/src/jsatom.cpp index 3f8e8d8f81..2a3c58638a 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; } |