mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
30 lines
635 B
TypeScript
30 lines
635 B
TypeScript
//// [tests/cases/compiler/checkingObjectDefinePropertyOnFunctionNonexistentPropertyNoCrash1.ts] ////
|
|
|
|
//// [index.js]
|
|
export function test(fn) {
|
|
const composed = function (...args) { }
|
|
|
|
Object.defineProperty(composed, 'name', {
|
|
value: composed.fn + '_test'
|
|
})
|
|
|
|
return composed
|
|
}
|
|
|
|
|
|
//// [index.js]
|
|
export function test(fn) {
|
|
const composed = function (...args) { };
|
|
Object.defineProperty(composed, 'name', {
|
|
value: composed.fn + '_test'
|
|
});
|
|
return composed;
|
|
}
|
|
|
|
|
|
//// [index.d.ts]
|
|
export declare function test(fn: any): {
|
|
(...args: any[]): void;
|
|
readonly name: string;
|
|
};
|