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>
This commit is contained in:
parent
71661b932a
commit
dcaefe732e
4
src/lib/es5.d.ts
vendored
4
src/lib/es5.d.ts
vendored
|
@ -177,14 +177,14 @@ interface ObjectConstructor {
|
|||
* @param p The property name.
|
||||
* @param attributes Descriptor for the property. It can be for a data property or an accessor property.
|
||||
*/
|
||||
defineProperty(o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): any;
|
||||
defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;
|
||||
|
||||
/**
|
||||
* Adds one or more properties to an object, and/or modifies attributes of existing properties.
|
||||
* @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.
|
||||
* @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.
|
||||
*/
|
||||
defineProperties(o: any, properties: PropertyDescriptorMap & ThisType<any>): any;
|
||||
defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;
|
||||
|
||||
/**
|
||||
* Prevents the modification of attributes of existing properties, and prevents the addition of new properties.
|
||||
|
|
|
@ -175,10 +175,10 @@ m2.setonlyAccessor = 0;
|
|||
|
||||
=== tests/cases/conformance/jsdoc/mod1.js ===
|
||||
Object.defineProperty(exports, "thing", { value: 42, writable: true });
|
||||
>Object.defineProperty(exports, "thing", { value: 42, writable: true }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(exports, "thing", { value: 42, writable: true }) : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>exports : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>"thing" : "thing"
|
||||
>{ value: 42, writable: true } : { value: number; writable: true; }
|
||||
|
@ -188,10 +188,10 @@ Object.defineProperty(exports, "thing", { value: 42, writable: true });
|
|||
>true : true
|
||||
|
||||
Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false });
|
||||
>Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }) : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>exports : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>"readonlyProp" : "readonlyProp"
|
||||
>{ value: "Smith", writable: false } : { value: string; writable: false; }
|
||||
|
@ -201,10 +201,10 @@ Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false
|
|||
>false : false
|
||||
|
||||
Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } });
|
||||
>Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>exports : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>"rwAccessors" : "rwAccessors"
|
||||
>{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get(): number; set(_: any): void; }
|
||||
|
@ -214,10 +214,10 @@ Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) {
|
|||
>_ : any
|
||||
|
||||
Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } });
|
||||
>Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }) : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>exports : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>"readonlyAccessor" : "readonlyAccessor"
|
||||
>{ get() { return 21.75 } } : { get(): number; }
|
||||
|
@ -225,10 +225,10 @@ Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } });
|
|||
>21.75 : 21.75
|
||||
|
||||
Object.defineProperty(exports, "setonlyAccessor", {
|
||||
>Object.defineProperty(exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>exports : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>"setonlyAccessor" : "setonlyAccessor"
|
||||
>{ /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }} : { set(str: string): void; }
|
||||
|
@ -251,10 +251,10 @@ Object.defineProperty(exports, "setonlyAccessor", {
|
|||
|
||||
=== tests/cases/conformance/jsdoc/mod2.js ===
|
||||
Object.defineProperty(module.exports, "thing", { value: "yes", writable: true });
|
||||
>Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -266,10 +266,10 @@ Object.defineProperty(module.exports, "thing", { value: "yes", writable: true })
|
|||
>true : true
|
||||
|
||||
Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false });
|
||||
>Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -281,10 +281,10 @@ Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable
|
|||
>false : false
|
||||
|
||||
Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } });
|
||||
>Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -296,10 +296,10 @@ Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, s
|
|||
>_ : any
|
||||
|
||||
Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } });
|
||||
>Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -309,10 +309,10 @@ Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75
|
|||
>21.75 : 21.75
|
||||
|
||||
Object.defineProperty(module.exports, "setonlyAccessor", {
|
||||
>Object.defineProperty(module.exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
|
|
@ -129,9 +129,9 @@ Person.prototype.describe = function () {
|
|||
};
|
||||
Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true });
|
||||
>Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Person.prototype : any
|
||||
>Person : typeof Person
|
||||
>prototype : any
|
||||
|
@ -144,9 +144,9 @@ Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true });
|
|||
|
||||
Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false });
|
||||
>Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Person.prototype : any
|
||||
>Person : typeof Person
|
||||
>prototype : any
|
||||
|
@ -159,9 +159,9 @@ Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writab
|
|||
|
||||
Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } });
|
||||
>Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Person.prototype : any
|
||||
>Person : typeof Person
|
||||
>prototype : any
|
||||
|
@ -174,9 +174,9 @@ Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 },
|
|||
|
||||
Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } });
|
||||
>Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Person.prototype : any
|
||||
>Person : typeof Person
|
||||
>prototype : any
|
||||
|
@ -187,9 +187,9 @@ Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.
|
|||
|
||||
Object.defineProperty(Person.prototype, "setonlyAccessor", {
|
||||
>Object.defineProperty(Person.prototype, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Person.prototype : any
|
||||
>Person : typeof Person
|
||||
>prototype : any
|
||||
|
|
|
@ -88,10 +88,10 @@ const x = {};
|
|||
>{} : {}
|
||||
|
||||
Object.defineProperty(x, "name", { value: "Charles", writable: true });
|
||||
>Object.defineProperty(x, "name", { value: "Charles", writable: true }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(x, "name", { value: "Charles", writable: true }) : typeof x
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>x : typeof x
|
||||
>"name" : "name"
|
||||
>{ value: "Charles", writable: true } : { value: string; writable: true; }
|
||||
|
@ -101,10 +101,10 @@ Object.defineProperty(x, "name", { value: "Charles", writable: true });
|
|||
>true : true
|
||||
|
||||
Object.defineProperty(x, "middleInit", { value: "H" });
|
||||
>Object.defineProperty(x, "middleInit", { value: "H" }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(x, "middleInit", { value: "H" }) : typeof x
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>x : typeof x
|
||||
>"middleInit" : "middleInit"
|
||||
>{ value: "H" } : { value: string; }
|
||||
|
@ -112,10 +112,10 @@ Object.defineProperty(x, "middleInit", { value: "H" });
|
|||
>"H" : "H"
|
||||
|
||||
Object.defineProperty(x, "lastName", { value: "Smith", writable: false });
|
||||
>Object.defineProperty(x, "lastName", { value: "Smith", writable: false }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(x, "lastName", { value: "Smith", writable: false }) : typeof x
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>x : typeof x
|
||||
>"lastName" : "lastName"
|
||||
>{ value: "Smith", writable: false } : { value: string; writable: false; }
|
||||
|
@ -125,10 +125,10 @@ Object.defineProperty(x, "lastName", { value: "Smith", writable: false });
|
|||
>false : false
|
||||
|
||||
Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } });
|
||||
>Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }) : typeof x
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>x : typeof x
|
||||
>"zip" : "zip"
|
||||
>{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get(): number; set(_: any): void; }
|
||||
|
@ -138,10 +138,10 @@ Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ }
|
|||
>_ : any
|
||||
|
||||
Object.defineProperty(x, "houseNumber", { get() { return 21.75 } });
|
||||
>Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }) : typeof x
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>x : typeof x
|
||||
>"houseNumber" : "houseNumber"
|
||||
>{ get() { return 21.75 } } : { get(): number; }
|
||||
|
@ -149,10 +149,10 @@ Object.defineProperty(x, "houseNumber", { get() { return 21.75 } });
|
|||
>21.75 : 21.75
|
||||
|
||||
Object.defineProperty(x, "zipStr", {
|
||||
>Object.defineProperty(x, "zipStr", { /** @param {string} str */ set(str) { this.zip = Number(str) }}) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(x, "zipStr", { /** @param {string} str */ set(str) { this.zip = Number(str) }}) : typeof x
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>x : typeof x
|
||||
>"zipStr" : "zipStr"
|
||||
>{ /** @param {string} str */ set(str) { this.zip = Number(str) }} : { set(str: string): void; }
|
||||
|
|
|
@ -88,10 +88,10 @@ const obj = { value: 42, writable: true };
|
|||
>true : true
|
||||
|
||||
Object.defineProperty(exports, "thing", obj);
|
||||
>Object.defineProperty(exports, "thing", obj) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(exports, "thing", obj) : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>exports : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>"thing" : "thing"
|
||||
>obj : { value: number; writable: boolean; }
|
||||
|
@ -105,10 +105,10 @@ let str = /** @type {string} */("other");
|
|||
>"other" : "other"
|
||||
|
||||
Object.defineProperty(exports, str, { value: 42, writable: true });
|
||||
>Object.defineProperty(exports, str, { value: 42, writable: true }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(exports, str, { value: 42, writable: true }) : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>exports : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>str : string
|
||||
>{ value: 42, writable: true } : { value: number; writable: true; }
|
||||
|
@ -122,10 +122,10 @@ const propName = "prop"
|
|||
>"prop" : "prop"
|
||||
|
||||
Object.defineProperty(exports, propName, { value: 42, writable: true });
|
||||
>Object.defineProperty(exports, propName, { value: 42, writable: true }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(exports, propName, { value: 42, writable: true }) : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>exports : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>propName : "prop"
|
||||
>{ value: 42, writable: true } : { value: number; writable: true; }
|
||||
|
@ -136,19 +136,19 @@ Object.defineProperty(exports, propName, { value: 42, writable: true });
|
|||
|
||||
|
||||
Object.defineProperty(exports, "bad1", { });
|
||||
>Object.defineProperty(exports, "bad1", { }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(exports, "bad1", { }) : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>exports : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>"bad1" : "bad1"
|
||||
>{ } : {}
|
||||
|
||||
Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" });
|
||||
>Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }) : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>exports : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>"bad2" : "bad2"
|
||||
>{ get() { return 12 }, value: "no" } : { get(): number; value: string; }
|
||||
|
@ -158,10 +158,10 @@ Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" });
|
|||
>"no" : "no"
|
||||
|
||||
Object.defineProperty(exports, "bad3", { writable: true });
|
||||
>Object.defineProperty(exports, "bad3", { writable: true }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(exports, "bad3", { writable: true }) : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>exports : typeof import("tests/cases/conformance/jsdoc/mod1")
|
||||
>"bad3" : "bad3"
|
||||
>{ writable: true } : { writable: true; }
|
||||
|
|
|
@ -13,10 +13,10 @@ module.exports = 12;
|
|||
>12 : 12
|
||||
|
||||
Object.defineProperty(module, "exports", { value: "oh no" });
|
||||
>Object.defineProperty(module, "exports", { value: "oh no" }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module, "exports", { value: "oh no" }) : typeof module
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module : typeof module
|
||||
>"exports" : "exports"
|
||||
>{ value: "oh no" } : { value: string; }
|
||||
|
@ -58,10 +58,10 @@ B.NS = require("./namespacey");
|
|||
>"./namespacey" : "./namespacey"
|
||||
|
||||
Object.defineProperty(B, "NS", { value: "why though", writable: true });
|
||||
>Object.defineProperty(B, "NS", { value: "why though", writable: true }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(B, "NS", { value: "why though", writable: true }) : typeof B
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>B : typeof B
|
||||
>"NS" : "NS"
|
||||
>{ value: "why though", writable: true } : { value: string; writable: true; }
|
||||
|
|
|
@ -306,10 +306,10 @@ export class IterableWeakMap<K extends object, V> implements WeakMap<K, V> {
|
|||
}
|
||||
|
||||
Object.defineProperties(IterableWeakMap.prototype, {
|
||||
>Object.defineProperties(IterableWeakMap.prototype, { [Symbol.iterator]: { configurable: true, enumerable: false, writable: true, value: Object.getOwnPropertyDescriptor( IterableWeakMap.prototype, "entries", )!.value, }, [Symbol.toStringTag]: { configurable: true, enumerable: false, writable: false, value: "IterableWeakMap", },}) : any
|
||||
>Object.defineProperties : (o: any, properties: PropertyDescriptorMap & ThisType<any>) => any
|
||||
>Object.defineProperties(IterableWeakMap.prototype, { [Symbol.iterator]: { configurable: true, enumerable: false, writable: true, value: Object.getOwnPropertyDescriptor( IterableWeakMap.prototype, "entries", )!.value, }, [Symbol.toStringTag]: { configurable: true, enumerable: false, writable: false, value: "IterableWeakMap", },}) : IterableWeakMap<any, any>
|
||||
>Object.defineProperties : <T>(o: T, properties: PropertyDescriptorMap & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperties : (o: any, properties: PropertyDescriptorMap & ThisType<any>) => any
|
||||
>defineProperties : <T>(o: T, properties: PropertyDescriptorMap & ThisType<any>) => T
|
||||
>IterableWeakMap.prototype : IterableWeakMap<any, any>
|
||||
>IterableWeakMap : typeof IterableWeakMap
|
||||
>prototype : IterableWeakMap<any, any>
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
// Excess property error expected here
|
||||
Object.defineProperty(window, "prop", { value: "v1.0.0", readonly: false });
|
||||
>Object.defineProperty(window, "prop", { value: "v1.0.0", readonly: false }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(window, "prop", { value: "v1.0.0", readonly: false }) : Window & typeof globalThis
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>window : Window & typeof globalThis
|
||||
>"prop" : "prop"
|
||||
>{ value: "v1.0.0", readonly: false } : { value: string; readonly: boolean; }
|
||||
|
|
|
@ -8,10 +8,10 @@ function setFunc(v){}
|
|||
>v : any
|
||||
|
||||
Object.defineProperty({}, "0", <PropertyDescriptor>({
|
||||
>Object.defineProperty({}, "0", <PropertyDescriptor>({ get: getFunc, set: setFunc, configurable: true })) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty({}, "0", <PropertyDescriptor>({ get: getFunc, set: setFunc, configurable: true })) : {}
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>{} : {}
|
||||
>"0" : "0"
|
||||
><PropertyDescriptor>({ get: getFunc, set: setFunc, configurable: true }) : PropertyDescriptor
|
||||
|
|
|
@ -41,10 +41,10 @@ A.prototype.func = function() { this._func = 0; }
|
|||
>0 : 0
|
||||
|
||||
Object.defineProperty(A.prototype, "def", { value: 0 });
|
||||
>Object.defineProperty(A.prototype, "def", { value: 0 }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(A.prototype, "def", { value: 0 }) : A
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>A.prototype : A
|
||||
>A : typeof A
|
||||
>prototype : A
|
||||
|
|
|
@ -5,9 +5,9 @@ function Graphic() {
|
|||
|
||||
Object.defineProperty(Graphic.prototype, "instance", {
|
||||
>Object.defineProperty(Graphic.prototype, "instance", { get: function() { return this; }}) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Graphic.prototype : any
|
||||
>Graphic : typeof Graphic
|
||||
>prototype : any
|
||||
|
|
|
@ -5,10 +5,10 @@ class C {
|
|||
constructor() {
|
||||
// Neither of the following should be recognized as declarations yet
|
||||
Object.defineProperty(this, "_prop", { value: {} });
|
||||
>Object.defineProperty(this, "_prop", { value: {} }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(this, "_prop", { value: {} }) : this
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>this : this
|
||||
>"_prop" : "_prop"
|
||||
>{ value: {} } : { value: {}; }
|
||||
|
@ -17,9 +17,9 @@ class C {
|
|||
|
||||
Object.defineProperty(this._prop, "num", { value: 12 });
|
||||
>Object.defineProperty(this._prop, "num", { value: 12 }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>this._prop : any
|
||||
>this : this
|
||||
>_prop : any
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
=== tests/cases/conformance/jsdoc/declarations/index.js ===
|
||||
Object.defineProperty(module.exports, "a", { value: function a() {} });
|
||||
>Object.defineProperty(module.exports, "a", { value: function a() {} }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "a", { value: function a() {} }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -14,10 +14,10 @@ Object.defineProperty(module.exports, "a", { value: function a() {} });
|
|||
>a : () => void
|
||||
|
||||
Object.defineProperty(module.exports, "b", { value: function b() {} });
|
||||
>Object.defineProperty(module.exports, "b", { value: function b() {} }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "b", { value: function b() {} }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -28,10 +28,10 @@ Object.defineProperty(module.exports, "b", { value: function b() {} });
|
|||
>b : () => void
|
||||
|
||||
Object.defineProperty(module.exports.b, "cat", { value: "cat" });
|
||||
>Object.defineProperty(module.exports.b, "cat", { value: "cat" }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports.b, "cat", { value: "cat" }) : () => void
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports.b : () => void
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
|
@ -55,10 +55,10 @@ function d(a, b) { return /** @type {*} */(null); }
|
|||
>null : null
|
||||
|
||||
Object.defineProperty(module.exports, "d", { value: d });
|
||||
>Object.defineProperty(module.exports, "d", { value: d }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "d", { value: d }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -82,10 +82,10 @@ function e(a, b) { return /** @type {*} */(null); }
|
|||
>null : null
|
||||
|
||||
Object.defineProperty(module.exports, "e", { value: e });
|
||||
>Object.defineProperty(module.exports, "e", { value: e }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "e", { value: e }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -106,10 +106,10 @@ function f(a) {
|
|||
>a : T
|
||||
}
|
||||
Object.defineProperty(module.exports, "f", { value: f });
|
||||
>Object.defineProperty(module.exports, "f", { value: f }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "f", { value: f }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -119,10 +119,10 @@ Object.defineProperty(module.exports, "f", { value: f });
|
|||
>f : <T>(a: T) => T
|
||||
|
||||
Object.defineProperty(module.exports.f, "self", { value: module.exports.f });
|
||||
>Object.defineProperty(module.exports.f, "self", { value: module.exports.f }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports.f, "self", { value: module.exports.f }) : <T>(a: T) => T
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports.f : <T>(a: T) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
|
@ -157,10 +157,10 @@ function g(a, b) {
|
|||
>y : () => void
|
||||
}
|
||||
Object.defineProperty(module.exports, "g", { value: g });
|
||||
>Object.defineProperty(module.exports, "g", { value: g }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "g", { value: g }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -190,10 +190,10 @@ function hh(a, b) {
|
|||
>y : () => void
|
||||
}
|
||||
Object.defineProperty(module.exports, "h", { value: hh });
|
||||
>Object.defineProperty(module.exports, "h", { value: hh }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "h", { value: hh }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -203,10 +203,10 @@ Object.defineProperty(module.exports, "h", { value: hh });
|
|||
>hh : (a: { x: string; }, b: { y: () => void; }) => void
|
||||
|
||||
Object.defineProperty(module.exports, "i", { value: function i(){} });
|
||||
>Object.defineProperty(module.exports, "i", { value: function i(){} }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "i", { value: function i(){} }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -217,10 +217,10 @@ Object.defineProperty(module.exports, "i", { value: function i(){} });
|
|||
>i : () => void
|
||||
|
||||
Object.defineProperty(module.exports, "ii", { value: module.exports.i });
|
||||
>Object.defineProperty(module.exports, "ii", { value: module.exports.i }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "ii", { value: module.exports.i }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -235,10 +235,10 @@ Object.defineProperty(module.exports, "ii", { value: module.exports.i });
|
|||
|
||||
// note that this last one doesn't make much sense in cjs, since exports aren't hoisted bindings
|
||||
Object.defineProperty(module.exports, "jj", { value: module.exports.j });
|
||||
>Object.defineProperty(module.exports, "jj", { value: module.exports.j }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "jj", { value: module.exports.j }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -252,10 +252,10 @@ Object.defineProperty(module.exports, "jj", { value: module.exports.j });
|
|||
>j : () => void
|
||||
|
||||
Object.defineProperty(module.exports, "j", { value: function j() {} });
|
||||
>Object.defineProperty(module.exports, "j", { value: function j() {} }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, "j", { value: function j() {} }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
|
|
@ -41,10 +41,10 @@ export class D {}
|
|||
>D : D
|
||||
|
||||
Object.defineProperty(D.prototype, "x", {
|
||||
>Object.defineProperty(D.prototype, "x", { get() { return 12; }}) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(D.prototype, "x", { get() { return 12; }}) : D
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>D.prototype : D
|
||||
>D : typeof D
|
||||
>prototype : D
|
||||
|
@ -63,10 +63,10 @@ export class E {}
|
|||
>E : E
|
||||
|
||||
Object.defineProperty(E.prototype, "x", {
|
||||
>Object.defineProperty(E.prototype, "x", { /** * @param {number} _arg */ set(_arg) {}}) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(E.prototype, "x", { /** * @param {number} _arg */ set(_arg) {}}) : E
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>E.prototype : E
|
||||
>E : typeof E
|
||||
>prototype : E
|
||||
|
@ -86,10 +86,10 @@ export class F {}
|
|||
>F : F
|
||||
|
||||
Object.defineProperty(F.prototype, "x", {
|
||||
>Object.defineProperty(F.prototype, "x", { get() { return 12; }, /** * @param {number} _arg */ set(_arg) {}}) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(F.prototype, "x", { get() { return 12; }, /** * @param {number} _arg */ set(_arg) {}}) : F
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>F.prototype : F
|
||||
>F : typeof F
|
||||
>prototype : F
|
||||
|
|
|
@ -4,10 +4,10 @@ var chrome = {}
|
|||
>{} : {}
|
||||
|
||||
Object.defineProperty(chrome, 'devtools', { value: {}, enumerable: true })
|
||||
>Object.defineProperty(chrome, 'devtools', { value: {}, enumerable: true }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(chrome, 'devtools', { value: {}, enumerable: true }) : typeof chrome
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>chrome : typeof chrome
|
||||
>'devtools' : "devtools"
|
||||
>{ value: {}, enumerable: true } : { value: {}; enumerable: true; }
|
||||
|
|
|
@ -33,10 +33,10 @@ ChangeDetectionStrategy[ChangeDetectionStrategy.Default] = 'Default';
|
|||
>'Default' : "Default"
|
||||
|
||||
Object.defineProperty(ChangeDetectionStrategy, "aField", {value: 42});
|
||||
>Object.defineProperty(ChangeDetectionStrategy, "aField", {value: 42}) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(ChangeDetectionStrategy, "aField", {value: 42}) : { OnPush: number; Default: number; }
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>ChangeDetectionStrategy : { OnPush: number; Default: number; }
|
||||
>"aField" : "aField"
|
||||
>{value: 42} : { value: number; }
|
||||
|
|
|
@ -31,10 +31,10 @@ const _str = "my-fake-sym";
|
|||
>"my-fake-sym" : "my-fake-sym"
|
||||
|
||||
Object.defineProperty(module.exports, _sym, { value: "ok" });
|
||||
>Object.defineProperty(module.exports, _sym, { value: "ok" }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, _sym, { value: "ok" }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
@ -44,10 +44,10 @@ Object.defineProperty(module.exports, _sym, { value: "ok" });
|
|||
>"ok" : "ok"
|
||||
|
||||
Object.defineProperty(module.exports, _str, { value: "ok" });
|
||||
>Object.defineProperty(module.exports, _str, { value: "ok" }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(module.exports, _str, { value: "ok" }) : typeof module.exports
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>module.exports : typeof module.exports
|
||||
>module : { exports: typeof module.exports; }
|
||||
>exports : typeof module.exports
|
||||
|
|
|
@ -51,9 +51,9 @@ F.prototype.defsAClass = true;
|
|||
|
||||
Object.defineProperty(F.prototype, _str, {value: "ok"});
|
||||
>Object.defineProperty(F.prototype, _str, {value: "ok"}) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>F.prototype : any
|
||||
>F : typeof F
|
||||
>prototype : any
|
||||
|
@ -64,9 +64,9 @@ Object.defineProperty(F.prototype, _str, {value: "ok"});
|
|||
|
||||
Object.defineProperty(F.prototype, _sym, {value: "ok"});
|
||||
>Object.defineProperty(F.prototype, _sym, {value: "ok"}) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>F.prototype : any
|
||||
>F : typeof F
|
||||
>prototype : any
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
>{} : {}
|
||||
|
||||
Object.defineProperty(obj, "accProperty", <PropertyDescriptor>({
|
||||
>Object.defineProperty(obj, "accProperty", <PropertyDescriptor>({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } })) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty(obj, "accProperty", <PropertyDescriptor>({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } })) : {}
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>obj : {}
|
||||
>"accProperty" : "accProperty"
|
||||
><PropertyDescriptor>({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : PropertyDescriptor
|
||||
|
|
|
@ -90,9 +90,9 @@
|
|||
|
||||
Object.defineProperty(constructor.prototype, "constructor", { value: constructor, writable: true, configurable: true, enumerable: true });
|
||||
>Object.defineProperty(constructor.prototype, "constructor", { value: constructor, writable: true, configurable: true, enumerable: true }) : any
|
||||
>Object.defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>Object.defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>Object : ObjectConstructor
|
||||
>defineProperty : (o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => any
|
||||
>defineProperty : <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T
|
||||
>constructor.prototype : any
|
||||
>constructor : any
|
||||
>prototype : any
|
||||
|
|
4
tests/lib/lib.d.ts
vendored
4
tests/lib/lib.d.ts
vendored
|
@ -178,14 +178,14 @@ interface ObjectConstructor {
|
|||
* @param p The property name.
|
||||
* @param attributes Descriptor for the property. It can be for a data property or an accessor property.
|
||||
*/
|
||||
defineProperty(o: any, p: string, attributes: PropertyDescriptor): any;
|
||||
defineProperty<T>(o: T, p: string, attributes: PropertyDescriptor): T;
|
||||
|
||||
/**
|
||||
* Adds one or more properties to an object, and/or modifies attributes of existing properties.
|
||||
* @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.
|
||||
* @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.
|
||||
*/
|
||||
defineProperties(o: any, properties: PropertyDescriptorMap): any;
|
||||
defineProperties<T>(o: T, properties: PropertyDescriptorMap): T;
|
||||
|
||||
/**
|
||||
* Prevents the modification of attributes of existing properties, and prevents the addition of new properties.
|
||||
|
|
Loading…
Reference in a new issue