зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1369762 - Don't atomize empty function names when retrieving the unresolved name of a bound function. r=till
This commit is contained in:
Родитель
6663e29a55
Коммит
14cefed850
|
@ -1394,13 +1394,18 @@ JSFunction::getUnresolvedName(JSContext* cx, HandleFunction fun, MutableHandleAt
|
|||
// Bound functions are never unnamed.
|
||||
MOZ_ASSERT(name);
|
||||
|
||||
StringBuffer sb(cx);
|
||||
if (!sb.append(cx->names().boundWithSpace) || !sb.append(name))
|
||||
return false;
|
||||
JSAtom* boundName;
|
||||
if (name->length() > 0) {
|
||||
StringBuffer sb(cx);
|
||||
if (!sb.append(cx->names().boundWithSpace) || !sb.append(name))
|
||||
return false;
|
||||
|
||||
JSAtom* boundName = sb.finishAtom();
|
||||
if (!boundName)
|
||||
return false;
|
||||
boundName = sb.finishAtom();
|
||||
if (!boundName)
|
||||
return false;
|
||||
} else {
|
||||
boundName = cx->names().boundWithSpace;
|
||||
}
|
||||
|
||||
v.set(boundName);
|
||||
return true;
|
||||
|
|
Загрузка…
Ссылка в новой задаче