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

[ts] Support private methods overloads #13876

Merged
merged 4 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add transform tests
  • Loading branch information
nicolo-ribaudo committed Oct 23, 2021
commit 053e45dbf131643c0a0450a5a88c1adabf3dbc73
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Test {
#f(x: string): number;
#f(x: number): string;
#f(x: string | number): string | number {
return (typeof x === 'string') ? parseInt(x) : x.toString();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["transform-typescript", "proposal-private-methods"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var _f = /*#__PURE__*/new WeakSet();

class Test {
constructor() {
babelHelpers.classPrivateMethodInitSpec(this, _f);
}

}

function _f2(x) {
return typeof x === 'string' ? parseInt(x) : x.toString();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Test {
#f(x: string): number;
#f(x: number): string;
#f(x: string | number): string | number {
return (typeof x === 'string') ? parseInt(x) : x.toString();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["transform-typescript"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Test {
#f(x) {
return typeof x === 'string' ? parseInt(x) : x.toString();
}

}