@@ -11,7 +11,7 @@ import { addErrorComponentStack } from '../shared/error';
11
11
import { evaluateTemplate , setVMBeingRendered , getVMBeingRendered } from './template' ;
12
12
import { runWithBoundaryProtection } from './vm' ;
13
13
import { logOperationStart , logOperationEnd , OperationId } from './profiler' ;
14
- import { LightningElement } from './base-lightning-element' ;
14
+ import type { LightningElement } from './base-lightning-element' ;
15
15
import type { Template } from './template' ;
16
16
import type { VM } from './vm' ;
17
17
import type { LightningElementConstructor } from './base-lightning-element' ;
@@ -58,9 +58,12 @@ export function invokeComponentConstructor(vm: VM, Ctor: LightningElementConstru
58
58
// the "instanceof" operator would not work here since Locker Service provides its own
59
59
// implementation of LightningElement, so we indirectly check if the base constructor is
60
60
// invoked by accessing the component on the vm.
61
- const isInvalidConstructor = lwcRuntimeFlags . LEGACY_LOCKER_ENABLED
62
- ? vmBeingConstructed . component !== result
63
- : ! ( result instanceof LightningElement ) ;
61
+
62
+ // TODO [W-17769475]: Restore this fix when we can reliably detect Locker enabled
63
+ // const isInvalidConstructor = lwcRuntimeFlags.LEGACY_LOCKER_ENABLED
64
+ // ? vmBeingConstructed.component !== result
65
+ // : !(result instanceof LightningElement);
66
+ const isInvalidConstructor = vmBeingConstructed . component !== result ;
64
67
65
68
if ( isInvalidConstructor ) {
66
69
throw new TypeError (
0 commit comments