@@ -180,11 +180,11 @@ export var py_metatype = {
180180 for ( var index = bases . length - 1 ; index >= 0 ; index -- ) { // Reversed order, since class vars of first base should win
181181 var base = bases [ index ] ;
182182 for ( var attrib in base ) {
183- var descrip = Object . getOwnPropertyDescriptor ( base , attrib ) ;
183+ var descrip = Object . getOwnPropertyDescriptor ( base , attrib ) || { } ;
184184 Object . defineProperty ( cls , attrib , descrip ) ;
185185 }
186186 for ( let symbol of Object . getOwnPropertySymbols ( base ) ) {
187- let descrip = Object . getOwnPropertyDescriptor ( base , symbol ) ;
187+ let descrip = Object . getOwnPropertyDescriptor ( base , symbol ) || { } ;
188188 Object . defineProperty ( cls , symbol , descrip ) ;
189189 }
190190 }
@@ -196,11 +196,11 @@ export var py_metatype = {
196196
197197 // Add own methods, properties and own static attributes to the created cls object
198198 for ( var attrib in attribs ) {
199- var descrip = Object . getOwnPropertyDescriptor ( attribs , attrib ) ;
199+ var descrip = Object . getOwnPropertyDescriptor ( attribs , attrib ) || { } ; // As the descriptor can be undefined
200200 Object . defineProperty ( cls , attrib , descrip ) ;
201201 }
202202 for ( let symbol of Object . getOwnPropertySymbols ( attribs ) ) {
203- let descrip = Object . getOwnPropertyDescriptor ( attribs , symbol ) ;
203+ let descrip = Object . getOwnPropertyDescriptor ( attribs , symbol ) || { } ;
204204 Object . defineProperty ( cls , symbol , descrip ) ;
205205 }
206206
0 commit comments