This repository was archived by the owner on Aug 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,23 @@ export function isComponentDefinition(content) {
7
7
return false ;
8
8
}
9
9
10
+ // Glimmer now uses Symbol keys in its component definitions so we check those first.
11
+ let symbolPropKeys = Object . getOwnPropertySymbols ?. ( content ) ;
12
+ if ( symbolPropKeys ?. length ) {
13
+ let isGlimmerComponentDefinition = symbolPropKeys . some ( ( symbolPropKey ) => {
14
+ let propValue = content [ symbolPropKey ] ;
15
+ return (
16
+ propValue &&
17
+ Object . keys ( propValue ) . some ( ( key ) => key === 'ComponentClass' )
18
+ ) ;
19
+ } ) ;
20
+
21
+ if ( isGlimmerComponentDefinition ) {
22
+ return true ;
23
+ }
24
+ }
25
+
10
26
let contentPropNames = Object . keys ( content ) ;
11
- // This stopped working in Ember 3.17 when it was switched to use a Symbol instead
12
- // See https://github.com/glimmerjs/glimmer-vm/blob/master/CHANGELOG.md#v0450-2019-12-18 and
13
- // https://github.com/glimmerjs/glimmer-vm/pull/993 for more
14
27
let isPreOctaneComponentDefinition = contentPropNames . some (
15
28
( propName ) => propName . indexOf ( 'COMPONENT DEFINITION' ) > - 1
16
29
) ;
You can’t perform that action at this time.
0 commit comments