Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Fix code sample #1315

Closed
wants to merge 1 commit into from
Closed

Fix code sample #1315

wants to merge 1 commit into from

Conversation

crookedneighbor
Copy link

@crookedneighbor crookedneighbor commented Apr 9, 2020

Was reading through the documentation and came across the code examples here: https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html#no-implicit-any-for-this

interface Point {
    distanceFromOrigin(point: Point): number;
}
Point.prototype.distanceFromOrigin = function(point: Point) {
    return this.getDistance({ x: 0, y: 0});
}
Point.prototype.distanceFromOrigin = function(this: Point) {
    return this.getDistance({ x: 0, y: 0});
}

Trying to make sense of what the point: Point is supposed to be doing. It looks like it's an argument for the function, but the function doesn't use it. I suspect it's a typo, but would love to know for sure.

This PR removes it, under the assumption that it is a typo.

@crookedneighbor
Copy link
Author

👋 any update on this?

@orta
Copy link
Contributor

orta commented Apr 20, 2020

This repo is basically deprecated now that all the handbook has moved into v2 - my plan was to try and manually merge all the changes into the new pages when #1313 is merged

@crookedneighbor
Copy link
Author

@orta is there a separate place to PR? Happy to open a PR elsewhere if that's easier.

@orta
Copy link
Contributor

orta commented Apr 21, 2020

@crookedneighbor
Copy link
Author

That's great, thanks for the link. Here's the new PR microsoft/TypeScript-Website#540

I'll close this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants