TypeScript/tests/baselines/reference/javascriptDefinePropertyPrototypeNonConstructor.types
Matthew Pietz dcaefe732e
Accept generics for defineProperty (#42424)
* Accept generics for defineProperty

Both `Object.defineProperty()` and `Object.defineProperties()` return their
first argument. Use a generic so that typings can be passed through.

* Update baselines

* update missed baseline

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-03-11 07:57:42 -08:00

27 lines
760 B
Plaintext

=== /a.js ===
function Graphic() {
>Graphic : typeof Graphic
}
Object.defineProperty(Graphic.prototype, "instance", {
>Object.defineProperty(Graphic.prototype, "instance", { get: function() { return this; }}) : any
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
>Object : ObjectConstructor
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
>Graphic.prototype : any
>Graphic : typeof Graphic
>prototype : any
>"instance" : "instance"
>{ get: function() { return this; }} : { get: () => this; }
get: function() {
>get : () => this
>function() { return this; } : () => this
return this;
>this : this
}
});