ecma262 icon indicating copy to clipboard operation
ecma262 copied to clipboard

Normative: Add missing function name for Iterator.prototype[Symbol.toStringTag] accessors

Open anba opened this issue 5 months ago • 3 comments

The function name must be explicitly specified for methods whose property key is a Symbol value.

anba avatar Jun 11 '25 08:06 anba

JSC doesn't assign the expected name:

>>> Object.getOwnPropertyDescriptor(Iterator.prototype, Symbol.toStringTag).get.name
"get "
>>> Object.getOwnPropertyDescriptor(Iterator.prototype, Symbol.toStringTag).set.name
"set "

anba avatar Jun 11 '25 08:06 anba

oof. does test262 not have tests covering the name?

ljharb avatar Jun 11 '25 11:06 ljharb

I don't think there's test262 coverage for this. Or at least I don't see any coverage in https://github.com/tc39/test262/tree/main/test/built-ins/Iterator/prototype/Symbol.toStringTag. (I'm currently exploring if it's possible to generate tests for "name" and "length" properties of built-in functions, that's why I found this bug.)

anba avatar Jun 11 '25 11:06 anba