Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement declaration emit for accessors in the js declaration emitter (
#33649) * Implement declaration emit for accessors in the js declaration emitter * Use `or`
- Loading branch information
Showing
8 changed files
with
503 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
tests/baselines/reference/jsDeclarationsGetterSetter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
//// [index.js] | ||
export class A { | ||
get x() { | ||
return 12; | ||
} | ||
} | ||
|
||
export class B { | ||
/** | ||
* @param {number} _arg | ||
*/ | ||
set x(_arg) { | ||
} | ||
} | ||
|
||
export class C { | ||
get x() { | ||
return 12; | ||
} | ||
set x(_arg) { | ||
} | ||
} | ||
|
||
export class D {} | ||
Object.defineProperty(D.prototype, "x", { | ||
get() { | ||
return 12; | ||
} | ||
}); | ||
|
||
export class E {} | ||
Object.defineProperty(E.prototype, "x", { | ||
/** | ||
* @param {number} _arg | ||
*/ | ||
set(_arg) {} | ||
}); | ||
|
||
export class F {} | ||
Object.defineProperty(F.prototype, "x", { | ||
get() { | ||
return 12; | ||
}, | ||
/** | ||
* @param {number} _arg | ||
*/ | ||
set(_arg) {} | ||
}); | ||
|
||
|
||
//// [index.js] | ||
export class A { | ||
get x() { | ||
return 12; | ||
} | ||
} | ||
export class B { | ||
/** | ||
* @param {number} _arg | ||
*/ | ||
set x(_arg) { | ||
} | ||
} | ||
export class C { | ||
get x() { | ||
return 12; | ||
} | ||
set x(_arg) { | ||
} | ||
} | ||
export class D { | ||
} | ||
Object.defineProperty(D.prototype, "x", { | ||
get() { | ||
return 12; | ||
} | ||
}); | ||
export class E { | ||
} | ||
Object.defineProperty(E.prototype, "x", { | ||
/** | ||
* @param {number} _arg | ||
*/ | ||
set(_arg) { } | ||
}); | ||
export class F { | ||
} | ||
Object.defineProperty(F.prototype, "x", { | ||
get() { | ||
return 12; | ||
}, | ||
/** | ||
* @param {number} _arg | ||
*/ | ||
set(_arg) { } | ||
}); | ||
|
||
|
||
//// [index.d.ts] | ||
export class A { | ||
get x(): number; | ||
} | ||
export class B { | ||
/** | ||
* @param {number} _arg | ||
*/ | ||
set x(arg: number); | ||
} | ||
export class C { | ||
set x(arg: number); | ||
get x(): number; | ||
} | ||
export class D { | ||
get x(): number; | ||
} | ||
export class E { | ||
set x(arg: number); | ||
} | ||
export class F { | ||
set x(arg: number); | ||
get x(): number; | ||
} |
Oops, something went wrong.