Browse Source

Merge pull request #1325 from sebavan/DecoratorsInheritance

Prevent override of decorators through inheritance
Raanan Weber 9 năm trước cách đây
mục cha
commit
1c2c4e153c
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      src/Tools/babylon.decorators.ts

+ 3 - 1
src/Tools/babylon.decorators.ts

@@ -5,7 +5,9 @@
                 target.__serializableMembers = {};
             }
 
-            target.__serializableMembers[propertyKey] = { type: type, sourceName: sourceName };
+            if (!target.__serializableMembers[propertyKey]) {
+                target.__serializableMembers[propertyKey] = { type: type, sourceName: sourceName };
+            }
         }
     }