observablehq / inspector

The Observable standard inspector.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Safari includes “bound ” in the name of bound functions.

mbostock opened this issue · comments

Which… is weird.

Promise.resolve.bind(Promise)
ƒ bound resolve()

And

Promise.resolve.bind(Promise).name
"bound resolve"

But

Promise.resolve.bind(Promise) + ""
`function resolve() {
    [native code]
}`

Not sure if we should workaround this or just let Safari be Safari.

This actually looks pretty uniform - MDN documents it and I can replicate in Chrome, Firefox, and Node that binding a method adds the bound prefix to its name.

I think... we have no responsibility to be pedantic about showing functions with exactly what function.name gives us, and we should remove the bound prefix. Eh?

Okay, we're following developer console precedent and keeping the bound in.