File tree Expand file tree Collapse file tree 3 files changed +55
-3
lines changed Expand file tree Collapse file tree 3 files changed +55
-3
lines changed Original file line number Diff line number Diff line change @@ -134,8 +134,8 @@ export class CellParser extends Parser {
134
134
// A non-empty cell?
135
135
else if ( token . type !== tt . eof && token . type !== tt . semi ) {
136
136
137
- // A destructuring cell, maybe?
138
- // (A parenthesized expression followed by the equals operator.)
137
+ // A destructuring cell, or parenthesized expression? (A destructuring
138
+ // cell is a parenthesized expression followed by the equals operator.)
139
139
if ( token . type === tt . parenL ) {
140
140
id = this . parseParenAndDistinguishExpression ( true ) ;
141
141
if ( this . eat ( tt . eq ) ) {
@@ -168,7 +168,7 @@ export class CellParser extends Parser {
168
168
}
169
169
}
170
170
171
- // A block or an expression?
171
+ // A block or non-parenthesized expression?
172
172
if ( body === null ) {
173
173
body = token . type === tt . braceL
174
174
? this . parseBlock ( )
Original file line number Diff line number Diff line change
1
+ ( function foo ( ) { return 42 ; } )
Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " Cell" ,
3
+ "start" : 0 ,
4
+ "end" : 32 ,
5
+ "id" : {
6
+ "type" : " Identifier" ,
7
+ "start" : 10 ,
8
+ "end" : 13 ,
9
+ "name" : " foo"
10
+ },
11
+ "body" : {
12
+ "type" : " FunctionExpression" ,
13
+ "start" : 1 ,
14
+ "end" : 30 ,
15
+ "id" : {
16
+ "type" : " Identifier" ,
17
+ "start" : 10 ,
18
+ "end" : 13 ,
19
+ "name" : " foo"
20
+ },
21
+ "expression" : false ,
22
+ "generator" : false ,
23
+ "async" : false ,
24
+ "params" : [],
25
+ "body" : {
26
+ "type" : " BlockStatement" ,
27
+ "start" : 16 ,
28
+ "end" : 30 ,
29
+ "body" : [
30
+ {
31
+ "type" : " ReturnStatement" ,
32
+ "start" : 18 ,
33
+ "end" : 28 ,
34
+ "argument" : {
35
+ "type" : " Literal" ,
36
+ "start" : 25 ,
37
+ "end" : 27 ,
38
+ "value" : 42 ,
39
+ "raw" : " 42"
40
+ }
41
+ }
42
+ ]
43
+ }
44
+ },
45
+ "async" : false ,
46
+ "generator" : false ,
47
+ "references" : [],
48
+ "fileAttachments" : [],
49
+ "databaseClients" : [],
50
+ "secrets" : []
51
+ }
You can’t perform that action at this time.
0 commit comments