mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-11-02 12:37:31 +09:00
Bug 1317309: Throw a TypeError when passing a Symbol value to ToAtom
Issue #78 [Depends on] Bug 883377: Implement ES6 function "name" property semantics
This commit is contained in:
parent
3b1c3ec605
commit
3b34f87a5b
4 changed files with 45 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue