Bug 1574180 - Part 4: Update comment for "name" property of TypeErrorThrower. r=khyperia

Depends on D42155

Differential Revision: https://phabricator.services.mozilla.com/D42156

--HG--
extra : moz-landing-system : lando
This commit is contained in:
André Bargull 2019-08-16 20:19:23 +00:00
parent 2900da90f1
commit 6449cb3bd4

View File

@ -500,10 +500,8 @@ JSObject* GlobalObject::getOrCreateThrowTypeError(
}
MOZ_ASSERT(lengthResult);
// Non-standard: Also change "name" to non-configurable. ECMAScript defines
// %ThrowTypeError% as an anonymous function, i.e. it shouldn't actually
// get an own "name" property. To be consistent with other built-in,
// anonymous functions, we don't delete %ThrowTypeError%'s "name" property.
// The "name" property of %ThrowTypeError% is non-configurable, adjust
// the default property attributes accordingly.
RootedId nameId(cx, NameToId(cx->names().name));
ObjectOpResult nameResult;
if (!NativeDefineProperty(cx, throwTypeError, nameId, nonConfigurableDesc,