@@ -300,6 +300,23 @@ class DDGRuntimeChecks extends HTMLElement {
300
300
return super [ method ] ( ...args )
301
301
}
302
302
303
+ _callSetter ( prop , value ) {
304
+ const el = this . _getElement ( )
305
+ if ( el ) {
306
+ el [ prop ] = value
307
+ return
308
+ }
309
+ super [ prop ] = value
310
+ }
311
+
312
+ _callGetter ( prop ) {
313
+ const el = this . _getElement ( )
314
+ if ( el ) {
315
+ return el [ prop ]
316
+ }
317
+ return super [ prop ]
318
+ }
319
+
303
320
/* Native DOM element methods we're capturing to supplant values into the constructed node or store data for. */
304
321
305
322
set src ( value ) {
@@ -505,19 +522,20 @@ function overloadGetOwnPropertyDescriptor () {
505
522
const capturedInterfaceOut = { ...capturedInterface }
506
523
if ( capturedInterface . get ) {
507
524
capturedInterfaceOut . get = wrapFunction ( function ( ) {
525
+ let method = capturedInterface . get
508
526
if ( isRuntimeElement ( this ) ) {
509
- return this [ propertyName ]
527
+ method = ( ) => this . _callGetter ( propertyName )
510
528
}
511
- return capturedInterface . get . call ( this )
529
+ return method . call ( this )
512
530
} , capturedInterface . get )
513
531
}
514
532
if ( capturedInterface . set ) {
515
533
capturedInterfaceOut . set = wrapFunction ( function ( value ) {
534
+ let method = capturedInterface
516
535
if ( isRuntimeElement ( this ) ) {
517
- this [ interfaceName ] = value
518
- return
536
+ method = ( value ) => this . _callSetter ( propertyName , value )
519
537
}
520
- return capturedInterface . set . call ( this , [ value ] )
538
+ return method . call ( this , [ value ] )
521
539
} , capturedInterface . set )
522
540
}
523
541
return capturedInterfaceOut
0 commit comments