Closed Bug 1670502 Opened 4 years ago Closed 4 years ago

Object.getOwnPropertyDescriptor(RegExp, "$&").get.toString() should have the syntax of a NativeFunction

Categories

(Core :: JavaScript Engine, task)

task

Tracking

()

RESOLVED DUPLICATE of bug 1658492

People

(Reporter: Waldo, Unassigned)

Details

js> Object.getOwnPropertyDescriptor(RegExp, "$&").get.toString()
"function $&() {\n    [native code]\n}"

But the spec (and test262, as of recently) wants that string to match NativeFunction syntax, which requires that $& be a valid identifier -- but of course & is not a valid identifier character.

I don't know what other engines use as function name for this function. I think this is an annex B thing, so it's possible they don't support this. Alternatively, I think these garbage names are aliases of stuff like RegEp.leftContext or whatever, so maybe other engines use those names. Should be simple enough to figure out with a little investigation.

Blocks: test262

Agreed.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
No longer blocks: test262
You need to log in before you can comment on or make changes to this bug.