Skip to content

Conversation

@GeoffreyBooth
Copy link
Collaborator

Fixes #1768. So as Array:: isArray becomes Array.protoype.isArray, now Array:: ["isArray"] becomes Array.prototype["isArray"].

@GeoffreyBooth GeoffreyBooth requested a review from lydell August 30, 2017 05:22
Copy link
Collaborator

@lydell lydell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is fine.

(Just a random piece of trivia: Function.prototype is actually a ... function! A noop function, to be precise. Paste Function.prototype() in the console to try it out!)

@GeoffreyBooth
Copy link
Collaborator Author

GeoffreyBooth commented Aug 30, 2017

Are you sure?

~ node -e 'console.log(typeof String.toString)'
function
➜  ~ node -e 'console.log(typeof String.prototype)'
object

EDIT: Looks like Function.prototype is a function, but for any other core object I try—String.prototype, Array.prototype, Date.prototype, Buffer.prototype—the prototype is always an object.

@lydell
Copy link
Collaborator

lydell commented Aug 30, 2017

@GeoffreyBooth Yep, that's the way it is. Strange feature, huh?

@GeoffreyBooth
Copy link
Collaborator Author

arguments

@GeoffreyBooth GeoffreyBooth merged commit 906bedf into jashkenas:2 Aug 31, 2017
@GeoffreyBooth GeoffreyBooth deleted the prototypes-cant-call branch August 31, 2017 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants