archives

« Bugzilla Issues Index

#4267 — %ThrowTypeError% has a mutable name property


The %ThrowTypeError% function is supposed to be a frozen function so that it cannot be used as a side channel. However, in ES6 we added a configurable name property to all functions.

(We also made length configurable but that case is handled in the spec already.)


%ThrowTypeError% does not have an own .name property per 9.2.7.1 + 19.2.4.2:

> 9.2.7.1 %ThrowTypeError% ( )
> The %ThrowTypeError% intrinsic is an anonymous built-in function object [...]

> 19.2.4.2 name
> Anonymous functions objects that do not have a contextual name associated with them by this
> specification do not have a name own property but inherit the name property of
> %FunctionPrototype%.


Thanks André. Crisis averted.


(In reply to Erik Arvidsson from comment #2)
> Thanks André. Crisis averted.

:-D