File tree Expand file tree Collapse file tree
ember-object/__testfixtures__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /**
2+ * Program comments
3+ */
4+ const Foo = Test . extend ( {
5+ location : ENV . locationType || 'history'
6+ } ) ;
Original file line number Diff line number Diff line change 1+ import classic from 'ember-classic-decorator' ;
2+
3+ /**
4+ * Program comments
5+ */
6+ @classic
7+ class Foo extends Test {
8+ location = ENV . locationType || 'history' ;
9+ }
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import type { Type } from 'ast-types/lib/types';
44import type {
55 ASTNode ,
66 ArrayExpression ,
7+ ArrayPattern ,
8+ AssignmentPattern ,
79 CallExpression ,
810 FunctionExpression ,
911 Identifier ,
@@ -12,7 +14,13 @@ import type {
1214 MemberExpression ,
1315 Node ,
1416 ObjectExpression ,
17+ ObjectPattern ,
1518 Property ,
19+ PropertyPattern ,
20+ RestElement ,
21+ SpreadElementPattern ,
22+ SpreadPropertyPattern ,
23+ TSParameterProperty ,
1624 ThisExpression ,
1725 ASTPath as _ASTPath ,
1826 Collection as _Collection ,
@@ -313,24 +321,25 @@ export function isEOIdentifierAction(u: unknown): u is EOIdentifierAction {
313321}
314322
315323export interface EOPropertySimple extends EOProperty {
316- value :
317- | ArrayExpression
318- | Identifier
319- | Literal
320- | MemberExpression
321- | ObjectExpression
322- | CallExpression ;
324+ value : Exclude <
325+ EOProperty [ 'value' ] ,
326+ | ArrayPattern
327+ | AssignmentPattern
328+ | ObjectPattern
329+ | PropertyPattern
330+ | RestElement
331+ | SpreadElementPattern
332+ | SpreadPropertyPattern
333+ | TSParameterProperty
334+ > ;
323335}
324336
325337export function isEOPropertySimple ( u : unknown ) : u is EOPropertySimple {
326338 return (
327339 isEOProperty ( u ) &&
328- ( isNode ( u . value , 'ArrayExpression' ) ||
329- isNode ( u . value , 'Identifier' ) ||
330- isNode ( u . value , 'Literal' ) ||
331- isNode ( u . value , 'MemberExpression' ) ||
332- isNode ( u . value , 'ObjectExpression' ) ||
333- isNode ( u . value , 'CallExpression' ) )
340+ ! u . value . type . includes ( 'Pattern' ) &&
341+ u . value . type !== 'RestElement' &&
342+ u . value . type !== 'TSParameterProperty'
334343 ) ;
335344}
336345
You can’t perform that action at this time.
0 commit comments