@@ -30,18 +30,8 @@ export function setClassMetadata(
30
30
return noSideEffects ( ( ) => {
31
31
const clazz = type as TypeWithMetadata ;
32
32
33
- // We determine whether a class has its own metadata by taking the metadata from the
34
- // parent constructor and checking whether it's the same as the subclass metadata below.
35
- // We can't use `hasOwnProperty` here because it doesn't work correctly in IE10 for
36
- // static fields that are defined by TS. See
37
- // https://github.com/angular/angular/pull/28439#issuecomment-459349218.
38
- const parentPrototype = clazz . prototype ? Object . getPrototypeOf ( clazz . prototype ) : null ;
39
- const parentConstructor : TypeWithMetadata | null =
40
- parentPrototype && parentPrototype . constructor ;
41
-
42
33
if ( decorators !== null ) {
43
- if ( clazz . decorators !== undefined &&
44
- ( ! parentConstructor || parentConstructor . decorators !== clazz . decorators ) ) {
34
+ if ( clazz . hasOwnProperty ( 'decorators' ) && clazz . decorators !== undefined ) {
45
35
clazz . decorators . push ( ...decorators ) ;
46
36
} else {
47
37
clazz . decorators = decorators ;
@@ -58,9 +48,7 @@ export function setClassMetadata(
58
48
// different decorator types. Decorators on individual fields are not merged, as it's
59
49
// also incredibly unlikely that a field will be decorated both with an Angular
60
50
// decorator and a non-Angular decorator that's also been downleveled.
61
- if ( clazz . propDecorators !== undefined &&
62
- ( ! parentConstructor ||
63
- parentConstructor . propDecorators !== clazz . propDecorators ) ) {
51
+ if ( clazz . hasOwnProperty ( 'propDecorators' ) && clazz . propDecorators !== undefined ) {
64
52
clazz . propDecorators = { ...clazz . propDecorators , ...propDecorators } ;
65
53
} else {
66
54
clazz . propDecorators = propDecorators ;
0 commit comments