File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { CustomElement } from './custom-element'
22
3- const attrs = new WeakMap < Record < PropertyKey , unknown > , Set < string > > ( )
3+ const attrs = new WeakMap < Record < PropertyKey , unknown > , string [ ] > ( )
44type attrValue = string | number | boolean
55
66/**
@@ -11,8 +11,8 @@ type attrValue = string | number | boolean
1111 * Number or Boolean. This matches the behavior of `initializeAttrs`.
1212 */
1313export function attr < K extends string > ( proto : Record < K , attrValue > , key : K ) : void {
14- if ( ! attrs . has ( proto ) ) attrs . set ( proto , new Set ( ) )
15- attrs . get ( proto ) ! . add ( key )
14+ if ( ! attrs . has ( proto ) ) attrs . set ( proto , [ ] )
15+ attrs . get ( proto ) ! . push ( key )
1616}
1717
1818/**
@@ -85,7 +85,7 @@ export function defineObservedAttributes(classObject: CustomElement): void {
8585 get ( ) {
8686 const attrMap = attrs . get ( classObject . prototype )
8787 if ( ! attrMap ) return observed
88- return [ ... attrMap ] . map ( attrToAttributeName ) . concat ( observed )
88+ return attrMap . map ( attrToAttributeName ) . concat ( observed )
8989 } ,
9090 set ( attributes : string [ ] ) {
9191 observed = attributes
You can’t perform that action at this time.
0 commit comments