function nameDecorator(target: any, key: string): any {const descriptor: PropertyDescriptor = {writable: false};return descriptor;}test.name = 'dell lee';// 修改的并不是实例上的 name, 而是原型上的 namefunction nameDecorator(target: any, key: string): any {target[key] = 'lee';}// name 放在实例上class Test {@nameDecoratorname = 'Dell';}const test = new Test();console.log((test as any).__proto__.name);
