Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CS2] Fix #1768: Ignore space after :: #4670

Merged
merged 1 commit into from
Aug 31, 2017

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