(prototype: object, annotation: Annotation, key: PropertyKey)
| 51 | } |
| 52 | |
| 53 | function assertNotDecorated(prototype: object, annotation: Annotation, key: PropertyKey) { |
| 54 | if (__DEV__ && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) { |
| 55 | const fieldName = `${prototype.constructor.name}.prototype.${key.toString()}` |
| 56 | const currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_ |
| 57 | const requestedAnnotationType = annotation.annotationType_ |
| 58 | die( |
| 59 | `Cannot apply '@${requestedAnnotationType}' to '${fieldName}':` + |
| 60 | `\nThe field is already decorated with '@${currentAnnotationType}'.` + |
| 61 | `\nRe-decorating fields is not allowed.` + |
| 62 | `\nUse '@override' decorator for methods overridden by subclass.` |
| 63 | ) |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Collects annotations from prototypes and stores them on target (instance) |
no test coverage detected
searching dependent graphs…