Skip to content

Commit

Permalink
fix: use correct class check
Browse files Browse the repository at this point in the history
  • Loading branch information
wjhsf committed Dec 19, 2024
1 parent baf00fd commit b621475
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/@lwc/engine-core/src/framework/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export { registerTemplate } from './secure-template';
export { registerDecorators } from './decorators/register';

// Mics. internal APIs -----------------------------------------------------------------------------
export { BaseBridgeElement } from './base-bridge-element';
export { unwrap } from './membrane';
export { sanitizeAttribute } from './secure-template';
export { getComponentDef, isComponentConstructor } from './def';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
runFormDisabledCallback,
runFormResetCallback,
runFormStateRestoreCallback,
BaseBridgeElement,
} from '@lwc/engine-core';
import { isNull } from '@lwc/shared';
import { renderer } from '../renderer';
Expand Down Expand Up @@ -71,7 +72,7 @@ export function buildCustomElementConstructor(Ctor: ComponentConstructor): HTMLE
const { observedAttributes } = HtmlPrototype as any;
const { attributeChangedCallback } = HtmlPrototype.prototype as any;

return class CustomElementConstructor extends HTMLElement {
return class extends HTMLElement {
constructor() {
super();

Expand Down Expand Up @@ -121,7 +122,7 @@ export function buildCustomElementConstructor(Ctor: ComponentConstructor): HTMLE
}

attributeChangedCallback(name: string, oldValue: any, newValue: any) {
if (this instanceof CustomElementConstructor) {
if (this instanceof BaseBridgeElement) {
// W-17420330
attributeChangedCallback.call(this, name, oldValue, newValue);
}
Expand Down

0 comments on commit b621475

Please sign in to comment.