jasnell / proposal-istypes

TC-39 Proposal for additional is{Type} APIs
201 stars 7 forks source link

Would `is` and `typeof` be *configurable* properties of `Builtins`? #18

Closed bengl closed 7 years ago

bengl commented 7 years ago

I think there are scenarios in which there would be reasons to override/replace these functions.

jasnell commented 7 years ago

Yes, they would be configurable and enumerable.

pitaj commented 7 years ago

I disagree. I think these functions should be trustworthy in every circumstance.

bengl commented 7 years ago

@pitaj Compare with Reflect, where everything is configurable.

ljharb commented 7 years ago

@pitaj just like everything in JS, if your code runs first, you can get and hold a reference to it.

Almost everything must be configurable, for polyfills and security reasons. There are very few exceptions to that have a remote chance of getting through committee.

jasnell commented 7 years ago

Closing as answered :-)