archives

« Bugzilla Issues Index

#4534 — Is SetFunctionName() a static or a dynamic feature?


http://www.ecma-international.org/ecma-262/6.0/#sec-assignment-operators-runtime-semantics-evaluation

Is SetFunctionName() a static or a dynamic feature?

* If it is a static feature: why the dynamic check `HasOwnProperty(rval, "name")`?
* If it is a dynamic feature: why a static check that only allows anonymous function expressions (vs. allowing arbitrary expressions and checking dynamically whether they evaluate to a function without a name)?


It is a mostly static feature, the dynamic HasOwnProperty check is only needed for classes with static methods whose property name is computed. In all other cases the HasOwnProperty call can be omitted.