File tree 3 files changed +168
-11
lines changed
3 files changed +168
-11
lines changed Original file line number Diff line number Diff line change @@ -19116,7 +19116,7 @@ Array [
19116
19116
"loc": Object {
19117
19117
"end": Object {
19118
19118
"column": 2,
19119
- "line": 26 ,
19119
+ "line": 28 ,
19120
19120
},
19121
19121
"start": Object {
19122
19122
"column": 0,
@@ -19194,17 +19194,124 @@ Array [
19194
19194
"global": Array [],
19195
19195
"inner": Array [],
19196
19196
"instance": Array [
19197
+ Object {
19198
+ "augments": Array [],
19199
+ "context": Object {
19200
+ "loc": Object {
19201
+ "end": Object {
19202
+ "column": 20,
19203
+ "line": 10,
19204
+ },
19205
+ "start": Object {
19206
+ "column": 4,
19207
+ "line": 10,
19208
+ },
19209
+ },
19210
+ },
19211
+ "description": Object {
19212
+ "children": Array [
19213
+ Object {
19214
+ "children": Array [
19215
+ Object {
19216
+ "position": Object {
19217
+ "end": Object {
19218
+ "column": 9,
19219
+ "line": 1,
19220
+ "offset": 8,
19221
+ },
19222
+ "indent": Array [],
19223
+ "start": Object {
19224
+ "column": 1,
19225
+ "line": 1,
19226
+ "offset": 0,
19227
+ },
19228
+ },
19229
+ "type": "text",
19230
+ "value": "My field",
19231
+ },
19232
+ ],
19233
+ "position": Object {
19234
+ "end": Object {
19235
+ "column": 9,
19236
+ "line": 1,
19237
+ "offset": 8,
19238
+ },
19239
+ "indent": Array [],
19240
+ "start": Object {
19241
+ "column": 1,
19242
+ "line": 1,
19243
+ "offset": 0,
19244
+ },
19245
+ },
19246
+ "type": "paragraph",
19247
+ },
19248
+ ],
19249
+ "position": Object {
19250
+ "end": Object {
19251
+ "column": 9,
19252
+ "line": 1,
19253
+ "offset": 8,
19254
+ },
19255
+ "start": Object {
19256
+ "column": 1,
19257
+ "line": 1,
19258
+ "offset": 0,
19259
+ },
19260
+ },
19261
+ "type": "root",
19262
+ },
19263
+ "errors": Array [],
19264
+ "examples": Array [],
19265
+ "loc": Object {
19266
+ "end": Object {
19267
+ "column": 19,
19268
+ "line": 9,
19269
+ },
19270
+ "start": Object {
19271
+ "column": 4,
19272
+ "line": 9,
19273
+ },
19274
+ },
19275
+ "memberof": "TheClass",
19276
+ "members": Object {
19277
+ "events": Array [],
19278
+ "global": Array [],
19279
+ "inner": Array [],
19280
+ "instance": Array [],
19281
+ "static": Array [],
19282
+ },
19283
+ "name": "my-field",
19284
+ "namespace": "TheClass#my-field",
19285
+ "params": Array [],
19286
+ "path": Array [
19287
+ Object {
19288
+ "kind": "class",
19289
+ "name": "TheClass",
19290
+ },
19291
+ Object {
19292
+ "name": "my-field",
19293
+ "scope": "instance",
19294
+ },
19295
+ ],
19296
+ "properties": Array [],
19297
+ "returns": Array [],
19298
+ "scope": "instance",
19299
+ "sees": Array [],
19300
+ "tags": Array [],
19301
+ "throws": Array [],
19302
+ "todos": Array [],
19303
+ },
19197
19304
Object {
19198
19305
"augments": Array [],
19199
19306
"context": Object {
19200
19307
"loc": Object {
19201
19308
"end": Object {
19202
19309
"column": 5,
19203
- "line": 16 ,
19310
+ "line": 18 ,
19204
19311
},
19205
19312
"start": Object {
19206
19313
"column": 4,
19207
- "line": 14 ,
19314
+ "line": 16 ,
19208
19315
},
19209
19316
},
19210
19317
},
@@ -19266,11 +19373,11 @@ Array [
19266
19373
"loc": Object {
19267
19374
"end": Object {
19268
19375
"column": 7,
19269
- "line": 13 ,
19376
+ "line": 15 ,
19270
19377
},
19271
19378
"start": Object {
19272
19379
"column": 4,
19273
- "line": 9 ,
19380
+ "line": 11 ,
19274
19381
},
19275
19382
},
19276
19383
"memberof": "TheClass",
@@ -19451,11 +19558,11 @@ Array [
19451
19558
"loc": Object {
19452
19559
"end": Object {
19453
19560
"column": 5,
19454
- "line": 24 ,
19561
+ "line": 26 ,
19455
19562
},
19456
19563
"start": Object {
19457
19564
"column": 4,
19458
- "line": 22 ,
19565
+ "line": 24 ,
19459
19566
},
19460
19567
},
19461
19568
},
@@ -19517,11 +19624,11 @@ Array [
19517
19624
"loc": Object {
19518
19625
"end": Object {
19519
19626
"column": 7,
19520
- "line": 21 ,
19627
+ "line": 23 ,
19521
19628
},
19522
19629
"start": Object {
19523
19630
"column": 4,
19524
- "line": 17 ,
19631
+ "line": 19 ,
19525
19632
},
19526
19633
},
19527
19634
"memberof": "TheClass",
@@ -19805,6 +19912,51 @@ Object {
19805
19912
},
19806
19913
"type": "paragraph",
19807
19914
},
19915
+ Object {
19916
+ "children": Array [
19917
+ Object {
19918
+ "type": "text",
19919
+ "value": "my-field",
19920
+ },
19921
+ ],
19922
+ "depth": 3,
19923
+ "type": "heading",
19924
+ },
19925
+ Object {
19926
+ "children": Array [
19927
+ Object {
19928
+ "position": Position {
19929
+ "end": Object {
19930
+ "column": 9,
19931
+ "line": 1,
19932
+ "offset": 8,
19933
+ },
19934
+ "indent": Array [],
19935
+ "start": Object {
19936
+ "column": 1,
19937
+ "line": 1,
19938
+ "offset": 0,
19939
+ },
19940
+ },
19941
+ "type": "text",
19942
+ "value": "My field",
19943
+ },
19944
+ ],
19945
+ "position": Position {
19946
+ "end": Object {
19947
+ "column": 9,
19948
+ "line": 1,
19949
+ "offset": 8,
19950
+ },
19951
+ "indent": Array [],
19952
+ "start": Object {
19953
+ "column": 1,
19954
+ "line": 1,
19955
+ "offset": 0,
19956
+ },
19957
+ },
19958
+ "type": "paragraph",
19959
+ },
19808
19960
Object {
19809
19961
"children": Array [
19810
19962
Object {
Original file line number Diff line number Diff line change 6
6
export default TheClass (
7
7
/** @lends TheClass.prototype */
8
8
{
9
+ /** My field */
10
+ 'my-field' : true ,
9
11
/**
10
12
* My neat function
11
13
* @param {string } word your word
Original file line number Diff line number Diff line change @@ -280,7 +280,10 @@ module.exports = function() {
280
280
}
281
281
282
282
// Same as above but for `b: c` vs `b: function () {}`.
283
- if ( path . isObjectProperty ( ) && path . get ( 'key' ) . isIdentifier ( ) ) {
283
+ if (
284
+ path . isObjectProperty ( ) &&
285
+ ( path . get ( 'key' ) . isIdentifier ( ) || path . get ( 'key' ) . isLiteral ( ) )
286
+ ) {
284
287
path = path . get ( 'key' ) ;
285
288
}
286
289
@@ -357,7 +360,7 @@ module.exports = function() {
357
360
let objectParent ;
358
361
359
362
if (
360
- path . isIdentifier ( ) &&
363
+ ( path . isIdentifier ( ) || path . isLiteral ( ) ) &&
361
364
path . parentPath . isObjectProperty ( ) &&
362
365
path . parentPath . parentPath . isObjectExpression ( )
363
366
) {
You can’t perform that action at this time.
0 commit comments