Skip to content

Commit 5a04bbc

Browse files
committed
revert: temporarily undo Locker-specific logic
1 parent 306a8f0 commit 5a04bbc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/@lwc/engine-core/src/framework/invoker.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { addErrorComponentStack } from '../shared/error';
1111
import { evaluateTemplate, setVMBeingRendered, getVMBeingRendered } from './template';
1212
import { runWithBoundaryProtection } from './vm';
1313
import { logOperationStart, logOperationEnd, OperationId } from './profiler';
14-
import { LightningElement } from './base-lightning-element';
14+
import type { LightningElement } from './base-lightning-element';
1515
import type { Template } from './template';
1616
import type { VM } from './vm';
1717
import type { LightningElementConstructor } from './base-lightning-element';
@@ -58,9 +58,11 @@ export function invokeComponentConstructor(vm: VM, Ctor: LightningElementConstru
5858
// the "instanceof" operator would not work here since Locker Service provides its own
5959
// implementation of LightningElement, so we indirectly check if the base constructor is
6060
// invoked by accessing the component on the vm.
61-
const isInvalidConstructor = lwcRuntimeFlags.LEGACY_LOCKER_ENABLED
62-
? vmBeingConstructed.component !== result
63-
: !(result instanceof LightningElement);
61+
// TODO [W-17769475]: Restore this fix when we can reliably detect Locker enabled
62+
// const isInvalidConstructor = lwcRuntimeFlags.LEGACY_LOCKER_ENABLED
63+
// ? vmBeingConstructed.component !== result
64+
// : !(result instanceof LightningElement);
65+
const isInvalidConstructor = vmBeingConstructed.component !== result;
6466

6567
if (isInvalidConstructor) {
6668
throw new TypeError(

0 commit comments

Comments
 (0)