From 006f3db76ac6334767d8a847fcbd5ebeeaae9b62 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 25 Jul 2015 05:24:58 +0100 Subject: [PATCH] update babylon fixtures to use File as the root node rather than Program --- .../core/uncategorised/1/expected.json | 55 +- .../core/uncategorised/10/expected.json | 176 ++-- .../core/uncategorised/100/expected.json | 84 +- .../core/uncategorised/101/expected.json | 84 +- .../core/uncategorised/102/expected.json | 157 +-- .../core/uncategorised/103/expected.json | 157 +-- .../core/uncategorised/104/expected.json | 157 +-- .../core/uncategorised/105/expected.json | 157 +-- .../core/uncategorised/106/expected.json | 157 +-- .../core/uncategorised/107/expected.json | 157 +-- .../core/uncategorised/108/expected.json | 157 +-- .../core/uncategorised/109/expected.json | 112 ++- .../core/uncategorised/11/expected.json | 180 ++-- .../core/uncategorised/110/expected.json | 112 ++- .../core/uncategorised/111/expected.json | 142 +-- .../core/uncategorised/112/expected.json | 142 +-- .../core/uncategorised/113/expected.json | 202 ++-- .../core/uncategorised/114/expected.json | 172 ++-- .../core/uncategorised/115/expected.json | 172 ++-- .../core/uncategorised/116/expected.json | 203 ++-- .../core/uncategorised/117/expected.json | 174 ++-- .../core/uncategorised/118/expected.json | 113 ++- .../core/uncategorised/119/expected.json | 142 +-- .../core/uncategorised/12/expected.json | 240 +++-- .../core/uncategorised/120/expected.json | 202 ++-- .../core/uncategorised/121/expected.json | 262 ++--- .../core/uncategorised/122/expected.json | 204 ++-- .../core/uncategorised/123/expected.json | 142 +-- .../core/uncategorised/124/expected.json | 204 ++-- .../core/uncategorised/125/expected.json | 206 ++-- .../core/uncategorised/126/expected.json | 394 ++++---- .../core/uncategorised/127/expected.json | 326 +++--- .../core/uncategorised/128/expected.json | 142 +-- .../core/uncategorised/129/expected.json | 142 +-- .../core/uncategorised/13/expected.json | 242 +++-- .../core/uncategorised/130/expected.json | 142 +-- .../core/uncategorised/131/expected.json | 142 +-- .../core/uncategorised/132/expected.json | 114 ++- .../core/uncategorised/133/expected.json | 114 ++- .../core/uncategorised/134/expected.json | 114 ++- .../core/uncategorised/135/expected.json | 114 ++- .../core/uncategorised/136/expected.json | 114 ++- .../core/uncategorised/137/expected.json | 114 ++- .../core/uncategorised/138/expected.json | 114 ++- .../core/uncategorised/139/expected.json | 114 ++- .../core/uncategorised/14/expected.json | 142 +-- .../core/uncategorised/140/expected.json | 114 ++- .../core/uncategorised/141/expected.json | 114 ++- .../core/uncategorised/142/expected.json | 114 ++- .../core/uncategorised/143/expected.json | 114 ++- .../core/uncategorised/144/expected.json | 114 ++- .../core/uncategorised/145/expected.json | 114 ++- .../core/uncategorised/146/expected.json | 114 ++- .../core/uncategorised/147/expected.json | 114 ++- .../core/uncategorised/148/expected.json | 114 ++- .../core/uncategorised/149/expected.json | 114 ++- .../core/uncategorised/15/expected.json | 142 +-- .../core/uncategorised/150/expected.json | 114 ++- .../core/uncategorised/151/expected.json | 142 +-- .../core/uncategorised/152/expected.json | 142 +-- .../core/uncategorised/153/expected.json | 142 +-- .../core/uncategorised/154/expected.json | 142 +-- .../core/uncategorised/155/expected.json | 142 +-- .../core/uncategorised/156/expected.json | 142 +-- .../core/uncategorised/157/expected.json | 142 +-- .../core/uncategorised/158/expected.json | 142 +-- .../core/uncategorised/159/expected.json | 142 +-- .../core/uncategorised/16/expected.json | 142 +-- .../core/uncategorised/160/expected.json | 142 +-- .../core/uncategorised/161/expected.json | 142 +-- .../core/uncategorised/162/expected.json | 142 +-- .../core/uncategorised/163/expected.json | 142 +-- .../core/uncategorised/164/expected.json | 142 +-- .../core/uncategorised/165/expected.json | 202 ++-- .../core/uncategorised/166/expected.json | 142 +-- .../core/uncategorised/167/expected.json | 142 +-- .../core/uncategorised/168/expected.json | 142 +-- .../core/uncategorised/169/expected.json | 142 +-- .../core/uncategorised/17/expected.json | 142 +-- .../core/uncategorised/170/expected.json | 142 +-- .../core/uncategorised/171/expected.json | 142 +-- .../core/uncategorised/172/expected.json | 142 +-- .../core/uncategorised/173/expected.json | 202 ++-- .../core/uncategorised/174/expected.json | 202 ++-- .../core/uncategorised/175/expected.json | 202 ++-- .../core/uncategorised/176/expected.json | 202 ++-- .../core/uncategorised/177/expected.json | 202 ++-- .../core/uncategorised/178/expected.json | 202 ++-- .../core/uncategorised/179/expected.json | 202 ++-- .../core/uncategorised/18/expected.json | 142 +-- .../core/uncategorised/180/expected.json | 202 ++-- .../core/uncategorised/181/expected.json | 202 ++-- .../core/uncategorised/182/expected.json | 202 ++-- .../core/uncategorised/183/expected.json | 202 ++-- .../core/uncategorised/184/expected.json | 202 ++-- .../core/uncategorised/185/expected.json | 202 ++-- .../core/uncategorised/186/expected.json | 202 ++-- .../core/uncategorised/187/expected.json | 202 ++-- .../core/uncategorised/188/expected.json | 202 ++-- .../core/uncategorised/189/expected.json | 202 ++-- .../core/uncategorised/19/expected.json | 142 +-- .../core/uncategorised/190/expected.json | 202 ++-- .../core/uncategorised/191/expected.json | 142 +-- .../core/uncategorised/192/expected.json | 142 +-- .../core/uncategorised/193/expected.json | 202 ++-- .../core/uncategorised/194/expected.json | 202 ++-- .../core/uncategorised/195/expected.json | 202 ++-- .../core/uncategorised/196/expected.json | 202 ++-- .../core/uncategorised/197/expected.json | 174 ++-- .../core/uncategorised/198/expected.json | 234 +++-- .../core/uncategorised/199/expected.json | 144 +-- .../core/uncategorised/2/expected.json | 61 +- .../core/uncategorised/20/expected.json | 142 +-- .../core/uncategorised/200/expected.json | 144 +-- .../core/uncategorised/201/expected.json | 144 +-- .../core/uncategorised/202/expected.json | 144 +-- .../core/uncategorised/203/expected.json | 144 +-- .../core/uncategorised/204/expected.json | 144 +-- .../core/uncategorised/205/expected.json | 144 +-- .../core/uncategorised/206/expected.json | 144 +-- .../core/uncategorised/207/expected.json | 144 +-- .../core/uncategorised/208/expected.json | 144 +-- .../core/uncategorised/209/expected.json | 144 +-- .../core/uncategorised/21/expected.json | 142 +-- .../core/uncategorised/210/expected.json | 144 +-- .../core/uncategorised/211/expected.json | 144 +-- .../core/uncategorised/212/expected.json | 144 +-- .../core/uncategorised/213/expected.json | 114 ++- .../core/uncategorised/214/expected.json | 232 +++-- .../core/uncategorised/215/expected.json | 54 +- .../core/uncategorised/216/expected.json | 118 ++- .../core/uncategorised/217/expected.json | 178 ++-- .../core/uncategorised/218/expected.json | 148 +-- .../core/uncategorised/219/expected.json | 238 +++-- .../core/uncategorised/22/expected.json | 229 +++-- .../core/uncategorised/220/expected.json | 328 +++--- .../core/uncategorised/221/expected.json | 238 +++-- .../core/uncategorised/222/expected.json | 298 +++--- .../core/uncategorised/223/expected.json | 52 +- .../core/uncategorised/224/expected.json | 82 +- .../core/uncategorised/225/expected.json | 144 +-- .../core/uncategorised/226/expected.json | 82 +- .../core/uncategorised/227/expected.json | 82 +- .../core/uncategorised/228/expected.json | 172 ++-- .../core/uncategorised/229/expected.json | 177 ++-- .../core/uncategorised/23/expected.json | 229 +++-- .../core/uncategorised/230/expected.json | 208 ++-- .../core/uncategorised/231/expected.json | 258 ++--- .../core/uncategorised/232/expected.json | 172 ++-- .../core/uncategorised/233/expected.json | 172 ++-- .../core/uncategorised/234/expected.json | 356 ++++--- .../core/uncategorised/235/expected.json | 206 ++-- .../core/uncategorised/236/expected.json | 172 ++-- .../core/uncategorised/237/expected.json | 356 ++++--- .../core/uncategorised/238/expected.json | 86 +- .../core/uncategorised/239/expected.json | 88 +- .../core/uncategorised/24/expected.json | 229 +++-- .../core/uncategorised/240/expected.json | 176 ++-- .../core/uncategorised/241/expected.json | 208 ++-- .../core/uncategorised/242/expected.json | 298 +++--- .../core/uncategorised/243/expected.json | 266 ++--- .../core/uncategorised/244/expected.json | 326 +++--- .../core/uncategorised/245/expected.json | 418 ++++---- .../core/uncategorised/246/expected.json | 232 +++-- .../core/uncategorised/247/expected.json | 296 +++--- .../core/uncategorised/248/expected.json | 326 +++--- .../core/uncategorised/249/expected.json | 480 +++++---- .../core/uncategorised/25/expected.json | 229 +++-- .../core/uncategorised/250/expected.json | 146 +-- .../core/uncategorised/251/expected.json | 146 +-- .../core/uncategorised/252/expected.json | 232 +++-- .../core/uncategorised/253/expected.json | 232 +++-- .../core/uncategorised/254/expected.json | 146 +-- .../core/uncategorised/255/expected.json | 232 +++-- .../core/uncategorised/256/expected.json | 232 +++-- .../core/uncategorised/259/expected.json | 149 +-- .../core/uncategorised/26/expected.json | 229 +++-- .../core/uncategorised/260/expected.json | 149 +-- .../core/uncategorised/261/expected.json | 177 ++-- .../core/uncategorised/262/expected.json | 237 +++-- .../core/uncategorised/265/expected.json | 200 ++-- .../core/uncategorised/266/expected.json | 200 ++-- .../core/uncategorised/267/expected.json | 232 +++-- .../core/uncategorised/268/expected.json | 84 +- .../core/uncategorised/269/expected.json | 268 ++--- .../core/uncategorised/27/expected.json | 231 +++-- .../core/uncategorised/270/expected.json | 332 +++--- .../core/uncategorised/271/expected.json | 174 ++-- .../core/uncategorised/272/expected.json | 200 ++-- .../core/uncategorised/273/expected.json | 82 +- .../core/uncategorised/274/expected.json | 142 +-- .../core/uncategorised/275/expected.json | 169 ++-- .../core/uncategorised/276/expected.json | 173 ++-- .../core/uncategorised/277/expected.json | 173 ++-- .../core/uncategorised/278/expected.json | 173 ++-- .../core/uncategorised/279/expected.json | 295 +++--- .../core/uncategorised/28/expected.json | 314 +++--- .../core/uncategorised/280/expected.json | 237 +++-- .../core/uncategorised/281/expected.json | 385 +++---- .../core/uncategorised/282/expected.json | 535 +++++----- .../core/uncategorised/283/expected.json | 52 +- .../core/uncategorised/284/expected.json | 206 ++-- .../core/uncategorised/285/expected.json | 116 ++- .../core/uncategorised/286/expected.json | 116 ++- .../core/uncategorised/287/expected.json | 178 ++-- .../core/uncategorised/288/expected.json | 207 ++-- .../core/uncategorised/289/expected.json | 272 ++--- .../core/uncategorised/29/expected.json | 321 +++--- .../core/uncategorised/290/expected.json | 238 +++-- .../core/uncategorised/291/expected.json | 268 ++--- .../core/uncategorised/292/expected.json | 166 +-- .../core/uncategorised/293/expected.json | 196 ++-- .../core/uncategorised/294/expected.json | 270 ++--- .../core/uncategorised/295/expected.json | 320 +++--- .../core/uncategorised/296/expected.json | 208 ++-- .../core/uncategorised/297/expected.json | 208 ++-- .../core/uncategorised/298/expected.json | 298 +++--- .../core/uncategorised/299/expected.json | 117 ++- .../core/uncategorised/3/expected.json | 61 +- .../core/uncategorised/30/expected.json | 261 +++-- .../core/uncategorised/300/expected.json | 204 ++-- .../core/uncategorised/301/expected.json | 204 ++-- .../core/uncategorised/302/expected.json | 142 ++- .../core/uncategorised/303/expected.json | 328 +++--- .../core/uncategorised/304/expected.json | 204 ++-- .../core/uncategorised/305/expected.json | 250 +++-- .../core/uncategorised/306/expected.json | 250 +++-- .../core/uncategorised/307/expected.json | 204 ++-- .../core/uncategorised/308/expected.json | 250 +++-- .../core/uncategorised/309/expected.json | 250 +++-- .../core/uncategorised/31/expected.json | 261 +++-- .../core/uncategorised/310/expected.json | 207 ++-- .../core/uncategorised/311/expected.json | 253 +++-- .../core/uncategorised/312/expected.json | 253 +++-- .../core/uncategorised/313/expected.json | 172 ++-- .../core/uncategorised/314/expected.json | 219 ++-- .../core/uncategorised/315/expected.json | 219 ++-- .../core/uncategorised/316/expected.json | 22 +- .../core/uncategorised/317/expected.json | 180 ++-- .../core/uncategorised/318/expected.json | 181 ++-- .../core/uncategorised/319/expected.json | 156 ++- .../core/uncategorised/32/expected.json | 261 +++-- .../core/uncategorised/320/expected.json | 110 +- .../core/uncategorised/321/expected.json | 104 +- .../core/uncategorised/322/expected.json | 72 +- .../core/uncategorised/323/expected.json | 180 +++- .../core/uncategorised/324/expected.json | 119 ++- .../core/uncategorised/325/expected.json | 70 +- .../core/uncategorised/326/expected.json | 144 ++- .../core/uncategorised/33/expected.json | 261 +++-- .../core/uncategorised/34/expected.json | 261 +++-- .../core/uncategorised/341/expected.json | 94 +- .../core/uncategorised/342/expected.json | 151 ++- .../core/uncategorised/343/expected.json | 186 +++- .../core/uncategorised/344/expected.json | 163 ++- .../core/uncategorised/35/expected.json | 263 +++-- .../core/uncategorised/36/expected.json | 263 +++-- .../core/uncategorised/37/expected.json | 413 ++++---- .../core/uncategorised/38/expected.json | 413 ++++---- .../core/uncategorised/39/expected.json | 413 ++++---- .../core/uncategorised/4/expected.json | 71 +- .../core/uncategorised/40/expected.json | 413 ++++---- .../core/uncategorised/41/expected.json | 413 ++++---- .../core/uncategorised/42/expected.json | 415 ++++---- .../core/uncategorised/43/expected.json | 415 ++++---- .../core/uncategorised/44/expected.json | 229 +++-- .../core/uncategorised/45/expected.json | 229 +++-- .../core/uncategorised/46/expected.json | 107 +- .../core/uncategorised/47/expected.json | 128 ++- .../core/uncategorised/48/expected.json | 128 ++- .../core/uncategorised/49/expected.json | 107 +- .../core/uncategorised/5/expected.json | 71 +- .../core/uncategorised/50/expected.json | 107 +- .../core/uncategorised/51/expected.json | 107 +- .../core/uncategorised/52/expected.json | 107 +- .../core/uncategorised/525/expected.json | 118 ++- .../core/uncategorised/526/expected.json | 178 ++-- .../core/uncategorised/527/expected.json | 148 +-- .../core/uncategorised/528/expected.json | 238 +++-- .../core/uncategorised/529/expected.json | 328 +++--- .../core/uncategorised/53/expected.json | 107 +- .../core/uncategorised/530/expected.json | 208 ++-- .../core/uncategorised/531/expected.json | 298 +++--- .../core/uncategorised/532/expected.json | 296 +++--- .../core/uncategorised/533/expected.json | 148 +-- .../core/uncategorised/534/expected.json | 238 +++-- .../core/uncategorised/535/expected.json | 328 +++--- .../core/uncategorised/537/expected.json | 210 +++- .../core/uncategorised/538/expected.json | 72 +- .../core/uncategorised/54/expected.json | 107 +- .../core/uncategorised/540/expected.json | 131 ++- .../core/uncategorised/541/expected.json | 135 ++- .../core/uncategorised/55/expected.json | 108 +- .../core/uncategorised/56/expected.json | 107 +- .../core/uncategorised/57/expected.json | 65 +- .../core/uncategorised/58/expected.json | 65 +- .../core/uncategorised/59/expected.json | 107 +- .../core/uncategorised/6/expected.json | 209 ++-- .../core/uncategorised/60/expected.json | 45 +- .../core/uncategorised/61/expected.json | 65 +- .../core/uncategorised/62/expected.json | 107 +- .../core/uncategorised/63/expected.json | 127 ++- .../core/uncategorised/64/expected.json | 228 +++-- .../core/uncategorised/65/expected.json | 262 +++-- .../core/uncategorised/66/expected.json | 84 +- .../core/uncategorised/67/expected.json | 84 +- .../core/uncategorised/68/expected.json | 84 +- .../core/uncategorised/69/expected.json | 84 +- .../core/uncategorised/7/expected.json | 142 +-- .../core/uncategorised/70/expected.json | 84 +- .../core/uncategorised/71/expected.json | 84 +- .../core/uncategorised/72/expected.json | 84 +- .../core/uncategorised/73/expected.json | 84 +- .../core/uncategorised/74/expected.json | 84 +- .../core/uncategorised/75/expected.json | 84 +- .../core/uncategorised/76/expected.json | 84 +- .../core/uncategorised/77/expected.json | 84 +- .../core/uncategorised/78/expected.json | 84 +- .../core/uncategorised/79/expected.json | 84 +- .../core/uncategorised/8/expected.json | 142 +-- .../core/uncategorised/80/expected.json | 84 +- .../core/uncategorised/81/expected.json | 84 +- .../core/uncategorised/82/expected.json | 84 +- .../core/uncategorised/83/expected.json | 84 +- .../core/uncategorised/84/expected.json | 84 +- .../core/uncategorised/85/expected.json | 84 +- .../core/uncategorised/86/expected.json | 84 +- .../core/uncategorised/87/expected.json | 84 +- .../core/uncategorised/88/expected.json | 84 +- .../core/uncategorised/89/expected.json | 84 +- .../core/uncategorised/9/expected.json | 176 ++-- .../core/uncategorised/90/expected.json | 84 +- .../core/uncategorised/91/expected.json | 84 +- .../core/uncategorised/92/expected.json | 84 +- .../core/uncategorised/93/expected.json | 84 +- .../core/uncategorised/94/expected.json | 84 +- .../core/uncategorised/95/expected.json | 84 +- .../core/uncategorised/96/expected.json | 84 +- .../core/uncategorised/97/expected.json | 84 +- .../core/uncategorised/98/expected.json | 84 +- .../core/uncategorised/99/expected.json | 84 +- .../uncategorised/10/expected.json | 224 ++++- .../uncategorised/11/expected.json | 229 +++-- .../uncategorised/12/expected.json | 164 ++- .../uncategorised/13/expected.json | 214 +++- .../uncategorised/14/expected.json | 375 +++++-- .../uncategorised/17/expected.json | 140 ++- .../uncategorised/18/expected.json | 193 ++-- .../uncategorised/19/expected.json | 287 +++--- .../uncategorised/20/expected.json | 257 +++-- .../uncategorised/21/expected.json | 411 ++++---- .../uncategorised/22/expected.json | 302 +++--- .../uncategorised/23/expected.json | 259 +++-- .../uncategorised/24/expected.json | 381 ++++--- .../uncategorised/25/expected.json | 289 +++--- .../uncategorised/26/expected.json | 368 ++++--- .../uncategorised/27/expected.json | 212 ++-- .../uncategorised/28/expected.json | 379 ++++--- .../uncategorised/29/expected.json | 197 +++- .../uncategorised/3/expected.json | 110 +- .../uncategorised/30/expected.json | 195 +++- .../uncategorised/31/expected.json | 221 ++-- .../uncategorised/32/expected.json | 126 ++- .../uncategorised/33/expected.json | 144 ++- .../uncategorised/34/expected.json | 212 +++- .../uncategorised/35/expected.json | 244 +++-- .../uncategorised/36/expected.json | 256 +++-- .../uncategorised/37/expected.json | 244 +++-- .../uncategorised/38/expected.json | 286 ++++-- .../uncategorised/39/expected.json | 356 +++++-- .../uncategorised/4/expected.json | 158 ++- .../uncategorised/40/expected.json | 235 ++++- .../uncategorised/43/expected.json | 171 +++- .../uncategorised/44/expected.json | 148 ++- .../uncategorised/45/expected.json | 148 ++- .../uncategorised/46/expected.json | 171 +++- .../uncategorised/47/expected.json | 217 +++- .../uncategorised/48/expected.json | 217 +++- .../uncategorised/49/expected.json | 242 +++-- .../uncategorised/5/expected.json | 139 ++- .../uncategorised/50/expected.json | 166 ++- .../uncategorised/51/expected.json | 166 ++- .../uncategorised/52/expected.json | 120 ++- .../uncategorised/53/expected.json | 120 ++- .../uncategorised/54/expected.json | 120 ++- .../uncategorised/55/expected.json | 166 ++- .../uncategorised/56/expected.json | 167 ++- .../uncategorised/57/expected.json | 219 ++-- .../uncategorised/58/expected.json | 151 ++- .../uncategorised/6/expected.json | 138 ++- .../uncategorised/7/expected.json | 171 +++- .../uncategorised/8/expected.json | 170 +++- .../uncategorised/9/expected.json | 164 ++- .../fixtures/flow/array-types/1/expected.json | 244 +++-- .../fixtures/flow/array-types/2/expected.json | 280 +++--- .../fixtures/flow/array-types/3/expected.json | 280 +++--- .../fixtures/flow/array-types/4/expected.json | 285 +++--- .../fixtures/flow/array-types/5/expected.json | 285 +++--- .../fixtures/flow/array-types/6/expected.json | 320 +++--- .../flow/bounded-polymorphism/1/expected.json | 292 +++--- .../flow/bounded-polymorphism/2/expected.json | 301 +++--- .../flow/call-properties/1/expected.json | 329 +++--- .../flow/call-properties/2/expected.json | 329 +++--- .../flow/call-properties/3/expected.json | 670 ++++++------ .../flow/call-properties/4/expected.json | 559 +++++----- .../flow/call-properties/5/expected.json | 241 +++-- .../flow/declare-module/1/expected.json | 130 ++- .../flow/declare-module/2/expected.json | 133 ++- .../flow/declare-module/3/expected.json | 278 ++--- .../flow/declare-module/4/expected.json | 295 +++--- .../flow/declare-module/5/expected.json | 407 ++++---- .../flow/declare-statements/1/expected.json | 94 +- .../flow/declare-statements/10/expected.json | 365 ++++--- .../flow/declare-statements/11/expected.json | 288 +++--- .../flow/declare-statements/12/expected.json | 255 +++-- .../flow/declare-statements/2/expected.json | 96 +- .../flow/declare-statements/3/expected.json | 199 ++-- .../flow/declare-statements/4/expected.json | 199 ++-- .../flow/declare-statements/5/expected.json | 275 ++--- .../flow/declare-statements/6/expected.json | 425 ++++---- .../flow/declare-statements/7/expected.json | 414 ++++++-- .../flow/declare-statements/8/expected.json | 138 ++- .../flow/declare-statements/9/expected.json | 466 +++++---- .../1/expected.json | 138 ++- .../2/expected.json | 186 ++-- .../3/expected.json | 498 +++++---- .../4/expected.json | 261 +++-- .../5/expected.json | 366 ++++--- .../6/expected.json | 182 ++-- .../7/expected.json | 342 ++++--- .../8/expected.json | 256 +++-- .../9/expected.json | 304 +++--- .../flow/number-literal-types/1/expected.json | 197 ++-- .../flow/number-literal-types/2/expected.json | 197 ++-- .../flow/number-literal-types/3/expected.json | 197 ++-- .../flow/number-literal-types/4/expected.json | 197 ++-- .../flow/number-literal-types/5/expected.json | 197 ++-- .../qualified-generic-type/1/expected.json | 322 +++--- .../qualified-generic-type/2/expected.json | 396 ++++---- .../qualified-generic-type/3/expected.json | 436 ++++---- .../qualified-generic-type/4/expected.json | 472 +++++---- .../flow/string-literal-types/1/expected.json | 326 +++--- .../flow/string-literal-types/2/expected.json | 326 +++--- test/fixtures/flow/tuples/1/expected.json | 244 +++-- test/fixtures/flow/tuples/2/expected.json | 426 ++++---- test/fixtures/flow/tuples/3/expected.json | 309 +++--- test/fixtures/flow/tuples/4/expected.json | 402 ++++---- test/fixtures/flow/type-alias/1/expected.json | 134 ++- test/fixtures/flow/type-alias/2/expected.json | 310 +++--- test/fixtures/flow/type-alias/3/expected.json | 174 ++-- .../flow/type-annotations/1/expected.json | 359 ++++--- .../flow/type-annotations/10/expected.json | 438 ++++---- .../flow/type-annotations/11/expected.json | 525 +++++----- .../flow/type-annotations/12/expected.json | 189 ++-- .../flow/type-annotations/13/expected.json | 230 +++-- .../flow/type-annotations/14/expected.json | 314 +++--- .../flow/type-annotations/15/expected.json | 314 +++--- .../flow/type-annotations/16/expected.json | 195 ++-- .../flow/type-annotations/17/expected.json | 215 ++-- .../flow/type-annotations/18/expected.json | 253 +++-- .../flow/type-annotations/19/expected.json | 329 +++--- .../flow/type-annotations/2/expected.json | 249 +++-- .../flow/type-annotations/20/expected.json | 433 ++++---- .../flow/type-annotations/21/expected.json | 505 ++++++---- .../flow/type-annotations/22/expected.json | 393 +++++--- .../flow/type-annotations/23/expected.json | 662 ++++++------ .../flow/type-annotations/24/expected.json | 649 +++++++----- .../flow/type-annotations/25/expected.json | 664 ++++++------ .../flow/type-annotations/26/expected.json | 666 ++++++------ .../flow/type-annotations/27/expected.json | 395 +++++--- .../flow/type-annotations/28/expected.json | 467 +++++---- .../flow/type-annotations/29/expected.json | 355 ++++--- .../flow/type-annotations/3/expected.json | 359 ++++--- .../flow/type-annotations/30/expected.json | 208 ++-- .../flow/type-annotations/31/expected.json | 242 +++-- .../flow/type-annotations/32/expected.json | 328 +++--- .../flow/type-annotations/33/expected.json | 328 +++--- .../flow/type-annotations/34/expected.json | 476 +++++---- .../flow/type-annotations/35/expected.json | 364 ++++--- .../flow/type-annotations/36/expected.json | 440 ++++---- .../flow/type-annotations/37/expected.json | 448 +++++---- .../flow/type-annotations/38/expected.json | 484 +++++---- .../flow/type-annotations/39/expected.json | 440 ++++---- .../flow/type-annotations/4/expected.json | 287 +++--- .../flow/type-annotations/40/expected.json | 440 ++++---- .../flow/type-annotations/41/expected.json | 508 ++++++---- .../flow/type-annotations/42/expected.json | 708 +++++++------ .../flow/type-annotations/43/expected.json | 639 ++++++------ .../flow/type-annotations/44/expected.json | 481 +++++---- .../flow/type-annotations/45/expected.json | 322 +++--- .../flow/type-annotations/46/expected.json | 474 +++++---- .../flow/type-annotations/47/expected.json | 210 ++-- .../flow/type-annotations/48/expected.json | 326 +++--- .../flow/type-annotations/49/expected.json | 284 +++--- .../flow/type-annotations/5/expected.json | 287 +++--- .../flow/type-annotations/50/expected.json | 516 ++++++---- .../flow/type-annotations/51/expected.json | 326 +++--- .../flow/type-annotations/52/expected.json | 217 ++-- .../flow/type-annotations/53/expected.json | 364 ++++--- .../flow/type-annotations/54/expected.json | 366 ++++--- .../flow/type-annotations/55/expected.json | 321 +++--- .../flow/type-annotations/56/expected.json | 437 ++++---- .../flow/type-annotations/57/expected.json | 400 ++++---- .../flow/type-annotations/58/expected.json | 294 +++--- .../flow/type-annotations/59/expected.json | 364 ++++--- .../flow/type-annotations/6/expected.json | 285 +++--- .../flow/type-annotations/60/expected.json | 551 +++++----- .../flow/type-annotations/61/expected.json | 549 +++++----- .../flow/type-annotations/62/expected.json | 395 ++++---- .../flow/type-annotations/63/expected.json | 449 +++++---- .../flow/type-annotations/64/expected.json | 355 ++++--- .../flow/type-annotations/65/expected.json | 283 +++++- .../flow/type-annotations/66/expected.json | 286 +++++- .../flow/type-annotations/67/expected.json | 213 +++- .../flow/type-annotations/68/expected.json | 245 ++++- .../flow/type-annotations/69/expected.json | 360 +++++-- .../flow/type-annotations/7/expected.json | 290 +++--- .../flow/type-annotations/70/expected.json | 214 +++- .../flow/type-annotations/71/expected.json | 240 ++++- .../flow/type-annotations/72/expected.json | 219 +++- .../flow/type-annotations/73/expected.json | 259 ++++- .../flow/type-annotations/74/expected.json | 317 ++++-- .../flow/type-annotations/75/expected.json | 220 +++- .../flow/type-annotations/76/expected.json | 258 ++++- .../flow/type-annotations/77/expected.json | 324 ++++-- .../flow/type-annotations/78/expected.json | 212 +++- .../flow/type-annotations/79/expected.json | 317 ++++-- .../flow/type-annotations/8/expected.json | 290 +++--- .../flow/type-annotations/80/expected.json | 288 +++++- .../flow/type-annotations/81/expected.json | 472 +++++---- .../flow/type-annotations/82/expected.json | 472 +++++---- .../flow/type-annotations/83/expected.json | 244 +++-- .../flow/type-annotations/84/expected.json | 280 +++--- .../flow/type-annotations/85/expected.json | 358 ++++--- .../flow/type-annotations/86/expected.json | 474 +++++---- .../flow/type-annotations/87/expected.json | 519 +++++----- .../flow/type-annotations/88/expected.json | 706 +++++++------ .../flow/type-annotations/89/expected.json | 159 +-- .../flow/type-annotations/9/expected.json | 348 ++++--- .../flow/type-annotations/90/expected.json | 159 +-- .../flow/type-annotations/91/expected.json | 329 +++--- .../flow/type-annotations/92/expected.json | 197 ++-- .../flow/type-annotations/93/expected.json | 159 +-- .../flow/type-annotations/94/expected.json | 247 +++-- .../flow/type-annotations/95/expected.json | 161 +-- .../flow/type-annotations/96/expected.json | 161 +-- .../flow/type-grouping/1/expected.json | 208 ++-- .../flow/type-grouping/2/expected.json | 366 ++++--- .../flow/type-grouping/3/expected.json | 360 ++++--- .../flow/type-grouping/4/expected.json | 284 +++--- test/fixtures/flow/typecasts/1/expected.json | 181 ++-- test/fixtures/flow/typecasts/2/expected.json | 623 +++++++----- test/fixtures/flow/typecasts/3/expected.json | 476 +++++---- test/fixtures/flow/typecasts/4/expected.json | 331 +++--- .../harmony/uncategorised/1/expected.json | 101 +- .../harmony/uncategorised/10/expected.json | 101 +- .../harmony/uncategorised/100/expected.json | 275 +++-- .../harmony/uncategorised/101/expected.json | 241 +++-- .../harmony/uncategorised/102/expected.json | 240 +++-- .../harmony/uncategorised/103/expected.json | 422 +++++--- .../harmony/uncategorised/104/expected.json | 221 +++- .../harmony/uncategorised/105/expected.json | 138 ++- .../harmony/uncategorised/106/expected.json | 278 +++-- .../harmony/uncategorised/107/expected.json | 268 +++-- .../harmony/uncategorised/108/expected.json | 340 ++++--- .../harmony/uncategorised/109/expected.json | 375 ++++--- .../harmony/uncategorised/11/expected.json | 101 +- .../harmony/uncategorised/110/expected.json | 340 ++++--- .../harmony/uncategorised/111/expected.json | 237 +++-- .../harmony/uncategorised/112/expected.json | 266 +++-- .../harmony/uncategorised/113/expected.json | 282 ++++-- .../harmony/uncategorised/114/expected.json | 282 ++++-- .../harmony/uncategorised/115/expected.json | 314 +++--- .../harmony/uncategorised/116/expected.json | 314 +++--- .../harmony/uncategorised/117/expected.json | 318 +++--- .../harmony/uncategorised/118/expected.json | 318 +++--- .../harmony/uncategorised/119/expected.json | 318 +++--- .../harmony/uncategorised/12/expected.json | 101 +- .../harmony/uncategorised/120/expected.json | 318 +++--- .../harmony/uncategorised/121/expected.json | 420 +++++--- .../harmony/uncategorised/122/expected.json | 420 +++++--- .../harmony/uncategorised/123/expected.json | 484 +++++---- .../harmony/uncategorised/124/expected.json | 178 +++- .../harmony/uncategorised/128/expected.json | 282 ++++-- .../harmony/uncategorised/129/expected.json | 428 ++++---- .../harmony/uncategorised/13/expected.json | 101 +- .../harmony/uncategorised/130/expected.json | 484 +++++---- .../harmony/uncategorised/131/expected.json | 428 ++++---- .../harmony/uncategorised/132/expected.json | 464 +++++---- .../harmony/uncategorised/133/expected.json | 428 ++++---- .../harmony/uncategorised/134/expected.json | 428 ++++---- .../harmony/uncategorised/135/expected.json | 792 +++++++++------ .../harmony/uncategorised/136/expected.json | 220 ++-- .../harmony/uncategorised/137/expected.json | 224 +++-- .../harmony/uncategorised/138/expected.json | 464 +++++---- .../harmony/uncategorised/139/expected.json | 324 +++--- .../harmony/uncategorised/14/expected.json | 101 +- .../harmony/uncategorised/140/expected.json | 112 ++- .../harmony/uncategorised/141/expected.json | 212 ++-- .../harmony/uncategorised/142/expected.json | 286 ++++-- .../harmony/uncategorised/143/expected.json | 249 +++-- .../harmony/uncategorised/144/expected.json | 323 +++--- .../harmony/uncategorised/145/expected.json | 433 ++++---- .../harmony/uncategorised/146/expected.json | 249 +++-- .../harmony/uncategorised/147/expected.json | 390 ++++--- .../harmony/uncategorised/148/expected.json | 284 ++++-- .../harmony/uncategorised/149/expected.json | 422 +++++--- .../harmony/uncategorised/15/expected.json | 101 +- .../harmony/uncategorised/150/expected.json | 220 ++-- .../harmony/uncategorised/152/expected.json | 316 +++--- .../harmony/uncategorised/153/expected.json | 464 +++++---- .../harmony/uncategorised/154/expected.json | 532 ++++++---- .../harmony/uncategorised/155/expected.json | 575 ++++++----- .../harmony/uncategorised/156/expected.json | 575 ++++++----- .../harmony/uncategorised/157/expected.json | 608 ++++++----- .../harmony/uncategorised/158/expected.json | 464 +++++---- .../harmony/uncategorised/159/expected.json | 312 +++--- .../harmony/uncategorised/16/expected.json | 101 +- .../harmony/uncategorised/160/expected.json | 244 +++-- .../harmony/uncategorised/161/expected.json | 422 +++++--- .../harmony/uncategorised/162/expected.json | 422 +++++--- .../harmony/uncategorised/163/expected.json | 230 +++-- .../harmony/uncategorised/164/expected.json | 244 +++-- .../harmony/uncategorised/165/expected.json | 392 +++++--- .../harmony/uncategorised/166/expected.json | 318 +++--- .../harmony/uncategorised/167/expected.json | 266 +++-- .../harmony/uncategorised/168/expected.json | 840 ++++++++++------ .../harmony/uncategorised/169/expected.json | 277 +++-- .../harmony/uncategorised/17/expected.json | 101 +- .../harmony/uncategorised/170/expected.json | 425 +++++--- .../harmony/uncategorised/171/expected.json | 299 ++++-- .../harmony/uncategorised/172/expected.json | 873 +++++++++------- .../harmony/uncategorised/173/expected.json | 355 ++++--- .../harmony/uncategorised/174/expected.json | 377 ++++--- .../harmony/uncategorised/175/expected.json | 951 +++++++++++------- .../harmony/uncategorised/176/expected.json | 196 ++-- .../harmony/uncategorised/177/expected.json | 230 +++-- .../harmony/uncategorised/178/expected.json | 284 ++++-- .../harmony/uncategorised/179/expected.json | 340 ++++--- .../harmony/uncategorised/18/expected.json | 144 ++- .../harmony/uncategorised/180/expected.json | 266 +++-- .../harmony/uncategorised/181/expected.json | 266 +++-- .../harmony/uncategorised/182/expected.json | 410 +++++--- .../harmony/uncategorised/183/expected.json | 552 ++++++---- .../harmony/uncategorised/184/expected.json | 234 +++-- .../harmony/uncategorised/185/expected.json | 268 +++-- .../harmony/uncategorised/186/expected.json | 486 +++++---- .../harmony/uncategorised/187/expected.json | 338 ++++--- .../harmony/uncategorised/188/expected.json | 238 +++-- .../harmony/uncategorised/189/expected.json | 272 +++-- .../harmony/uncategorised/19/expected.json | 210 ++-- .../harmony/uncategorised/190/expected.json | 490 +++++---- .../harmony/uncategorised/191/expected.json | 342 ++++--- .../harmony/uncategorised/192/expected.json | 200 ++-- .../harmony/uncategorised/193/expected.json | 234 +++-- .../harmony/uncategorised/194/expected.json | 154 ++- .../harmony/uncategorised/195/expected.json | 67 +- .../harmony/uncategorised/196/expected.json | 67 +- .../harmony/uncategorised/197/expected.json | 153 ++- .../harmony/uncategorised/2/expected.json | 101 +- .../harmony/uncategorised/20/expected.json | 288 ++++-- .../harmony/uncategorised/21/expected.json | 144 ++- .../harmony/uncategorised/22/expected.json | 144 ++- .../harmony/uncategorised/23/expected.json | 144 ++- .../harmony/uncategorised/24/expected.json | 144 ++- .../harmony/uncategorised/25/expected.json | 244 +++-- .../harmony/uncategorised/256/expected.json | 169 ++-- .../harmony/uncategorised/257/expected.json | 245 +++-- .../harmony/uncategorised/259/expected.json | 278 +++-- .../harmony/uncategorised/26/expected.json | 490 ++++++--- .../harmony/uncategorised/27/expected.json | 350 ++++--- .../harmony/uncategorised/28/expected.json | 141 ++- .../harmony/uncategorised/29/expected.json | 177 ++-- .../harmony/uncategorised/292/expected.json | 166 ++- .../harmony/uncategorised/299/expected.json | 306 ++++-- .../harmony/uncategorised/3/expected.json | 101 +- .../harmony/uncategorised/30/expected.json | 177 ++-- .../harmony/uncategorised/300/expected.json | 180 +++- .../harmony/uncategorised/301/expected.json | 145 ++- .../harmony/uncategorised/302/expected.json | 226 ++++- .../harmony/uncategorised/303/expected.json | 182 +++- .../harmony/uncategorised/304/expected.json | 289 ++++-- .../harmony/uncategorised/305/expected.json | 257 +++-- .../harmony/uncategorised/306/expected.json | 227 ++++- .../harmony/uncategorised/307/expected.json | 250 ++++- .../harmony/uncategorised/308/expected.json | 257 +++-- .../harmony/uncategorised/309/expected.json | 385 +++++-- .../harmony/uncategorised/31/expected.json | 211 ++-- .../harmony/uncategorised/310/expected.json | 255 +++-- .../harmony/uncategorised/313/expected.json | 253 +++-- .../harmony/uncategorised/314/expected.json | 220 +++- .../harmony/uncategorised/315/expected.json | 292 ++++-- .../harmony/uncategorised/316/expected.json | 220 +++- .../harmony/uncategorised/317/expected.json | 304 ++++-- .../harmony/uncategorised/318/expected.json | 123 ++- .../harmony/uncategorised/319/expected.json | 123 ++- .../harmony/uncategorised/32/expected.json | 245 +++-- .../harmony/uncategorised/320/expected.json | 173 +++- .../harmony/uncategorised/321/expected.json | 196 +++- .../harmony/uncategorised/322/expected.json | 133 ++- .../harmony/uncategorised/323/expected.json | 197 +++- .../harmony/uncategorised/33/expected.json | 288 ++++-- .../harmony/uncategorised/336/expected.json | 105 +- .../harmony/uncategorised/338/expected.json | 154 ++- .../harmony/uncategorised/34/expected.json | 311 +++--- .../harmony/uncategorised/35/expected.json | 279 +++-- .../harmony/uncategorised/36/expected.json | 249 +++-- .../harmony/uncategorised/39/expected.json | 311 +++--- .../harmony/uncategorised/4/expected.json | 101 +- .../harmony/uncategorised/40/expected.json | 177 ++-- .../harmony/uncategorised/41/expected.json | 177 ++-- .../harmony/uncategorised/42/expected.json | 177 ++-- .../harmony/uncategorised/43/expected.json | 211 ++-- .../harmony/uncategorised/44/expected.json | 246 +++-- .../harmony/uncategorised/45/expected.json | 280 ++++-- .../harmony/uncategorised/46/expected.json | 175 ++-- .../harmony/uncategorised/47/expected.json | 253 +++-- .../harmony/uncategorised/48/expected.json | 390 ++++--- .../harmony/uncategorised/49/expected.json | 208 ++-- .../harmony/uncategorised/5/expected.json | 278 +++-- .../harmony/uncategorised/50/expected.json | 278 +++-- .../harmony/uncategorised/51/expected.json | 167 ++- .../harmony/uncategorised/52/expected.json | 316 +++--- .../harmony/uncategorised/53/expected.json | 352 ++++--- .../harmony/uncategorised/54/expected.json | 319 +++--- .../harmony/uncategorised/55/expected.json | 316 +++--- .../harmony/uncategorised/56/expected.json | 316 +++--- .../harmony/uncategorised/57/expected.json | 238 +++-- .../harmony/uncategorised/58/expected.json | 438 ++++---- .../harmony/uncategorised/59/expected.json | 438 ++++---- .../harmony/uncategorised/6/expected.json | 101 +- .../harmony/uncategorised/60/expected.json | 730 ++++++++------ .../harmony/uncategorised/61/expected.json | 384 ++++--- .../harmony/uncategorised/62/expected.json | 306 +++--- .../harmony/uncategorised/63/expected.json | 280 ++++-- .../harmony/uncategorised/64/expected.json | 206 ++-- .../harmony/uncategorised/65/expected.json | 280 ++++-- .../harmony/uncategorised/66/expected.json | 206 ++-- .../harmony/uncategorised/67/expected.json | 280 ++++-- .../harmony/uncategorised/68/expected.json | 206 ++-- .../harmony/uncategorised/69/expected.json | 280 ++++-- .../harmony/uncategorised/7/expected.json | 101 +- .../harmony/uncategorised/70/expected.json | 280 ++++-- .../harmony/uncategorised/71/expected.json | 281 ++++-- .../harmony/uncategorised/72/expected.json | 175 ++-- .../harmony/uncategorised/73/expected.json | 206 ++-- .../harmony/uncategorised/74/expected.json | 174 ++-- .../harmony/uncategorised/75/expected.json | 206 ++-- .../harmony/uncategorised/76/expected.json | 206 ++-- .../harmony/uncategorised/77/expected.json | 174 ++-- .../harmony/uncategorised/78/expected.json | 170 ++-- .../harmony/uncategorised/79/expected.json | 101 +- .../harmony/uncategorised/8/expected.json | 101 +- .../harmony/uncategorised/80/expected.json | 110 +- .../harmony/uncategorised/81/expected.json | 136 ++- .../harmony/uncategorised/82/expected.json | 106 +- .../harmony/uncategorised/83/expected.json | 132 ++- .../harmony/uncategorised/85/expected.json | 101 +- .../harmony/uncategorised/86/expected.json | 172 ++-- .../harmony/uncategorised/87/expected.json | 272 +++-- .../harmony/uncategorised/88/expected.json | 172 ++-- .../harmony/uncategorised/89/expected.json | 272 +++-- .../harmony/uncategorised/9/expected.json | 278 +++-- .../harmony/uncategorised/90/expected.json | 207 ++-- .../harmony/uncategorised/91/expected.json | 103 +- .../harmony/uncategorised/92/expected.json | 171 ++-- .../harmony/uncategorised/93/expected.json | 305 +++--- .../harmony/uncategorised/94/expected.json | 205 ++-- .../harmony/uncategorised/95/expected.json | 289 ++++-- .../harmony/uncategorised/97/expected.json | 205 ++-- .../harmony/uncategorised/98/expected.json | 149 ++- .../harmony/uncategorised/99/expected.json | 241 +++-- test/fixtures/jsx/basic/1/expected.json | 172 ++-- test/fixtures/jsx/basic/10/expected.json | 364 ++++--- test/fixtures/jsx/basic/11/expected.json | 287 +++--- test/fixtures/jsx/basic/12/expected.json | 405 ++++---- test/fixtures/jsx/basic/13/expected.json | 673 +++++++------ test/fixtures/jsx/basic/14/expected.json | 392 ++++---- test/fixtures/jsx/basic/15/expected.json | 540 +++++----- test/fixtures/jsx/basic/16/expected.json | 241 +++-- test/fixtures/jsx/basic/17/expected.json | 248 +++-- test/fixtures/jsx/basic/18/expected.json | 363 ++++--- test/fixtures/jsx/basic/19/expected.json | 550 +++++----- test/fixtures/jsx/basic/2/expected.json | 398 ++++---- test/fixtures/jsx/basic/20/expected.json | 862 ++++++++-------- test/fixtures/jsx/basic/3/expected.json | 903 +++++++++-------- test/fixtures/jsx/basic/4/expected.json | 514 +++++++--- test/fixtures/jsx/basic/5/expected.json | 172 ++-- test/fixtures/jsx/basic/6/expected.json | 244 +++-- test/fixtures/jsx/basic/7/expected.json | 404 ++++---- test/fixtures/jsx/basic/8/expected.json | 594 ++++++----- test/fixtures/jsx/basic/9/expected.json | 318 +++--- test/fixtures/jsx/regression/1/expected.json | 496 +++++++-- test/fixtures/jsx/regression/2/expected.json | 334 ++++-- test/fixtures/jsx/regression/3/expected.json | 320 ++++-- test/fixtures/jsx/regression/4/expected.json | 215 +++- test/fixtures/jsx/regression/5/expected.json | 300 ++++-- test/fixtures/jsx/regression/6/expected.json | 266 +++-- test/fixtures/jsx/regression/7/expected.json | 209 ++-- test/index.js | 3 +- 800 files changed, 121059 insertions(+), 73665 deletions(-) diff --git a/test/fixtures/core/uncategorised/1/expected.json b/test/fixtures/core/uncategorised/1/expected.json index 809dfcce41..a60c7436d9 100644 --- a/test/fixtures/core/uncategorised/1/expected.json +++ b/test/fixtures/core/uncategorised/1/expected.json @@ -1,5 +1,5 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 4, "loc": { @@ -12,24 +12,24 @@ "column": 4 } }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "expression": { - "type": "ThisExpression", + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", "start": 0, "end": 4, "loc": { @@ -41,8 +41,23 @@ "line": 1, "column": 4 } + }, + "expression": { + "type": "ThisExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/10/expected.json b/test/fixtures/core/uncategorised/10/expected.json index 147130ce3a..61f7bde252 100644 --- a/test/fixtures/core/uncategorised/10/expected.json +++ b/test/fixtures/core/uncategorised/10/expected.json @@ -1,77 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [ - { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -81,5 +11,105 @@ "line": 1, "column": 11 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ArrayExpression", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "elements": [ + { + "type": "Literal", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/100/expected.json b/test/fixtures/core/uncategorised/100/expected.json index d90f337fd7..aaafd737c7 100644 --- a/test/fixtures/core/uncategorised/100/expected.json +++ b/test/fixtures/core/uncategorised/100/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "Helloworld", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 2, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "value": "Helloworld", + "rawValue": "Helloworld", + "raw": "\"Hello\\\nworld\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/101/expected.json b/test/fixtures/core/uncategorised/101/expected.json index 3092c17c15..bea6bba9b2 100644 --- a/test/fixtures/core/uncategorised/101/expected.json +++ b/test/fixtures/core/uncategorised/101/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "Hello\u0001World", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 14 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": "Hello\u0001World", + "rawValue": "Hello\u0001World", + "raw": "\"Hello\\1World\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/102/expected.json b/test/fixtures/core/uncategorised/102/expected.json index 026237d552..10904c64ce 100644 --- a/test/fixtures/core/uncategorised/102/expected.json +++ b/test/fixtures/core/uncategorised/102/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": { - "type": "Literal", - "regex": { - "pattern": "[a-z]", - "flags": "i" - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -71,5 +11,94 @@ "line": 1, "column": 16 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 8, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": {}, + "rawValue": {}, + "raw": "/[a-z]/i", + "regex": { + "pattern": "[a-z]", + "flags": "i" + } + } + } + ], + "kind": "var" + } + ] } -} +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/103/expected.json b/test/fixtures/core/uncategorised/103/expected.json index d9314c1c7b..9b73103b2b 100644 --- a/test/fixtures/core/uncategorised/103/expected.json +++ b/test/fixtures/core/uncategorised/103/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": { - "type": "Literal", - "regex": { - "pattern": "[x-z]", - "flags": "i" - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -71,5 +11,94 @@ "line": 1, "column": 16 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 8, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": {}, + "rawValue": {}, + "raw": "/[x-z]/i", + "regex": { + "pattern": "[x-z]", + "flags": "i" + } + } + } + ], + "kind": "var" + } + ] } -} +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/104/expected.json b/test/fixtures/core/uncategorised/104/expected.json index 3fa735a875..4c39200a1b 100644 --- a/test/fixtures/core/uncategorised/104/expected.json +++ b/test/fixtures/core/uncategorised/104/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": { - "type": "Literal", - "regex": { - "pattern": "[a-c]", - "flags": "i" - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -71,5 +11,94 @@ "line": 1, "column": 16 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 8, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": {}, + "rawValue": {}, + "raw": "/[a-c]/i", + "regex": { + "pattern": "[a-c]", + "flags": "i" + } + } + } + ], + "kind": "var" + } + ] } -} +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/105/expected.json b/test/fixtures/core/uncategorised/105/expected.json index 2f9fdd7610..70658dc7a2 100644 --- a/test/fixtures/core/uncategorised/105/expected.json +++ b/test/fixtures/core/uncategorised/105/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": { - "type": "Literal", - "regex": { - "pattern": "[P QR]", - "flags": "i" - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -71,5 +11,94 @@ "line": 1, "column": 17 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 8, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": {}, + "rawValue": {}, + "raw": "/[P QR]/i", + "regex": { + "pattern": "[P QR]", + "flags": "i" + } + } + } + ], + "kind": "var" + } + ] } -} +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/106/expected.json b/test/fixtures/core/uncategorised/106/expected.json index 6bf5845497..e127e99aae 100644 --- a/test/fixtures/core/uncategorised/106/expected.json +++ b/test/fixtures/core/uncategorised/106/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": { - "type": "Literal", - "regex": { - "pattern": "foo\\/bar", - "flags": "" - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -71,5 +11,94 @@ "line": 1, "column": 18 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 8, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": {}, + "rawValue": {}, + "raw": "/foo\\/bar/", + "regex": { + "pattern": "foo\\/bar", + "flags": "" + } + } + } + ], + "kind": "var" + } + ] } -} +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/107/expected.json b/test/fixtures/core/uncategorised/107/expected.json index 67dc4f80bf..be76b814d0 100644 --- a/test/fixtures/core/uncategorised/107/expected.json +++ b/test/fixtures/core/uncategorised/107/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": { - "type": "Literal", - "regex": { - "pattern": "=([^=\\s])+", - "flags": "g" - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], + "type": "File", + "start": 0, + "end": 21, "loc": { "start": { "line": 1, @@ -71,5 +11,94 @@ "line": 1, "column": 21 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": {}, + "rawValue": {}, + "raw": "/=([^=\\s])+/g", + "regex": { + "pattern": "=([^=\\s])+", + "flags": "g" + } + } + } + ], + "kind": "var" + } + ] } -} +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/108/expected.json b/test/fixtures/core/uncategorised/108/expected.json index 745fbd2d94..3aaf113ec2 100644 --- a/test/fixtures/core/uncategorised/108/expected.json +++ b/test/fixtures/core/uncategorised/108/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": { - "type": "Literal", - "regex": { - "pattern": "[P QR]", - "flags": "g" - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -71,5 +11,94 @@ "line": 1, "column": 22 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 8, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": {}, + "rawValue": {}, + "raw": "/[P QR]/\\u0067", + "regex": { + "pattern": "[P QR]", + "flags": "g" + } + } + } + ], + "kind": "var" + } + ] } -} +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/109/expected.json b/test/fixtures/core/uncategorised/109/expected.json index 9619d09764..08c175955a 100644 --- a/test/fixtures/core/uncategorised/109/expected.json +++ b/test/fixtures/core/uncategorised/109/expected.json @@ -1,48 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "Button", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], + "type": "File", + "start": 0, + "end": 10, "loc": { "start": { "line": 1, @@ -52,5 +11,70 @@ "line": 1, "column": 10 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "Button" + }, + "arguments": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/11/expected.json b/test/fixtures/core/uncategorised/11/expected.json index 09fb5c230f..3eecd02bc8 100644 --- a/test/fixtures/core/uncategorised/11/expected.json +++ b/test/fixtures/core/uncategorised/11/expected.json @@ -1,79 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [ - null, - null, - { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -83,5 +11,107 @@ "line": 1, "column": 13 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ArrayExpression", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "elements": [ + null, + null, + { + "type": "Literal", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/110/expected.json b/test/fixtures/core/uncategorised/110/expected.json index c084b798c6..782d5ea7e4 100644 --- a/test/fixtures/core/uncategorised/110/expected.json +++ b/test/fixtures/core/uncategorised/110/expected.json @@ -1,48 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "Button", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -52,5 +11,70 @@ "line": 1, "column": 12 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "Button" + }, + "arguments": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/111/expected.json b/test/fixtures/core/uncategorised/111/expected.json index 041355249b..376081c391 100644 --- a/test/fixtures/core/uncategorised/111/expected.json +++ b/test/fixtures/core/uncategorised/111/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "NewExpression", - "callee": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 11 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callee": { + "type": "NewExpression", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callee": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "arguments": [] + }, + "arguments": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/112/expected.json b/test/fixtures/core/uncategorised/112/expected.json index 5f522115f5..5c476aa6cf 100644 --- a/test/fixtures/core/uncategorised/112/expected.json +++ b/test/fixtures/core/uncategorised/112/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "NewExpression", - "callee": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 13 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "NewExpression", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "foo" + }, + "arguments": [] + }, + "arguments": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/113/expected.json b/test/fixtures/core/uncategorised/113/expected.json index 1921ad4ea2..1b87993df9 100644 --- a/test/fixtures/core/uncategorised/113/expected.json +++ b/test/fixtures/core/uncategorised/113/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "property": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], + "type": "File", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 15 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "object": { + "type": "NewExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "arguments": [] + }, + "property": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "bar" + }, + "computed": false + }, + "arguments": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/114/expected.json b/test/fixtures/core/uncategorised/114/expected.json index 8c7a8329e6..952d418f50 100644 --- a/test/fixtures/core/uncategorised/114/expected.json +++ b/test/fixtures/core/uncategorised/114/expected.json @@ -1,76 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "NewExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "property": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -80,5 +11,102 @@ "line": 1, "column": 12 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "MemberExpression", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "object": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "property": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "bar" + }, + "computed": true + }, + "arguments": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/115/expected.json b/test/fixtures/core/uncategorised/115/expected.json index ea55e6febf..7ace856b56 100644 --- a/test/fixtures/core/uncategorised/115/expected.json +++ b/test/fixtures/core/uncategorised/115/expected.json @@ -1,76 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "NewExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "property": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -80,5 +11,102 @@ "line": 1, "column": 13 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "MemberExpression", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "object": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "property": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "bar" + }, + "computed": false + }, + "arguments": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/116/expected.json b/test/fixtures/core/uncategorised/116/expected.json index ce81b7ca7e..b353ef2c83 100644 --- a/test/fixtures/core/uncategorised/116/expected.json +++ b/test/fixtures/core/uncategorised/116/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "property": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -94,5 +11,119 @@ "line": 1, "column": 16 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "object": { + "type": "NewExpression", + "start": 2, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "foo" + }, + "arguments": [], + "parenthesizedExpression": true + }, + "property": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "bar" + }, + "computed": false + }, + "arguments": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/117/expected.json b/test/fixtures/core/uncategorised/117/expected.json index 94b30d5af9..c20918ced6 100644 --- a/test/fixtures/core/uncategorised/117/expected.json +++ b/test/fixtures/core/uncategorised/117/expected.json @@ -1,77 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - { - "type": "Identifier", - "name": "baz", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -81,5 +11,103 @@ "line": 1, "column": 13 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "foo" + }, + "arguments": [ + { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "bar" + }, + { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "baz" + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/118/expected.json b/test/fixtures/core/uncategorised/118/expected.json index 89fcab4775..6105d2841a 100644 --- a/test/fixtures/core/uncategorised/118/expected.json +++ b/test/fixtures/core/uncategorised/118/expected.json @@ -1,48 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -52,5 +11,71 @@ "line": 1, "column": 13 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "Identifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "foo", + "parenthesizedExpression": true + }, + "arguments": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/119/expected.json b/test/fixtures/core/uncategorised/119/expected.json index a4a75d5d71..937e364bb2 100644 --- a/test/fixtures/core/uncategorised/119/expected.json +++ b/test/fixtures/core/uncategorised/119/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "universe", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "property": { - "type": "Identifier", - "name": "milkyway", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 17 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "milkyway" + }, + "computed": false + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/12/expected.json b/test/fixtures/core/uncategorised/12/expected.json index fb04ed1c0e..e41172db76 100644 --- a/test/fixtures/core/uncategorised/12/expected.json +++ b/test/fixtures/core/uncategorised/12/expected.json @@ -1,105 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [ - { - "type": "Literal", - "value": 1, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - { - "type": "Literal", - "value": 2, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - { - "type": "Literal", - "value": 3, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -109,5 +11,141 @@ "line": 1, "column": 16 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ArrayExpression", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "elements": [ + { + "type": "Literal", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + { + "type": "Literal", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + }, + { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/120/expected.json b/test/fixtures/core/uncategorised/120/expected.json index 80e1b9700c..9b9c988c91 100644 --- a/test/fixtures/core/uncategorised/120/expected.json +++ b/test/fixtures/core/uncategorised/120/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "MemberExpression", - "object": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "universe", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "property": { - "type": "Identifier", - "name": "milkyway", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "property": { - "type": "Identifier", - "name": "solarsystem", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], + "type": "File", + "start": 0, + "end": 29, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 29 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "milkyway" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 18, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "solarsystem" + }, + "computed": false + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/121/expected.json b/test/fixtures/core/uncategorised/121/expected.json index 67d709a9b7..e160672e6a 100644 --- a/test/fixtures/core/uncategorised/121/expected.json +++ b/test/fixtures/core/uncategorised/121/expected.json @@ -1,118 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "MemberExpression", - "object": { - "type": "MemberExpression", - "object": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "universe", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "property": { - "type": "Identifier", - "name": "milkyway", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "property": { - "type": "Identifier", - "name": "solarsystem", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "property": { - "type": "Identifier", - "name": "Earth", - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], + "type": "File", + "start": 0, + "end": 35, "loc": { "start": { "line": 1, @@ -122,5 +11,150 @@ "line": 1, "column": 35 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "milkyway" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 18, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "solarsystem" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "Earth" + }, + "computed": false + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/122/expected.json b/test/fixtures/core/uncategorised/122/expected.json index 9e20a28046..269aad8658 100644 --- a/test/fixtures/core/uncategorised/122/expected.json +++ b/test/fixtures/core/uncategorised/122/expected.json @@ -1,91 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "universe", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "property": { - "type": "SequenceExpression", - "expressions": [ - { - "type": "Identifier", - "name": "galaxyName", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - { - "type": "Identifier", - "name": "otherUselessName", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } - } - } - ], + "type": "File", + "start": 0, + "end": 38, "loc": { "start": { "line": 1, @@ -95,5 +11,119 @@ "line": 1, "column": 38 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "SequenceExpression", + "start": 9, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "galaxyName" + }, + { + "type": "Identifier", + "start": 21, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "name": "otherUselessName" + } + ] + }, + "computed": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/123/expected.json b/test/fixtures/core/uncategorised/123/expected.json index 5f28a31868..fd2ad08336 100644 --- a/test/fixtures/core/uncategorised/123/expected.json +++ b/test/fixtures/core/uncategorised/123/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "universe", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "property": { - "type": "Identifier", - "name": "galaxyName", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], + "type": "File", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 20 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "galaxyName" + }, + "computed": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/124/expected.json b/test/fixtures/core/uncategorised/124/expected.json index 7ba8d661fb..cca9b0fc82 100644 --- a/test/fixtures/core/uncategorised/124/expected.json +++ b/test/fixtures/core/uncategorised/124/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "MemberExpression", - "object": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "universe", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "property": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "galaxies", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], + "type": "File", + "start": 0, + "end": 21, "loc": { "start": { "line": 1, @@ -94,5 +11,120 @@ "line": 1, "column": 21 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Literal", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + }, + "computed": true + }, + "property": { + "type": "Identifier", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "galaxies" + }, + "computed": false + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/125/expected.json b/test/fixtures/core/uncategorised/125/expected.json index ec15b796b1..463a77c2e5 100644 --- a/test/fixtures/core/uncategorised/125/expected.json +++ b/test/fixtures/core/uncategorised/125/expected.json @@ -1,91 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "MemberExpression", - "object": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "universe", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "arguments": [ - { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "galaxies", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], + "type": "File", + "start": 0, + "end": 21, "loc": { "start": { "line": 1, @@ -95,5 +11,121 @@ "line": 1, "column": 21 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "object": { + "type": "CallExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "arguments": [ + { + "type": "Literal", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + ] + }, + "property": { + "type": "Identifier", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "galaxies" + }, + "computed": false + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/126/expected.json b/test/fixtures/core/uncategorised/126/expected.json index 9288ae8da5..fab1521321 100644 --- a/test/fixtures/core/uncategorised/126/expected.json +++ b/test/fixtures/core/uncategorised/126/expected.json @@ -1,176 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "MemberExpression", - "object": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "universe", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "arguments": [ - { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "galaxies", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "arguments": [ - { - "type": "Literal", - "value": 14, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - { - "type": "Literal", - "value": 3, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - { - "type": "Literal", - "value": 77, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "property": { - "type": "Identifier", - "name": "milkyway", - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 41 - } - } - } - ], + "type": "File", + "start": 0, + "end": 41, "loc": { "start": { "line": 1, @@ -180,5 +11,224 @@ "line": 1, "column": 41 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "object": { + "type": "CallExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "object": { + "type": "CallExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "arguments": [ + { + "type": "Literal", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + ] + }, + "property": { + "type": "Identifier", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "galaxies" + }, + "computed": false + }, + "arguments": [ + { + "type": "Literal", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": 14, + "rawValue": 14, + "raw": "14" + }, + { + "type": "Literal", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + }, + { + "type": "Literal", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": 77, + "rawValue": 77, + "raw": "77" + } + ] + }, + "property": { + "type": "Identifier", + "start": 33, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "name": "milkyway" + }, + "computed": false + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/127/expected.json b/test/fixtures/core/uncategorised/127/expected.json index 82d34ff0ae..762a4f980c 100644 --- a/test/fixtures/core/uncategorised/127/expected.json +++ b/test/fixtures/core/uncategorised/127/expected.json @@ -1,147 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "MemberExpression", - "object": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "earth", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "property": { - "type": "Identifier", - "name": "asia", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "property": { - "type": "Identifier", - "name": "Indonesia", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "property": { - "type": "Identifier", - "name": "prepareForElection", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "arguments": [ - { - "type": "Literal", - "value": 2014, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 45 - } - } - } - ], + "type": "File", + "start": 0, + "end": 45, "loc": { "start": { "line": 1, @@ -151,5 +11,185 @@ "line": 1, "column": 45 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "object": { + "type": "MemberExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "earth" + }, + "property": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "asia" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "Indonesia" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 21, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "name": "prepareForElection" + }, + "computed": false + }, + "arguments": [ + { + "type": "Literal", + "start": 40, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "value": 2014, + "rawValue": 2014, + "raw": "2014" + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/128/expected.json b/test/fixtures/core/uncategorised/128/expected.json index 9d4591d62d..41129f5624 100644 --- a/test/fixtures/core/uncategorised/128/expected.json +++ b/test/fixtures/core/uncategorised/128/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "universe", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "property": { - "type": "Identifier", - "name": "if", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 11 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "if" + }, + "computed": false + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/129/expected.json b/test/fixtures/core/uncategorised/129/expected.json index b703e3ae7c..b31bc7542a 100644 --- a/test/fixtures/core/uncategorised/129/expected.json +++ b/test/fixtures/core/uncategorised/129/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "universe", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "property": { - "type": "Identifier", - "name": "true", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 13 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "true" + }, + "computed": false + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/13/expected.json b/test/fixtures/core/uncategorised/13/expected.json index 6b57aa7d8e..df8bef639b 100644 --- a/test/fixtures/core/uncategorised/13/expected.json +++ b/test/fixtures/core/uncategorised/13/expected.json @@ -1,106 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [ - { - "type": "Literal", - "value": 1, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - { - "type": "Literal", - "value": 2, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - null, - { - "type": "Literal", - "value": 3, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -110,5 +11,142 @@ "line": 1, "column": 17 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ArrayExpression", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "elements": [ + { + "type": "Literal", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + { + "type": "Literal", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + }, + null, + { + "type": "Literal", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/130/expected.json b/test/fixtures/core/uncategorised/130/expected.json index af216b81f1..5bc538a2b9 100644 --- a/test/fixtures/core/uncategorised/130/expected.json +++ b/test/fixtures/core/uncategorised/130/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "universe", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "property": { - "type": "Identifier", - "name": "false", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 14 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "false" + }, + "computed": false + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/131/expected.json b/test/fixtures/core/uncategorised/131/expected.json index d7f96322b5..a8f3caddc1 100644 --- a/test/fixtures/core/uncategorised/131/expected.json +++ b/test/fixtures/core/uncategorised/131/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "universe", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "property": { - "type": "Identifier", - "name": "null", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 13 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "universe" + }, + "property": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "null" + }, + "computed": false + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/132/expected.json b/test/fixtures/core/uncategorised/132/expected.json index e037dfeac1..0712715b16 100644 --- a/test/fixtures/core/uncategorised/132/expected.json +++ b/test/fixtures/core/uncategorised/132/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 3 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/133/expected.json b/test/fixtures/core/uncategorised/133/expected.json index 36c6ad9210..c4ea608985 100644 --- a/test/fixtures/core/uncategorised/133/expected.json +++ b/test/fixtures/core/uncategorised/133/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 3 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/134/expected.json b/test/fixtures/core/uncategorised/134/expected.json index 75eddd3ab6..b1909f3acc 100644 --- a/test/fixtures/core/uncategorised/134/expected.json +++ b/test/fixtures/core/uncategorised/134/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "eval" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/135/expected.json b/test/fixtures/core/uncategorised/135/expected.json index d1d60f29f7..aaebc648e7 100644 --- a/test/fixtures/core/uncategorised/135/expected.json +++ b/test/fixtures/core/uncategorised/135/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "eval" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/136/expected.json b/test/fixtures/core/uncategorised/136/expected.json index 4a03ec3711..bb07286fc5 100644 --- a/test/fixtures/core/uncategorised/136/expected.json +++ b/test/fixtures/core/uncategorised/136/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "arguments", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 11 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "arguments" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/137/expected.json b/test/fixtures/core/uncategorised/137/expected.json index c536f4ee65..5fdbf545d2 100644 --- a/test/fixtures/core/uncategorised/137/expected.json +++ b/test/fixtures/core/uncategorised/137/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "arguments", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 11 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "arguments" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/138/expected.json b/test/fixtures/core/uncategorised/138/expected.json index 22c4b3da89..b8e60e420d 100644 --- a/test/fixtures/core/uncategorised/138/expected.json +++ b/test/fixtures/core/uncategorised/138/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 3 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "x" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/139/expected.json b/test/fixtures/core/uncategorised/139/expected.json index 8b6c07e246..74d0f506ec 100644 --- a/test/fixtures/core/uncategorised/139/expected.json +++ b/test/fixtures/core/uncategorised/139/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "--", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 3 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "x" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/14/expected.json b/test/fixtures/core/uncategorised/14/expected.json index 85939fbfb3..ade504173a 100644 --- a/test/fixtures/core/uncategorised/14/expected.json +++ b/test/fixtures/core/uncategorised/14/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "日本語", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 8, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 8 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "日本語" + }, + "right": { + "type": "ArrayExpression", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "elements": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/140/expected.json b/test/fixtures/core/uncategorised/140/expected.json index 5776ff8193..892974799e 100644 --- a/test/fixtures/core/uncategorised/140/expected.json +++ b/test/fixtures/core/uncategorised/140/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "eval" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/141/expected.json b/test/fixtures/core/uncategorised/141/expected.json index 10ad71c713..f82908bc2b 100644 --- a/test/fixtures/core/uncategorised/141/expected.json +++ b/test/fixtures/core/uncategorised/141/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "--", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "eval" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/142/expected.json b/test/fixtures/core/uncategorised/142/expected.json index c2bb8250d3..e190c488dd 100644 --- a/test/fixtures/core/uncategorised/142/expected.json +++ b/test/fixtures/core/uncategorised/142/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "arguments", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 11 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "arguments" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/143/expected.json b/test/fixtures/core/uncategorised/143/expected.json index fa80ce52fc..8451361753 100644 --- a/test/fixtures/core/uncategorised/143/expected.json +++ b/test/fixtures/core/uncategorised/143/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "--", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "arguments", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 11 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 2, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "arguments" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/144/expected.json b/test/fixtures/core/uncategorised/144/expected.json index 612b2354bf..62ee624c4c 100644 --- a/test/fixtures/core/uncategorised/144/expected.json +++ b/test/fixtures/core/uncategorised/144/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UnaryExpression", - "operator": "+", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 2, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 2 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "+", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/145/expected.json b/test/fixtures/core/uncategorised/145/expected.json index adb25023dd..4b614da625 100644 --- a/test/fixtures/core/uncategorised/145/expected.json +++ b/test/fixtures/core/uncategorised/145/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UnaryExpression", - "operator": "-", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 2, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 2 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "-", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/146/expected.json b/test/fixtures/core/uncategorised/146/expected.json index e6eb0b342a..326a3d6c51 100644 --- a/test/fixtures/core/uncategorised/146/expected.json +++ b/test/fixtures/core/uncategorised/146/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UnaryExpression", - "operator": "~", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 2, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 2 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "~", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/147/expected.json b/test/fixtures/core/uncategorised/147/expected.json index 446891530c..5db05c771f 100644 --- a/test/fixtures/core/uncategorised/147/expected.json +++ b/test/fixtures/core/uncategorised/147/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UnaryExpression", - "operator": "!", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 2, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 2 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "!", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/148/expected.json b/test/fixtures/core/uncategorised/148/expected.json index 9928880f3a..776ed71df2 100644 --- a/test/fixtures/core/uncategorised/148/expected.json +++ b/test/fixtures/core/uncategorised/148/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UnaryExpression", - "operator": "void", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "void", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/149/expected.json b/test/fixtures/core/uncategorised/149/expected.json index 813ba67394..f5edc45759 100644 --- a/test/fixtures/core/uncategorised/149/expected.json +++ b/test/fixtures/core/uncategorised/149/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UnaryExpression", - "operator": "delete", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 8, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 8 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "delete", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "x" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/15/expected.json b/test/fixtures/core/uncategorised/15/expected.json index d206b8b00a..81dfb24bee 100644 --- a/test/fixtures/core/uncategorised/15/expected.json +++ b/test/fixtures/core/uncategorised/15/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "T‿", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "T‿" + }, + "right": { + "type": "ArrayExpression", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/150/expected.json b/test/fixtures/core/uncategorised/150/expected.json index e4a26cf36e..137dc642bc 100644 --- a/test/fixtures/core/uncategorised/150/expected.json +++ b/test/fixtures/core/uncategorised/150/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UnaryExpression", - "operator": "typeof", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 8, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 8 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "typeof", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "x" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/151/expected.json b/test/fixtures/core/uncategorised/151/expected.json index 4b4641786c..89022ede9f 100644 --- a/test/fixtures/core/uncategorised/151/expected.json +++ b/test/fixtures/core/uncategorised/151/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "*", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/152/expected.json b/test/fixtures/core/uncategorised/152/expected.json index aa0e1c196a..8a860dd890 100644 --- a/test/fixtures/core/uncategorised/152/expected.json +++ b/test/fixtures/core/uncategorised/152/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "/", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "/", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/153/expected.json b/test/fixtures/core/uncategorised/153/expected.json index 0ed76fe370..2887a84d0e 100644 --- a/test/fixtures/core/uncategorised/153/expected.json +++ b/test/fixtures/core/uncategorised/153/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "%", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "%", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/154/expected.json b/test/fixtures/core/uncategorised/154/expected.json index c42146b10e..951a2c8573 100644 --- a/test/fixtures/core/uncategorised/154/expected.json +++ b/test/fixtures/core/uncategorised/154/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "+", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/155/expected.json b/test/fixtures/core/uncategorised/155/expected.json index 5ab0365976..4be8cd12bf 100644 --- a/test/fixtures/core/uncategorised/155/expected.json +++ b/test/fixtures/core/uncategorised/155/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "-", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/156/expected.json b/test/fixtures/core/uncategorised/156/expected.json index 5df00f2bb4..7da984159e 100644 --- a/test/fixtures/core/uncategorised/156/expected.json +++ b/test/fixtures/core/uncategorised/156/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "<<", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "<<", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/157/expected.json b/test/fixtures/core/uncategorised/157/expected.json index 066d631115..51b1fefd9e 100644 --- a/test/fixtures/core/uncategorised/157/expected.json +++ b/test/fixtures/core/uncategorised/157/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": ">>", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": ">>", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/158/expected.json b/test/fixtures/core/uncategorised/158/expected.json index c57f0248e2..c61c63d02d 100644 --- a/test/fixtures/core/uncategorised/158/expected.json +++ b/test/fixtures/core/uncategorised/158/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": ">>>", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": ">>>", + "right": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/159/expected.json b/test/fixtures/core/uncategorised/159/expected.json index 8f15137317..da2300c3ba 100644 --- a/test/fixtures/core/uncategorised/159/expected.json +++ b/test/fixtures/core/uncategorised/159/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "<", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/16/expected.json b/test/fixtures/core/uncategorised/16/expected.json index 53c98a4b35..5a6cd38868 100644 --- a/test/fixtures/core/uncategorised/16/expected.json +++ b/test/fixtures/core/uncategorised/16/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "T‌", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "T‌" + }, + "right": { + "type": "ArrayExpression", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/160/expected.json b/test/fixtures/core/uncategorised/160/expected.json index 03adf6854c..d036898e8d 100644 --- a/test/fixtures/core/uncategorised/160/expected.json +++ b/test/fixtures/core/uncategorised/160/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": ">", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": ">", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/161/expected.json b/test/fixtures/core/uncategorised/161/expected.json index adf80b0d56..21272df967 100644 --- a/test/fixtures/core/uncategorised/161/expected.json +++ b/test/fixtures/core/uncategorised/161/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "<=", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "<=", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/162/expected.json b/test/fixtures/core/uncategorised/162/expected.json index d83081b57e..4eba25fa96 100644 --- a/test/fixtures/core/uncategorised/162/expected.json +++ b/test/fixtures/core/uncategorised/162/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": ">=", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": ">=", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/163/expected.json b/test/fixtures/core/uncategorised/163/expected.json index 6dcdd50842..179ec5032f 100644 --- a/test/fixtures/core/uncategorised/163/expected.json +++ b/test/fixtures/core/uncategorised/163/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "in", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "in", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/164/expected.json b/test/fixtures/core/uncategorised/164/expected.json index 5130913ef9..8edd71168c 100644 --- a/test/fixtures/core/uncategorised/164/expected.json +++ b/test/fixtures/core/uncategorised/164/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "instanceof", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 14 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "instanceof", + "right": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/165/expected.json b/test/fixtures/core/uncategorised/165/expected.json index ea6154df8d..855baa45d7 100644 --- a/test/fixtures/core/uncategorised/165/expected.json +++ b/test/fixtures/core/uncategorised/165/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "<", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "<", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "<", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/166/expected.json b/test/fixtures/core/uncategorised/166/expected.json index 6a5ae93a3e..c1e5bf26af 100644 --- a/test/fixtures/core/uncategorised/166/expected.json +++ b/test/fixtures/core/uncategorised/166/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "==", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "==", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/167/expected.json b/test/fixtures/core/uncategorised/167/expected.json index 48d93e482e..8eb45e6a10 100644 --- a/test/fixtures/core/uncategorised/167/expected.json +++ b/test/fixtures/core/uncategorised/167/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "!=", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "!=", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/168/expected.json b/test/fixtures/core/uncategorised/168/expected.json index b406c7705a..2610f3986a 100644 --- a/test/fixtures/core/uncategorised/168/expected.json +++ b/test/fixtures/core/uncategorised/168/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "===", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "===", + "right": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/169/expected.json b/test/fixtures/core/uncategorised/169/expected.json index 6e486c77d3..ab3b9424ab 100644 --- a/test/fixtures/core/uncategorised/169/expected.json +++ b/test/fixtures/core/uncategorised/169/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "!==", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "!==", + "right": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/17/expected.json b/test/fixtures/core/uncategorised/17/expected.json index 6e20ae13eb..2fbb41c2a6 100644 --- a/test/fixtures/core/uncategorised/17/expected.json +++ b/test/fixtures/core/uncategorised/17/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "T‍", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "T‍" + }, + "right": { + "type": "ArrayExpression", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/170/expected.json b/test/fixtures/core/uncategorised/170/expected.json index 1a4854758c..a21f7900f7 100644 --- a/test/fixtures/core/uncategorised/170/expected.json +++ b/test/fixtures/core/uncategorised/170/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "&", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/171/expected.json b/test/fixtures/core/uncategorised/171/expected.json index 4a558e1650..9ff129d06b 100644 --- a/test/fixtures/core/uncategorised/171/expected.json +++ b/test/fixtures/core/uncategorised/171/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "^", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/172/expected.json b/test/fixtures/core/uncategorised/172/expected.json index a60ee91846..2c6c6a71aa 100644 --- a/test/fixtures/core/uncategorised/172/expected.json +++ b/test/fixtures/core/uncategorised/172/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "|", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "|", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/173/expected.json b/test/fixtures/core/uncategorised/173/expected.json index a2cd388f43..102f5d3d69 100644 --- a/test/fixtures/core/uncategorised/173/expected.json +++ b/test/fixtures/core/uncategorised/173/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "+", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "+", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/174/expected.json b/test/fixtures/core/uncategorised/174/expected.json index 07cb0ab58f..de56597e6a 100644 --- a/test/fixtures/core/uncategorised/174/expected.json +++ b/test/fixtures/core/uncategorised/174/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "-", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "+", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/175/expected.json b/test/fixtures/core/uncategorised/175/expected.json index a06578f7f0..edc0351968 100644 --- a/test/fixtures/core/uncategorised/175/expected.json +++ b/test/fixtures/core/uncategorised/175/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "+", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "-", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/176/expected.json b/test/fixtures/core/uncategorised/176/expected.json index e7fffe596d..74e0ab65b8 100644 --- a/test/fixtures/core/uncategorised/176/expected.json +++ b/test/fixtures/core/uncategorised/176/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "-", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "-", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "-", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/177/expected.json b/test/fixtures/core/uncategorised/177/expected.json index 6b33fcf6ed..510073e483 100644 --- a/test/fixtures/core/uncategorised/177/expected.json +++ b/test/fixtures/core/uncategorised/177/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "+", - "right": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "*", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/178/expected.json b/test/fixtures/core/uncategorised/178/expected.json index b7f663ee92..5e5fca2313 100644 --- a/test/fixtures/core/uncategorised/178/expected.json +++ b/test/fixtures/core/uncategorised/178/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "+", - "right": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "/", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + }, + "operator": "/", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/179/expected.json b/test/fixtures/core/uncategorised/179/expected.json index 6c019141de..dc0ac6b9bf 100644 --- a/test/fixtures/core/uncategorised/179/expected.json +++ b/test/fixtures/core/uncategorised/179/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "-", - "right": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "%", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "-", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + }, + "operator": "%", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/18/expected.json b/test/fixtures/core/uncategorised/18/expected.json index 65188d0276..86195734f1 100644 --- a/test/fixtures/core/uncategorised/18/expected.json +++ b/test/fixtures/core/uncategorised/18/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "ⅣⅡ", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "ⅣⅡ" + }, + "right": { + "type": "ArrayExpression", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/180/expected.json b/test/fixtures/core/uncategorised/180/expected.json index ab7ffa29f9..4beef8dd3d 100644 --- a/test/fixtures/core/uncategorised/180/expected.json +++ b/test/fixtures/core/uncategorised/180/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "*", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "*", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/181/expected.json b/test/fixtures/core/uncategorised/181/expected.json index 4e5d9b30ea..9d743b0d39 100644 --- a/test/fixtures/core/uncategorised/181/expected.json +++ b/test/fixtures/core/uncategorised/181/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "*", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "/", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "/", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/182/expected.json b/test/fixtures/core/uncategorised/182/expected.json index d4a4206014..3e5a22a223 100644 --- a/test/fixtures/core/uncategorised/182/expected.json +++ b/test/fixtures/core/uncategorised/182/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "*", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "%", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "%", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/183/expected.json b/test/fixtures/core/uncategorised/183/expected.json index 8b33ca21e5..2174559e10 100644 --- a/test/fixtures/core/uncategorised/183/expected.json +++ b/test/fixtures/core/uncategorised/183/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "%", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "*", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "%", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/184/expected.json b/test/fixtures/core/uncategorised/184/expected.json index 2a39ce2b88..92c65557e6 100644 --- a/test/fixtures/core/uncategorised/184/expected.json +++ b/test/fixtures/core/uncategorised/184/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "<<", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "operator": "<<", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 11 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "<<", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + }, + "operator": "<<", + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/185/expected.json b/test/fixtures/core/uncategorised/185/expected.json index 4ef578d702..188c481bfc 100644 --- a/test/fixtures/core/uncategorised/185/expected.json +++ b/test/fixtures/core/uncategorised/185/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "|", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "|", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "|", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "|", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/186/expected.json b/test/fixtures/core/uncategorised/186/expected.json index 1be809919c..3c6c2f0817 100644 --- a/test/fixtures/core/uncategorised/186/expected.json +++ b/test/fixtures/core/uncategorised/186/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "&", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "&", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/187/expected.json b/test/fixtures/core/uncategorised/187/expected.json index 3144ac72bf..48e47e4198 100644 --- a/test/fixtures/core/uncategorised/187/expected.json +++ b/test/fixtures/core/uncategorised/187/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "^", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "^", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/188/expected.json b/test/fixtures/core/uncategorised/188/expected.json index 6b171f1ce6..0fa66acc0b 100644 --- a/test/fixtures/core/uncategorised/188/expected.json +++ b/test/fixtures/core/uncategorised/188/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "&", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "|", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": "|", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/189/expected.json b/test/fixtures/core/uncategorised/189/expected.json index e498c699e3..c8df10d3d8 100644 --- a/test/fixtures/core/uncategorised/189/expected.json +++ b/test/fixtures/core/uncategorised/189/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "|", - "right": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "^", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "|", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/19/expected.json b/test/fixtures/core/uncategorised/19/expected.json index 65188d0276..86195734f1 100644 --- a/test/fixtures/core/uncategorised/19/expected.json +++ b/test/fixtures/core/uncategorised/19/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "ⅣⅡ", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "ⅣⅡ" + }, + "right": { + "type": "ArrayExpression", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/190/expected.json b/test/fixtures/core/uncategorised/190/expected.json index 7fb69d1286..c66d330503 100644 --- a/test/fixtures/core/uncategorised/190/expected.json +++ b/test/fixtures/core/uncategorised/190/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "|", - "right": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "operator": "&", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "|", + "right": { + "type": "BinaryExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + }, + "operator": "&", + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "z" + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/191/expected.json b/test/fixtures/core/uncategorised/191/expected.json index 47fe7bc41b..43821da431 100644 --- a/test/fixtures/core/uncategorised/191/expected.json +++ b/test/fixtures/core/uncategorised/191/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "LogicalExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "||", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "||", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/192/expected.json b/test/fixtures/core/uncategorised/192/expected.json index e04d903ba5..7b3dce0fdb 100644 --- a/test/fixtures/core/uncategorised/192/expected.json +++ b/test/fixtures/core/uncategorised/192/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "LogicalExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "&&", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/193/expected.json b/test/fixtures/core/uncategorised/193/expected.json index 1179b3478d..313205c734 100644 --- a/test/fixtures/core/uncategorised/193/expected.json +++ b/test/fixtures/core/uncategorised/193/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "LogicalExpression", - "left": { - "type": "LogicalExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "||", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "operator": "||", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 11 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "||", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + }, + "operator": "||", + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/194/expected.json b/test/fixtures/core/uncategorised/194/expected.json index 8d625034fc..076e9826f5 100644 --- a/test/fixtures/core/uncategorised/194/expected.json +++ b/test/fixtures/core/uncategorised/194/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "LogicalExpression", - "left": { - "type": "LogicalExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "&&", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "operator": "&&", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 11 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "z" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/195/expected.json b/test/fixtures/core/uncategorised/195/expected.json index 78f4232d49..39a92de27e 100644 --- a/test/fixtures/core/uncategorised/195/expected.json +++ b/test/fixtures/core/uncategorised/195/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "LogicalExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "||", - "right": { - "type": "LogicalExpression", - "left": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "operator": "&&", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 11 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "||", + "right": { + "type": "LogicalExpression", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "z" + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/196/expected.json b/test/fixtures/core/uncategorised/196/expected.json index 192bd76118..27399a9c53 100644 --- a/test/fixtures/core/uncategorised/196/expected.json +++ b/test/fixtures/core/uncategorised/196/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "LogicalExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "||", - "right": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "operator": "^", - "right": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], + "type": "File", + "start": 0, + "end": 10, "loc": { "start": { "line": 1, @@ -94,5 +11,118 @@ "line": 1, "column": 10 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "LogicalExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "||", + "right": { + "type": "BinaryExpression", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + }, + "operator": "^", + "right": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "z" + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/197/expected.json b/test/fixtures/core/uncategorised/197/expected.json index 71d41c2bd0..355a73a1ad 100644 --- a/test/fixtures/core/uncategorised/197/expected.json +++ b/test/fixtures/core/uncategorised/197/expected.json @@ -1,75 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ConditionalExpression", - "test": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "consequent": { - "type": "Literal", - "value": 1, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "alternate": { - "type": "Literal", - "value": 2, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -79,5 +11,105 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "ConditionalExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "test": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "y" + }, + "consequent": { + "type": "Literal", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + "alternate": { + "type": "Literal", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/198/expected.json b/test/fixtures/core/uncategorised/198/expected.json index 9e32ee478e..618615ef5f 100644 --- a/test/fixtures/core/uncategorised/198/expected.json +++ b/test/fixtures/core/uncategorised/198/expected.json @@ -1,103 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ConditionalExpression", - "test": { - "type": "LogicalExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "operator": "&&", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "consequent": { - "type": "Literal", - "value": 1, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "alternate": { - "type": "Literal", - "value": 2, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -107,5 +11,137 @@ "line": 1, "column": 14 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "ConditionalExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "test": { + "type": "LogicalExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "operator": "&&", + "right": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "y" + } + }, + "consequent": { + "type": "Literal", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + "alternate": { + "type": "Literal", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/199/expected.json b/test/fixtures/core/uncategorised/199/expected.json index 33d74af1da..dcfe85d992 100644 --- a/test/fixtures/core/uncategorised/199/expected.json +++ b/test/fixtures/core/uncategorised/199/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -66,5 +11,88 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/2/expected.json b/test/fixtures/core/uncategorised/2/expected.json index aa59ba7b25..62806e9393 100644 --- a/test/fixtures/core/uncategorised/2/expected.json +++ b/test/fixtures/core/uncategorised/2/expected.json @@ -1,5 +1,5 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 4, "loc": { @@ -12,24 +12,24 @@ "column": 4 } }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "expression": { - "type": "Literal", + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", "start": 0, "end": 4, "loc": { @@ -42,10 +42,25 @@ "column": 4 } }, - "value": null, - "rawValue": null, - "raw": "null" + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": null, + "rawValue": null, + "raw": "null" + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/20/expected.json b/test/fixtures/core/uncategorised/20/expected.json index 4d02d1291a..fcc6f37efa 100644 --- a/test/fixtures/core/uncategorised/20/expected.json +++ b/test/fixtures/core/uncategorised/20/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "properties": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/200/expected.json b/test/fixtures/core/uncategorised/200/expected.json index 33bd7aa74b..32e9683fad 100644 --- a/test/fixtures/core/uncategorised/200/expected.json +++ b/test/fixtures/core/uncategorised/200/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -66,5 +11,88 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "eval" + }, + "right": { + "type": "Literal", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/201/expected.json b/test/fixtures/core/uncategorised/201/expected.json index 96dafe01f2..aadc603158 100644 --- a/test/fixtures/core/uncategorised/201/expected.json +++ b/test/fixtures/core/uncategorised/201/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "arguments", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -66,5 +11,88 @@ "line": 1, "column": 14 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "arguments" + }, + "right": { + "type": "Literal", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/202/expected.json b/test/fixtures/core/uncategorised/202/expected.json index 77c3ad2189..c68b13b4a8 100644 --- a/test/fixtures/core/uncategorised/202/expected.json +++ b/test/fixtures/core/uncategorised/202/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "*=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,88 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "*=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/203/expected.json b/test/fixtures/core/uncategorised/203/expected.json index 8a3fd06d68..2a2e320c76 100644 --- a/test/fixtures/core/uncategorised/203/expected.json +++ b/test/fixtures/core/uncategorised/203/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "/=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,88 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "/=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/204/expected.json b/test/fixtures/core/uncategorised/204/expected.json index 0671efd066..f61cd91960 100644 --- a/test/fixtures/core/uncategorised/204/expected.json +++ b/test/fixtures/core/uncategorised/204/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "%=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,88 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "%=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/205/expected.json b/test/fixtures/core/uncategorised/205/expected.json index c0a01fab8b..d87bd7221e 100644 --- a/test/fixtures/core/uncategorised/205/expected.json +++ b/test/fixtures/core/uncategorised/205/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "+=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,88 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "+=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/206/expected.json b/test/fixtures/core/uncategorised/206/expected.json index 425b843c57..58ac4f76d5 100644 --- a/test/fixtures/core/uncategorised/206/expected.json +++ b/test/fixtures/core/uncategorised/206/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "-=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,88 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "-=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/207/expected.json b/test/fixtures/core/uncategorised/207/expected.json index 2369010c4f..6aec1fd6ae 100644 --- a/test/fixtures/core/uncategorised/207/expected.json +++ b/test/fixtures/core/uncategorised/207/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "<<=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 8, "loc": { "start": { "line": 1, @@ -66,5 +11,88 @@ "line": 1, "column": 8 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "<<=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/208/expected.json b/test/fixtures/core/uncategorised/208/expected.json index 6a2a0d471e..2afa7f1ab0 100644 --- a/test/fixtures/core/uncategorised/208/expected.json +++ b/test/fixtures/core/uncategorised/208/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": ">>=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 8, "loc": { "start": { "line": 1, @@ -66,5 +11,88 @@ "line": 1, "column": 8 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": ">>=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/209/expected.json b/test/fixtures/core/uncategorised/209/expected.json index f5122f299e..34ae7fde25 100644 --- a/test/fixtures/core/uncategorised/209/expected.json +++ b/test/fixtures/core/uncategorised/209/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": ">>>=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -66,5 +11,88 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": ">>>=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/21/expected.json b/test/fixtures/core/uncategorised/21/expected.json index 3d6bb1973e..ed3af08e0b 100644 --- a/test/fixtures/core/uncategorised/21/expected.json +++ b/test/fixtures/core/uncategorised/21/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "properties": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/210/expected.json b/test/fixtures/core/uncategorised/210/expected.json index 72c27843a4..a97d4cb79e 100644 --- a/test/fixtures/core/uncategorised/210/expected.json +++ b/test/fixtures/core/uncategorised/210/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "&=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,88 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "&=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/211/expected.json b/test/fixtures/core/uncategorised/211/expected.json index 92d5f8112f..7a092cae1b 100644 --- a/test/fixtures/core/uncategorised/211/expected.json +++ b/test/fixtures/core/uncategorised/211/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "^=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,88 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "^=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/212/expected.json b/test/fixtures/core/uncategorised/212/expected.json index 0332188955..0c297787a4 100644 --- a/test/fixtures/core/uncategorised/212/expected.json +++ b/test/fixtures/core/uncategorised/212/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "|=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,88 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "|=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/213/expected.json b/test/fixtures/core/uncategorised/213/expected.json index 2e84228e77..5d5053da91 100644 --- a/test/fixtures/core/uncategorised/213/expected.json +++ b/test/fixtures/core/uncategorised/213/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -53,5 +11,71 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "Identifier", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "foo" + } + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/214/expected.json b/test/fixtures/core/uncategorised/214/expected.json index c4a8e05788..eec6775871 100644 --- a/test/fixtures/core/uncategorised/214/expected.json +++ b/test/fixtures/core/uncategorised/214/expected.json @@ -1,104 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "doThis", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "doThat", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], + "type": "File", + "start": 0, + "end": 23, "loc": { "start": { "line": 1, @@ -108,5 +11,134 @@ "line": 1, "column": 23 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 2, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "CallExpression", + "start": 2, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "callee": { + "type": "Identifier", + "start": 2, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "doThis" + }, + "arguments": [] + } + }, + { + "type": "ExpressionStatement", + "start": 12, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "CallExpression", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "callee": { + "type": "Identifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "doThat" + }, + "arguments": [] + } + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/215/expected.json b/test/fixtures/core/uncategorised/215/expected.json index 3c9148b75a..5792211240 100644 --- a/test/fixtures/core/uncategorised/215/expected.json +++ b/test/fixtures/core/uncategorised/215/expected.json @@ -1,21 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 2, "loc": { "start": { "line": 1, @@ -25,5 +11,39 @@ "line": 1, "column": 2 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "body": [] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/216/expected.json b/test/fixtures/core/uncategorised/216/expected.json index 36be7ef1e5..ec2dadfcf0 100644 --- a/test/fixtures/core/uncategorised/216/expected.json +++ b/test/fixtures/core/uncategorised/216/expected.json @@ -1,51 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -55,5 +11,73 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": null + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/217/expected.json b/test/fixtures/core/uncategorised/217/expected.json index fb5fa4bf0b..4ed5077fe0 100644 --- a/test/fixtures/core/uncategorised/217/expected.json +++ b/test/fixtures/core/uncategorised/217/expected.json @@ -1,79 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -83,5 +11,105 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "y" + }, + "init": null + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/218/expected.json b/test/fixtures/core/uncategorised/218/expected.json index bb752e2a26..a5b0f49382 100644 --- a/test/fixtures/core/uncategorised/218/expected.json +++ b/test/fixtures/core/uncategorised/218/expected.json @@ -1,64 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], + "type": "File", + "start": 0, + "end": 10, "loc": { "start": { "line": 1, @@ -68,5 +11,90 @@ "line": 1, "column": 10 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/219/expected.json b/test/fixtures/core/uncategorised/219/expected.json index 5615d9f56f..6ed6cc90fa 100644 --- a/test/fixtures/core/uncategorised/219/expected.json +++ b/test/fixtures/core/uncategorised/219/expected.json @@ -1,105 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "init": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "arguments", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "init": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], + "type": "File", + "start": 0, + "end": 29, "loc": { "start": { "line": 1, @@ -109,5 +11,139 @@ "line": 1, "column": 29 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "eval" + }, + "init": { + "type": "Literal", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + }, + { + "type": "VariableDeclarator", + "start": 15, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "arguments" + }, + "init": { + "type": "Literal", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/22/expected.json b/test/fixtures/core/uncategorised/22/expected.json index a43e63a5a7..e737e4bf96 100644 --- a/test/fixtures/core/uncategorised/22/expected.json +++ b/test/fixtures/core/uncategorised/22/expected.json @@ -1,95 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "answer", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "value": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "kind": "init" - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -99,5 +11,140 @@ "line": 1, "column": 18 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "answer" + }, + "value": { + "type": "Literal", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + }, + "kind": "init" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/220/expected.json b/test/fixtures/core/uncategorised/220/expected.json index de593b3f6f..6b9e9e3f3a 100644 --- a/test/fixtures/core/uncategorised/220/expected.json +++ b/test/fixtures/core/uncategorised/220/expected.json @@ -1,146 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": { - "type": "Literal", - "value": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "init": { - "type": "Literal", - "value": 3, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "init": { - "type": "Literal", - "value": 1977, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], + "type": "File", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -150,5 +11,188 @@ "line": 1, "column": 27 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 14, + "rawValue": 14, + "raw": "14" + } + }, + { + "type": "VariableDeclarator", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "y" + }, + "init": { + "type": "Literal", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + }, + { + "type": "VariableDeclarator", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "z" + }, + "init": { + "type": "Literal", + "start": 23, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "value": 1977, + "rawValue": 1977, + "raw": "1977" + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/221/expected.json b/test/fixtures/core/uncategorised/221/expected.json index 61a8414b5a..17a5559327 100644 --- a/test/fixtures/core/uncategorised/221/expected.json +++ b/test/fixtures/core/uncategorised/221/expected.json @@ -1,107 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "implements", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "interface", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "package", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], + "type": "File", + "start": 0, + "end": 34, "loc": { "start": { "line": 1, @@ -111,5 +11,137 @@ "line": 1, "column": 34 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "implements" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 16, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "interface" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "name": "package" + }, + "init": null + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/222/expected.json b/test/fixtures/core/uncategorised/222/expected.json index 7fa42d7b08..8744560249 100644 --- a/test/fixtures/core/uncategorised/222/expected.json +++ b/test/fixtures/core/uncategorised/222/expected.json @@ -1,135 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "private", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "protected", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "public", - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "static", - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } - } - } - ], + "type": "File", + "start": 0, + "end": 38, "loc": { "start": { "line": 1, @@ -139,5 +11,169 @@ "line": 1, "column": 38 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "private" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "protected" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "name": "public" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "name": "static" + }, + "init": null + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/223/expected.json b/test/fixtures/core/uncategorised/223/expected.json index fbaa880052..d76894f1aa 100644 --- a/test/fixtures/core/uncategorised/223/expected.json +++ b/test/fixtures/core/uncategorised/223/expected.json @@ -1,20 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], + "type": "File", + "start": 0, + "end": 1, "loc": { "start": { "line": 1, @@ -24,5 +11,38 @@ "line": 1, "column": 1 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "EmptyStatement", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/224/expected.json b/test/fixtures/core/uncategorised/224/expected.json index 945e197915..470ad995ab 100644 --- a/test/fixtures/core/uncategorised/224/expected.json +++ b/test/fixtures/core/uncategorised/224/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], + "type": "File", + "start": 0, + "end": 1, "loc": { "start": { "line": 1, @@ -38,5 +11,54 @@ "line": 1, "column": 1 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/225/expected.json b/test/fixtures/core/uncategorised/225/expected.json index c3ec6db0da..a1f0e67018 100644 --- a/test/fixtures/core/uncategorised/225/expected.json +++ b/test/fixtures/core/uncategorised/225/expected.json @@ -1,63 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "SequenceExpression", - "expressions": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], + "type": "File", + "start": 0, + "end": 4, "loc": { "start": { "line": 1, @@ -67,5 +11,87 @@ "line": 1, "column": 4 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "y" + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/226/expected.json b/test/fixtures/core/uncategorised/226/expected.json index 722b86412e..afc7d69fc3 100644 --- a/test/fixtures/core/uncategorised/226/expected.json +++ b/test/fixtures/core/uncategorised/226/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -38,5 +11,54 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "a" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/227/expected.json b/test/fixtures/core/uncategorised/227/expected.json index 2f804f6d04..2f6ae75852 100644 --- a/test/fixtures/core/uncategorised/227/expected.json +++ b/test/fixtures/core/uncategorised/227/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "aa", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -38,5 +11,54 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "aa" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/228/expected.json b/test/fixtures/core/uncategorised/228/expected.json index f5a97cc959..61f0887961 100644 --- a/test/fixtures/core/uncategorised/228/expected.json +++ b/test/fixtures/core/uncategorised/228/expected.json @@ -1,76 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "IfStatement", - "test": { - "type": "Identifier", - "name": "morning", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "consequent": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "goodMorning", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "alternate": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], + "type": "File", + "start": 0, + "end": 26, "loc": { "start": { "line": 1, @@ -80,5 +11,102 @@ "line": 1, "column": 26 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "test": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "morning" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "CallExpression", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "callee": { + "type": "Identifier", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "goodMorning" + }, + "arguments": [] + } + }, + "alternate": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/229/expected.json b/test/fixtures/core/uncategorised/229/expected.json index c98f3067f7..97e2c0b335 100644 --- a/test/fixtures/core/uncategorised/229/expected.json +++ b/test/fixtures/core/uncategorised/229/expected.json @@ -1,77 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "IfStatement", - "test": { - "type": "Identifier", - "name": "morning", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "consequent": { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "alternate": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], + "type": "File", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -81,5 +11,106 @@ "line": 1, "column": 27 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "test": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "morning" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 13, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + }, + "alternate": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/23/expected.json b/test/fixtures/core/uncategorised/23/expected.json index a8b57b2ce0..b7e5bc565e 100644 --- a/test/fixtures/core/uncategorised/23/expected.json +++ b/test/fixtures/core/uncategorised/23/expected.json @@ -1,95 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "if", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "value": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "kind": "init" - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -99,5 +11,140 @@ "line": 1, "column": 14 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "if" + }, + "value": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + }, + "kind": "init" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/230/expected.json b/test/fixtures/core/uncategorised/230/expected.json index 8d1a08beb5..c1930814e6 100644 --- a/test/fixtures/core/uncategorised/230/expected.json +++ b/test/fixtures/core/uncategorised/230/expected.json @@ -1,92 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "IfStatement", - "test": { - "type": "Identifier", - "name": "morning", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "consequent": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "init": { - "type": "Literal", - "value": 0, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "alternate": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], + "type": "File", + "start": 0, + "end": 23, "loc": { "start": { "line": 1, @@ -96,5 +11,122 @@ "line": 1, "column": 23 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "test": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "morning" + }, + "consequent": { + "type": "VariableDeclaration", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + "alternate": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/231/expected.json b/test/fixtures/core/uncategorised/231/expected.json index 615a810ed7..720f53798d 100644 --- a/test/fixtures/core/uncategorised/231/expected.json +++ b/test/fixtures/core/uncategorised/231/expected.json @@ -1,116 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "IfStatement", - "test": { - "type": "Identifier", - "name": "morning", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "consequent": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "goodMorning", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "alternate": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "goodDay", - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - } - } - ], + "type": "File", + "start": 0, + "end": 42, "loc": { "start": { "line": 1, @@ -120,5 +11,148 @@ "line": 1, "column": 42 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "test": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "morning" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 13, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "CallExpression", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "callee": { + "type": "Identifier", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "goodMorning" + }, + "arguments": [] + } + }, + "alternate": { + "type": "ExpressionStatement", + "start": 33, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expression": { + "type": "CallExpression", + "start": 33, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "callee": { + "type": "Identifier", + "start": 33, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "name": "goodDay" + }, + "arguments": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/232/expected.json b/test/fixtures/core/uncategorised/232/expected.json index 9c824e5ad5..a065c54055 100644 --- a/test/fixtures/core/uncategorised/232/expected.json +++ b/test/fixtures/core/uncategorised/232/expected.json @@ -1,75 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "DoWhileStatement", - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "keep", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], + "type": "File", + "start": 0, + "end": 23, "loc": { "start": { "line": 1, @@ -79,5 +11,103 @@ "line": 1, "column": 23 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "DoWhileStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": { + "type": "ExpressionStatement", + "start": 3, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "CallExpression", + "start": 3, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "keep" + }, + "arguments": [] + } + }, + "test": { + "type": "Literal", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/233/expected.json b/test/fixtures/core/uncategorised/233/expected.json index 8aa938b64c..bcc441a257 100644 --- a/test/fixtures/core/uncategorised/233/expected.json +++ b/test/fixtures/core/uncategorised/233/expected.json @@ -1,75 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "DoWhileStatement", - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "keep", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], + "type": "File", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, @@ -79,5 +11,103 @@ "line": 1, "column": 24 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "DoWhileStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": { + "type": "ExpressionStatement", + "start": 3, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "CallExpression", + "start": 3, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "keep" + }, + "arguments": [] + } + }, + "test": { + "type": "Literal", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/234/expected.json b/test/fixtures/core/uncategorised/234/expected.json index 393ddc6671..09c2e86050 100644 --- a/test/fixtures/core/uncategorised/234/expected.json +++ b/test/fixtures/core/uncategorised/234/expected.json @@ -1,161 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "DoWhileStatement", - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "test": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "operator": "<", - "right": { - "type": "Literal", - "value": 10, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], + "type": "File", + "start": 0, + "end": 31, "loc": { "start": { "line": 1, @@ -165,5 +11,201 @@ "line": 1, "column": 31 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "DoWhileStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": { + "type": "BlockStatement", + "start": 3, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" + } + } + }, + { + "type": "ExpressionStatement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "y" + } + } + } + ] + }, + "test": { + "type": "BinaryExpression", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "left": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Literal", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/235/expected.json b/test/fixtures/core/uncategorised/235/expected.json index aa080755bd..2333bd0d07 100644 --- a/test/fixtures/core/uncategorised/235/expected.json +++ b/test/fixtures/core/uncategorised/235/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "BlockStatement", - "body": [ - { - "type": "DoWhileStatement", - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "test": { - "type": "Literal", - "value": false, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": false, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], + "type": "File", + "start": 0, + "end": 30, "loc": { "start": { "line": 1, @@ -94,5 +11,122 @@ "line": 1, "column": 30 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "DoWhileStatement", + "start": 2, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": { + "type": "BlockStatement", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "body": [] + }, + "test": { + "type": "Literal", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": false, + "rawValue": false, + "raw": "false" + } + }, + { + "type": "ExpressionStatement", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "Literal", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": false, + "rawValue": false, + "raw": "false" + } + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/236/expected.json b/test/fixtures/core/uncategorised/236/expected.json index d781712f49..e3ddda1e17 100644 --- a/test/fixtures/core/uncategorised/236/expected.json +++ b/test/fixtures/core/uncategorised/236/expected.json @@ -1,75 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "doSomething", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], + "type": "File", + "start": 0, + "end": 26, "loc": { "start": { "line": 1, @@ -79,5 +11,103 @@ "line": 1, "column": 26 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "ExpressionStatement", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "CallExpression", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "callee": { + "type": "Identifier", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "doSomething" + }, + "arguments": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/237/expected.json b/test/fixtures/core/uncategorised/237/expected.json index 1f220a90d4..bf0cf79afd 100644 --- a/test/fixtures/core/uncategorised/237/expected.json +++ b/test/fixtures/core/uncategorised/237/expected.json @@ -1,161 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "WhileStatement", - "test": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "operator": "<", - "right": { - "type": "Literal", - "value": 10, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], + "type": "File", + "start": 0, + "end": 28, "loc": { "start": { "line": 1, @@ -165,5 +11,201 @@ "line": 1, "column": 28 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "test": { + "type": "BinaryExpression", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Literal", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + } + }, + "body": { + "type": "BlockStatement", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 17, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "x" + } + } + }, + { + "type": "ExpressionStatement", + "start": 22, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "y" + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/238/expected.json b/test/fixtures/core/uncategorised/238/expected.json index c0ce19c702..9474ed02f5 100644 --- a/test/fixtures/core/uncategorised/238/expected.json +++ b/test/fixtures/core/uncategorised/238/expected.json @@ -1,36 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForStatement", - "init": null, - "test": null, - "update": null, - "body": { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 8, "loc": { "start": { "line": 1, @@ -40,5 +11,56 @@ "line": 1, "column": 8 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "init": null, + "test": null, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/239/expected.json b/test/fixtures/core/uncategorised/239/expected.json index 7ef0c060ee..ee4511c5df 100644 --- a/test/fixtures/core/uncategorised/239/expected.json +++ b/test/fixtures/core/uncategorised/239/expected.json @@ -1,37 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForStatement", - "init": null, - "test": null, - "update": null, - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -41,5 +11,57 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "init": null, + "test": null, + "update": null, + "body": { + "type": "BlockStatement", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/24/expected.json b/test/fixtures/core/uncategorised/24/expected.json index 506f2ff87b..91bb601500 100644 --- a/test/fixtures/core/uncategorised/24/expected.json +++ b/test/fixtures/core/uncategorised/24/expected.json @@ -1,95 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "true", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "value": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "kind": "init" - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -99,5 +11,140 @@ "line": 1, "column": 16 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "true" + }, + "value": { + "type": "Literal", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + }, + "kind": "init" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/240/expected.json b/test/fixtures/core/uncategorised/240/expected.json index a028344ff8..0221127370 100644 --- a/test/fixtures/core/uncategorised/240/expected.json +++ b/test/fixtures/core/uncategorised/240/expected.json @@ -1,77 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForStatement", - "init": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "right": { - "type": "Literal", - "value": 0, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "test": null, - "update": null, - "body": { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -81,5 +11,105 @@ "line": 1, "column": 13 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "init": { + "type": "AssignmentExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + "test": null, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/241/expected.json b/test/fixtures/core/uncategorised/241/expected.json index 4ac5605240..46c4e44c8f 100644 --- a/test/fixtures/core/uncategorised/241/expected.json +++ b/test/fixtures/core/uncategorised/241/expected.json @@ -1,92 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForStatement", - "init": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "init": { - "type": "Literal", - "value": 0, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "test": null, - "update": null, - "body": { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -96,5 +11,122 @@ "line": 1, "column": 17 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + "test": null, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/242/expected.json b/test/fixtures/core/uncategorised/242/expected.json index 18973867d8..20b89977b6 100644 --- a/test/fixtures/core/uncategorised/242/expected.json +++ b/test/fixtures/core/uncategorised/242/expected.json @@ -1,133 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForStatement", - "init": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "init": { - "type": "Literal", - "value": 0, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "init": { - "type": "Literal", - "value": 1, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "test": null, - "update": null, - "body": { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], + "type": "File", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, @@ -137,5 +11,171 @@ "line": 1, "column": 24 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 4, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + { + "type": "VariableDeclarator", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "y" + }, + "init": { + "type": "Literal", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "kind": "var" + }, + "test": null, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/243/expected.json b/test/fixtures/core/uncategorised/243/expected.json index 50c2bcfa16..66dff360f5 100644 --- a/test/fixtures/core/uncategorised/243/expected.json +++ b/test/fixtures/core/uncategorised/243/expected.json @@ -1,118 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForStatement", - "init": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "right": { - "type": "Literal", - "value": 0, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "test": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "operator": "<", - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "update": null, - "body": { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], + "type": "File", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, @@ -122,5 +11,154 @@ "line": 1, "column": 20 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "init": { + "type": "AssignmentExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + "test": { + "type": "BinaryExpression", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "left": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Literal", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + }, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/244/expected.json b/test/fixtures/core/uncategorised/244/expected.json index fe82074701..1943c72a2e 100644 --- a/test/fixtures/core/uncategorised/244/expected.json +++ b/test/fixtures/core/uncategorised/244/expected.json @@ -1,146 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForStatement", - "init": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "right": { - "type": "Literal", - "value": 0, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "test": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "operator": "<", - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "update": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "body": { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], + "type": "File", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, @@ -150,5 +11,186 @@ "line": 1, "column": 24 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "init": { + "type": "AssignmentExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + "test": { + "type": "BinaryExpression", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "left": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Literal", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + }, + "update": { + "type": "UpdateExpression", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "x" + } + }, + "body": { + "type": "EmptyStatement", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/245/expected.json b/test/fixtures/core/uncategorised/245/expected.json index d92d7485b0..ea41666efe 100644 --- a/test/fixtures/core/uncategorised/245/expected.json +++ b/test/fixtures/core/uncategorised/245/expected.json @@ -1,189 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForStatement", - "init": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "right": { - "type": "Literal", - "value": 0, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "test": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "operator": "<", - "right": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "update": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "process", - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], + "type": "File", + "start": 0, + "end": 35, "loc": { "start": { "line": 1, @@ -193,5 +11,235 @@ "line": 1, "column": 35 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "init": { + "type": "AssignmentExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "right": { + "type": "Literal", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + "test": { + "type": "BinaryExpression", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "left": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "Literal", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + }, + "update": { + "type": "UpdateExpression", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "x" + } + }, + "body": { + "type": "ExpressionStatement", + "start": 24, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "CallExpression", + "start": 24, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "callee": { + "type": "Identifier", + "start": 24, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "name": "x" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/246/expected.json b/test/fixtures/core/uncategorised/246/expected.json index f04e0c53ec..f95b2f15a7 100644 --- a/test/fixtures/core/uncategorised/246/expected.json +++ b/test/fixtures/core/uncategorised/246/expected.json @@ -1,104 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForInStatement", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "right": { - "type": "Identifier", - "name": "list", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "process", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], + "type": "File", + "start": 0, + "end": 26, "loc": { "start": { "line": 1, @@ -108,5 +11,134 @@ "line": 1, "column": 26 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "right": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 15, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "CallExpression", + "start": 15, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "callee": { + "type": "Identifier", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "x" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/247/expected.json b/test/fixtures/core/uncategorised/247/expected.json index a1f351f933..50d29b5d32 100644 --- a/test/fixtures/core/uncategorised/247/expected.json +++ b/test/fixtures/core/uncategorised/247/expected.json @@ -1,134 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForInStatement", - "left": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "right": { - "type": "Identifier", - "name": "list", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "process", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], + "type": "File", + "start": 0, + "end": 31, "loc": { "start": { "line": 1, @@ -138,5 +11,168 @@ "line": 1, "column": 31 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "x" + }, + "init": null + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "CallExpression", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "callee": { + "type": "Identifier", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "x" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/248/expected.json b/test/fixtures/core/uncategorised/248/expected.json index ad762564fa..7b65e7a6c3 100644 --- a/test/fixtures/core/uncategorised/248/expected.json +++ b/test/fixtures/core/uncategorised/248/expected.json @@ -1,147 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForInStatement", - "left": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "init": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "right": { - "type": "Identifier", - "name": "list", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "process", - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], + "type": "File", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, @@ -151,5 +11,185 @@ "line": 1, "column": 36 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 25, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "CallExpression", + "start": 25, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "callee": { + "type": "Identifier", + "start": 25, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "name": "x" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/249/expected.json b/test/fixtures/core/uncategorised/249/expected.json index 8b456fad89..b0f5f0232d 100644 --- a/test/fixtures/core/uncategorised/249/expected.json +++ b/test/fixtures/core/uncategorised/249/expected.json @@ -1,218 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForInStatement", - "left": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "i", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "init": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": { - "type": "BinaryExpression", - "left": { - "type": "Literal", - "value": 10, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "operator": "in", - "right": { - "type": "ArrayExpression", - "elements": [], - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 43 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 43 - } - } - }, - "right": { - "type": "Identifier", - "name": "list", - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 51 - } - } - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "process", - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 60 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 61 - }, - "end": { - "line": 1, - "column": 62 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 64 - } - } - } - ], + "type": "File", + "start": 0, + "end": 64, "loc": { "start": { "line": 1, @@ -222,5 +11,268 @@ "line": 1, "column": 64 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "i" + }, + "init": { + "type": "FunctionExpression", + "start": 13, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 26, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "argument": { + "type": "BinaryExpression", + "start": 33, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "left": { + "type": "Literal", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + }, + "operator": "in", + "right": { + "type": "ArrayExpression", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "elements": [] + } + } + } + ] + } + } + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 47, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 53, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "expression": { + "type": "CallExpression", + "start": 53, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "callee": { + "type": "Identifier", + "start": 53, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 61, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 61 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "name": "x" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/25/expected.json b/test/fixtures/core/uncategorised/25/expected.json index ff88a51411..bf78e60abe 100644 --- a/test/fixtures/core/uncategorised/25/expected.json +++ b/test/fixtures/core/uncategorised/25/expected.json @@ -1,95 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "false", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "value": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "kind": "init" - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -99,5 +11,140 @@ "line": 1, "column": 17 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "false" + }, + "value": { + "type": "Literal", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + }, + "kind": "init" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/250/expected.json b/test/fixtures/core/uncategorised/250/expected.json index 7efc30fdb0..9ea0854331 100644 --- a/test/fixtures/core/uncategorised/250/expected.json +++ b/test/fixtures/core/uncategorised/250/expected.json @@ -1,63 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ContinueStatement", - "label": null, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], + "type": "File", + "start": 0, + "end": 26, "loc": { "start": { "line": 1, @@ -67,5 +11,89 @@ "line": 1, "column": 26 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "label": null + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/251/expected.json b/test/fixtures/core/uncategorised/251/expected.json index 8d3b0d067f..3cadc13b16 100644 --- a/test/fixtures/core/uncategorised/251/expected.json +++ b/test/fixtures/core/uncategorised/251/expected.json @@ -1,63 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ContinueStatement", - "label": null, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], + "type": "File", + "start": 0, + "end": 25, "loc": { "start": { "line": 1, @@ -67,5 +11,89 @@ "line": 1, "column": 25 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "label": null + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/252/expected.json b/test/fixtures/core/uncategorised/252/expected.json index 73a0589b16..661b7b9d0a 100644 --- a/test/fixtures/core/uncategorised/252/expected.json +++ b/test/fixtures/core/uncategorised/252/expected.json @@ -1,103 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "LabeledStatement", - "body": { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ContinueStatement", - "label": { - "type": "Identifier", - "name": "done", - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "label": { - "type": "Identifier", - "name": "done", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], + "type": "File", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, @@ -107,5 +11,135 @@ "line": 1, "column": 36 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": { + "type": "WhileStatement", + "start": 6, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "test": { + "type": "Literal", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 21, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "label": { + "type": "Identifier", + "start": 30, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "name": "done" + } + } + ] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "done" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/253/expected.json b/test/fixtures/core/uncategorised/253/expected.json index e83212253b..3c06ab2a96 100644 --- a/test/fixtures/core/uncategorised/253/expected.json +++ b/test/fixtures/core/uncategorised/253/expected.json @@ -1,103 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "LabeledStatement", - "body": { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ContinueStatement", - "label": { - "type": "Identifier", - "name": "done", - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "label": { - "type": "Identifier", - "name": "done", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - } - } - ], + "type": "File", + "start": 0, + "end": 37, "loc": { "start": { "line": 1, @@ -107,5 +11,135 @@ "line": 1, "column": 37 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": { + "type": "WhileStatement", + "start": 6, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "test": { + "type": "Literal", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 21, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "label": { + "type": "Identifier", + "start": 30, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "name": "done" + } + } + ] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "done" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/254/expected.json b/test/fixtures/core/uncategorised/254/expected.json index eb738ab13b..1d9fe4c071 100644 --- a/test/fixtures/core/uncategorised/254/expected.json +++ b/test/fixtures/core/uncategorised/254/expected.json @@ -1,63 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "BreakStatement", - "label": null, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -67,5 +11,89 @@ "line": 1, "column": 22 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "label": null + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/255/expected.json b/test/fixtures/core/uncategorised/255/expected.json index d98d298853..de1ad554fa 100644 --- a/test/fixtures/core/uncategorised/255/expected.json +++ b/test/fixtures/core/uncategorised/255/expected.json @@ -1,103 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "LabeledStatement", - "body": { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "BreakStatement", - "label": { - "type": "Identifier", - "name": "done", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "label": { - "type": "Identifier", - "name": "done", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], + "type": "File", + "start": 0, + "end": 33, "loc": { "start": { "line": 1, @@ -107,5 +11,135 @@ "line": 1, "column": 33 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": { + "type": "WhileStatement", + "start": 6, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "test": { + "type": "Literal", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 21, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "label": { + "type": "Identifier", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "done" + } + } + ] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "done" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/256/expected.json b/test/fixtures/core/uncategorised/256/expected.json index f1d77d0bef..62a3160e6e 100644 --- a/test/fixtures/core/uncategorised/256/expected.json +++ b/test/fixtures/core/uncategorised/256/expected.json @@ -1,103 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "LabeledStatement", - "body": { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "BreakStatement", - "label": { - "type": "Identifier", - "name": "done", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "label": { - "type": "Identifier", - "name": "done", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], + "type": "File", + "start": 0, + "end": 34, "loc": { "start": { "line": 1, @@ -107,5 +11,135 @@ "line": 1, "column": 34 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": { + "type": "WhileStatement", + "start": 6, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "test": { + "type": "Literal", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "label": { + "type": "Identifier", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "done" + } + } + ] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "done" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/259/expected.json b/test/fixtures/core/uncategorised/259/expected.json index 543fa99419..3f86692dc7 100644 --- a/test/fixtures/core/uncategorised/259/expected.json +++ b/test/fixtures/core/uncategorised/259/expected.json @@ -1,64 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": null, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -68,5 +11,91 @@ "line": 1, "column": 22 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "argument": null + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/26/expected.json b/test/fixtures/core/uncategorised/26/expected.json index 2e26a73fc9..4a45b6dd41 100644 --- a/test/fixtures/core/uncategorised/26/expected.json +++ b/test/fixtures/core/uncategorised/26/expected.json @@ -1,95 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "null", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "value": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "kind": "init" - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -99,5 +11,140 @@ "line": 1, "column": 16 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "null" + }, + "value": { + "type": "Literal", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + }, + "kind": "init" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/260/expected.json b/test/fixtures/core/uncategorised/260/expected.json index 3ee4467138..f66370e4d6 100644 --- a/test/fixtures/core/uncategorised/260/expected.json +++ b/test/fixtures/core/uncategorised/260/expected.json @@ -1,64 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": null, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], + "type": "File", + "start": 0, + "end": 23, "loc": { "start": { "line": 1, @@ -68,5 +11,91 @@ "line": 1, "column": 23 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "argument": null + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/261/expected.json b/test/fixtures/core/uncategorised/261/expected.json index baa6406ea3..864565296e 100644 --- a/test/fixtures/core/uncategorised/261/expected.json +++ b/test/fixtures/core/uncategorised/261/expected.json @@ -1,77 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], + "type": "File", + "start": 0, + "end": 25, "loc": { "start": { "line": 1, @@ -81,5 +11,106 @@ "line": 1, "column": 25 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "argument": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "x" + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/262/expected.json b/test/fixtures/core/uncategorised/262/expected.json index c2fb7b8e0f..9c0041eb71 100644 --- a/test/fixtures/core/uncategorised/262/expected.json +++ b/test/fixtures/core/uncategorised/262/expected.json @@ -1,105 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "operator": "*", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], + "type": "File", + "start": 0, + "end": 28, "loc": { "start": { "line": 1, @@ -109,5 +11,138 @@ "line": 1, "column": 28 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "argument": { + "type": "BinaryExpression", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "left": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "y" + } + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/265/expected.json b/test/fixtures/core/uncategorised/265/expected.json index 72d3487e27..f4e3da9d15 100644 --- a/test/fixtures/core/uncategorised/265/expected.json +++ b/test/fixtures/core/uncategorised/265/expected.json @@ -1,89 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "WithStatement", - "object": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "right": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -93,5 +11,117 @@ "line": 1, "column": 18 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WithStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "object": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "body": { + "type": "ExpressionStatement", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "foo" + }, + "right": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "bar" + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/266/expected.json b/test/fixtures/core/uncategorised/266/expected.json index fe101ff2ea..9e895a7f45 100644 --- a/test/fixtures/core/uncategorised/266/expected.json +++ b/test/fixtures/core/uncategorised/266/expected.json @@ -1,89 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "WithStatement", - "object": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "right": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], + "type": "File", + "start": 0, + "end": 19, "loc": { "start": { "line": 1, @@ -93,5 +11,117 @@ "line": 1, "column": 19 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WithStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "object": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "body": { + "type": "ExpressionStatement", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "foo" + }, + "right": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "bar" + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/267/expected.json b/test/fixtures/core/uncategorised/267/expected.json index 8fece2fe47..d9e30cca90 100644 --- a/test/fixtures/core/uncategorised/267/expected.json +++ b/test/fixtures/core/uncategorised/267/expected.json @@ -1,104 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "WithStatement", - "object": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "right": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -108,5 +11,134 @@ "line": 1, "column": 22 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WithStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "object": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "body": { + "type": "BlockStatement", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "foo" + }, + "right": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "bar" + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/268/expected.json b/test/fixtures/core/uncategorised/268/expected.json index 55dbb7d6f6..e48fd0f035 100644 --- a/test/fixtures/core/uncategorised/268/expected.json +++ b/test/fixtures/core/uncategorised/268/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "SwitchStatement", - "discriminant": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "cases": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -39,5 +11,55 @@ "line": 1, "column": 13 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "discriminant": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "x" + }, + "cases": [] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/269/expected.json b/test/fixtures/core/uncategorised/269/expected.json index 9f9b759893..62e79f338e 100644 --- a/test/fixtures/core/uncategorised/269/expected.json +++ b/test/fixtures/core/uncategorised/269/expected.json @@ -1,120 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "SwitchStatement", - "discriminant": { - "type": "Identifier", - "name": "answer", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "cases": [ - { - "type": "SwitchCase", - "consequent": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "hi", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - { - "type": "BreakStatement", - "label": null, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } - } - ], - "test": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 41 - } - } - } - ], + "type": "File", + "start": 0, + "end": 41, "loc": { "start": { "line": 1, @@ -124,5 +11,154 @@ "line": 1, "column": 41 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "discriminant": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "answer" + }, + "cases": [ + { + "type": "SwitchCase", + "start": 18, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "consequent": [ + { + "type": "ExpressionStatement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "CallExpression", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "callee": { + "type": "Identifier", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "hi" + }, + "arguments": [] + } + }, + { + "type": "BreakStatement", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "label": null + } + ], + "test": { + "type": "Literal", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/27/expected.json b/test/fixtures/core/uncategorised/27/expected.json index 7f87a9b615..8f6fb8980a 100644 --- a/test/fixtures/core/uncategorised/27/expected.json +++ b/test/fixtures/core/uncategorised/27/expected.json @@ -1,95 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Literal", - "value": "answer", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "kind": "init" - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], + "type": "File", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, @@ -99,5 +11,142 @@ "line": 1, "column": 20 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Literal", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": "answer", + "rawValue": "answer", + "raw": "\"answer\"" + }, + "value": { + "type": "Literal", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + }, + "kind": "init" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/270/expected.json b/test/fixtures/core/uncategorised/270/expected.json index 0422bd04db..b29ad0f66d 100644 --- a/test/fixtures/core/uncategorised/270/expected.json +++ b/test/fixtures/core/uncategorised/270/expected.json @@ -1,150 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "SwitchStatement", - "discriminant": { - "type": "Identifier", - "name": "answer", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "cases": [ - { - "type": "SwitchCase", - "consequent": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "hi", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - { - "type": "BreakStatement", - "label": null, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } - } - ], - "test": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - { - "type": "SwitchCase", - "consequent": [ - { - "type": "BreakStatement", - "label": null, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 54 - } - } - } - ], - "test": null, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 54 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - } - } - ], + "type": "File", + "start": 0, + "end": 56, "loc": { "start": { "line": 1, @@ -154,5 +11,188 @@ "line": 1, "column": 56 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "sourceType": "script", + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "discriminant": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "answer" + }, + "cases": [ + { + "type": "SwitchCase", + "start": 18, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "consequent": [ + { + "type": "ExpressionStatement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "CallExpression", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "callee": { + "type": "Identifier", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "hi" + }, + "arguments": [] + } + }, + { + "type": "BreakStatement", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "label": null + } + ], + "test": { + "type": "Literal", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + }, + { + "type": "SwitchCase", + "start": 40, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "consequent": [ + { + "type": "BreakStatement", + "start": 49, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "label": null + } + ], + "test": null + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/271/expected.json b/test/fixtures/core/uncategorised/271/expected.json index 8e8bbb28f1..ea2201a00e 100644 --- a/test/fixtures/core/uncategorised/271/expected.json +++ b/test/fixtures/core/uncategorised/271/expected.json @@ -1,77 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "LabeledStatement", - "body": { - "type": "ForStatement", - "init": null, - "test": null, - "update": null, - "body": { - "type": "BreakStatement", - "label": { - "type": "Identifier", - "name": "start", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "label": { - "type": "Identifier", - "name": "start", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], + "type": "File", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -81,5 +11,103 @@ "line": 1, "column": 27 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": { + "type": "ForStatement", + "start": 7, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "init": null, + "test": null, + "update": null, + "body": { + "type": "BreakStatement", + "start": 16, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "label": { + "type": "Identifier", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "start" + } + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "start" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/272/expected.json b/test/fixtures/core/uncategorised/272/expected.json index d21a759a3c..cddf16fc26 100644 --- a/test/fixtures/core/uncategorised/272/expected.json +++ b/test/fixtures/core/uncategorised/272/expected.json @@ -1,88 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "LabeledStatement", - "body": { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "body": { - "type": "BreakStatement", - "label": { - "type": "Identifier", - "name": "start", - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "label": { - "type": "Identifier", - "name": "start", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], + "type": "File", + "start": 0, + "end": 31, "loc": { "start": { "line": 1, @@ -92,5 +11,118 @@ "line": 1, "column": 31 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": { + "type": "WhileStatement", + "start": 7, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "test": { + "type": "Literal", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BreakStatement", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "label": { + "type": "Identifier", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "start" + } + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "start" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/273/expected.json b/test/fixtures/core/uncategorised/273/expected.json index 6f0e51bccb..0e9f3c0da0 100644 --- a/test/fixtures/core/uncategorised/273/expected.json +++ b/test/fixtures/core/uncategorised/273/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ThrowStatement", - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 8, "loc": { "start": { "line": 1, @@ -38,5 +11,54 @@ "line": 1, "column": 8 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ThrowStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "argument": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/274/expected.json b/test/fixtures/core/uncategorised/274/expected.json index 60755a161a..91f3d0ffa7 100644 --- a/test/fixtures/core/uncategorised/274/expected.json +++ b/test/fixtures/core/uncategorised/274/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ThrowStatement", - "argument": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "operator": "*", - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 11 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ThrowStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "argument": { + "type": "BinaryExpression", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "y" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/275/expected.json b/test/fixtures/core/uncategorised/275/expected.json index c3151851c8..fe437eefa7 100644 --- a/test/fixtures/core/uncategorised/275/expected.json +++ b/test/fixtures/core/uncategorised/275/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ThrowStatement", - "argument": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "message", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "value": { - "type": "Literal", - "value": "Error", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "kind": "init" - } - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], + "type": "File", + "start": 0, + "end": 26, "loc": { "start": { "line": 1, @@ -71,5 +11,108 @@ "line": 1, "column": 26 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ThrowStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "argument": { + "type": "ObjectExpression", + "start": 6, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "properties": [ + { + "type": "Property", + "start": 8, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "message" + }, + "value": { + "type": "Literal", + "start": 17, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": "Error", + "rawValue": "Error", + "raw": "\"Error\"" + }, + "kind": "init" + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/276/expected.json b/test/fixtures/core/uncategorised/276/expected.json index 08a09f9b8d..49a3324324 100644 --- a/test/fixtures/core/uncategorised/276/expected.json +++ b/test/fixtures/core/uncategorised/276/expected.json @@ -1,76 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "handler": { - "type": "CatchClause", - "param": { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "finalizer": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], + "type": "File", + "start": 0, + "end": 21, "loc": { "start": { "line": 1, @@ -80,5 +11,103 @@ "line": 1, "column": 21 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "param": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "e" + }, + "body": { + "type": "BlockStatement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/277/expected.json b/test/fixtures/core/uncategorised/277/expected.json index b7306ad5c3..4fa8f999b5 100644 --- a/test/fixtures/core/uncategorised/277/expected.json +++ b/test/fixtures/core/uncategorised/277/expected.json @@ -1,76 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "handler": { - "type": "CatchClause", - "param": { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "finalizer": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], + "type": "File", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, @@ -80,5 +11,103 @@ "line": 1, "column": 24 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "param": { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "eval" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/278/expected.json b/test/fixtures/core/uncategorised/278/expected.json index 1615f88a80..42cc2e8bf7 100644 --- a/test/fixtures/core/uncategorised/278/expected.json +++ b/test/fixtures/core/uncategorised/278/expected.json @@ -1,76 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "handler": { - "type": "CatchClause", - "param": { - "type": "Identifier", - "name": "arguments", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "finalizer": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], + "type": "File", + "start": 0, + "end": 29, "loc": { "start": { "line": 1, @@ -80,5 +11,103 @@ "line": 1, "column": 29 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "param": { + "type": "Identifier", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "arguments" + }, + "body": { + "type": "BlockStatement", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/279/expected.json b/test/fixtures/core/uncategorised/279/expected.json index e5cb93d599..bb353db32f 100644 --- a/test/fixtures/core/uncategorised/279/expected.json +++ b/test/fixtures/core/uncategorised/279/expected.json @@ -1,133 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "handler": { - "type": "CatchClause", - "param": { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "say", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "finalizer": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], + "type": "File", + "start": 0, + "end": 28, "loc": { "start": { "line": 1, @@ -137,5 +11,168 @@ "line": 1, "column": 28 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "param": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "e" + }, + "body": { + "type": "BlockStatement", + "start": 18, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "CallExpression", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "callee": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "say" + }, + "arguments": [ + { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "e" + } + ] + } + } + ] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/28/expected.json b/test/fixtures/core/uncategorised/28/expected.json index 26d314d52e..4a5cc05f3d 100644 --- a/test/fixtures/core/uncategorised/28/expected.json +++ b/test/fixtures/core/uncategorised/28/expected.json @@ -1,127 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "value": { - "type": "Literal", - "value": 1, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "kind": "init" - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "value": { - "type": "Literal", - "value": 2, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "kind": "init" - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -131,5 +11,193 @@ "line": 1, "column": 18 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "value": { + "type": "Literal", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "x" + }, + "value": { + "type": "Literal", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + }, + "kind": "init" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/280/expected.json b/test/fixtures/core/uncategorised/280/expected.json index edd04bab82..ca8f6bd080 100644 --- a/test/fixtures/core/uncategorised/280/expected.json +++ b/test/fixtures/core/uncategorised/280/expected.json @@ -1,106 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "handler": null, - "finalizer": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "cleanup", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "stuff", - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], + "type": "File", + "start": 0, + "end": 34, "loc": { "start": { "line": 1, @@ -110,5 +11,137 @@ "line": 1, "column": 34 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [] + }, + "handler": null, + "guardedHandlers": [], + "finalizer": { + "type": "BlockStatement", + "start": 16, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "CallExpression", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "callee": { + "type": "Identifier", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "cleanup" + }, + "arguments": [ + { + "type": "Identifier", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "stuff" + } + ] + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/281/expected.json b/test/fixtures/core/uncategorised/281/expected.json index 8986a4d029..291705c18b 100644 --- a/test/fixtures/core/uncategorised/281/expected.json +++ b/test/fixtures/core/uncategorised/281/expected.json @@ -1,175 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "doThat", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "handler": { - "type": "CatchClause", - "param": { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "say", - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "finalizer": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } - } - } - ], + "type": "File", + "start": 0, + "end": 38, "loc": { "start": { "line": 1, @@ -179,5 +11,216 @@ "line": 1, "column": 38 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "CallExpression", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "callee": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "doThat" + }, + "arguments": [] + } + } + ] + }, + "handler": { + "type": "CatchClause", + "start": 18, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "param": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "e" + }, + "body": { + "type": "BlockStatement", + "start": 28, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "CallExpression", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "callee": { + "type": "Identifier", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "name": "say" + }, + "arguments": [ + { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "e" + } + ] + } + } + ] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/282/expected.json b/test/fixtures/core/uncategorised/282/expected.json index 70f7460324..9dd799f3ee 100644 --- a/test/fixtures/core/uncategorised/282/expected.json +++ b/test/fixtures/core/uncategorised/282/expected.json @@ -1,245 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "doThat", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "handler": { - "type": "CatchClause", - "param": { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "say", - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "finalizer": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "cleanup", - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 56 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "stuff", - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 62 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 63 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 65 - } - } - } - ], + "type": "File", + "start": 0, + "end": 65, "loc": { "start": { "line": 1, @@ -249,5 +11,296 @@ "line": 1, "column": 65 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "CallExpression", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "callee": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "doThat" + }, + "arguments": [] + } + } + ] + }, + "handler": { + "type": "CatchClause", + "start": 18, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "param": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "e" + }, + "body": { + "type": "BlockStatement", + "start": 28, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "CallExpression", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "callee": { + "type": "Identifier", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "name": "say" + }, + "arguments": [ + { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "e" + } + ] + } + } + ] + } + }, + "guardedHandlers": [], + "finalizer": { + "type": "BlockStatement", + "start": 47, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 49, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "expression": { + "type": "CallExpression", + "start": 49, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "callee": { + "type": "Identifier", + "start": 49, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "name": "cleanup" + }, + "arguments": [ + { + "type": "Identifier", + "start": 57, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 57 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "name": "stuff" + } + ] + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/283/expected.json b/test/fixtures/core/uncategorised/283/expected.json index 0dfebca71e..bf36100cfe 100644 --- a/test/fixtures/core/uncategorised/283/expected.json +++ b/test/fixtures/core/uncategorised/283/expected.json @@ -1,20 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "DebuggerStatement", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -24,5 +11,38 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "DebuggerStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/284/expected.json b/test/fixtures/core/uncategorised/284/expected.json index 5ee992a111..8de460e887 100644 --- a/test/fixtures/core/uncategorised/284/expected.json +++ b/test/fixtures/core/uncategorised/284/expected.json @@ -1,91 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "hello", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "sayHi", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], + "type": "File", + "start": 0, + "end": 29, "loc": { "start": { "line": 1, @@ -95,5 +11,121 @@ "line": 1, "column": 29 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "CallExpression", + "start": 19, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "callee": { + "type": "Identifier", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "sayHi" + }, + "arguments": [] + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/285/expected.json b/test/fixtures/core/uncategorised/285/expected.json index 7833226c19..d8bcde0844 100644 --- a/test/fixtures/core/uncategorised/285/expected.json +++ b/test/fixtures/core/uncategorised/285/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], + "type": "File", + "start": 0, + "end": 19, "loc": { "start": { "line": 1, @@ -53,5 +11,73 @@ "line": 1, "column": 19 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "eval" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/286/expected.json b/test/fixtures/core/uncategorised/286/expected.json index 621e675d7b..086e1ef65b 100644 --- a/test/fixtures/core/uncategorised/286/expected.json +++ b/test/fixtures/core/uncategorised/286/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "arguments", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], + "type": "File", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, @@ -53,5 +11,73 @@ "line": 1, "column": 24 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "arguments" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/287/expected.json b/test/fixtures/core/uncategorised/287/expected.json index c8387c81ac..c081c978ea 100644 --- a/test/fixtures/core/uncategorised/287/expected.json +++ b/test/fixtures/core/uncategorised/287/expected.json @@ -1,78 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "test", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "t", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - { - "type": "Identifier", - "name": "t", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], + "type": "File", + "start": 0, + "end": 23, "loc": { "start": { "line": 1, @@ -82,5 +11,106 @@ "line": 1, "column": 23 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "test" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "t" + }, + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "t" + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/288/expected.json b/test/fixtures/core/uncategorised/288/expected.json index 5ddbbf2396..246b6b5a20 100644 --- a/test/fixtures/core/uncategorised/288/expected.json +++ b/test/fixtures/core/uncategorised/288/expected.json @@ -1,91 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": { - "type": "Identifier", - "name": "test", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "t", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "Identifier", - "name": "t", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], + "type": "File", + "start": 0, + "end": 25, "loc": { "start": { "line": 1, @@ -95,5 +11,122 @@ "line": 1, "column": 25 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "test" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "t" + }, + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "t" + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/289/expected.json b/test/fixtures/core/uncategorised/289/expected.json index 8ba2d6394d..c1db4cf35a 100644 --- a/test/fixtures/core/uncategorised/289/expected.json +++ b/test/fixtures/core/uncategorised/289/expected.json @@ -1,120 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "inner", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "use strict", - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 49 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 51 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - } - } - ], + "type": "File", + "start": 0, + "end": 53, "loc": { "start": { "line": 1, @@ -124,5 +11,158 @@ "line": 1, "column": 53 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "eval" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 18, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "inner" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 35, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 37, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "expression": { + "type": "Literal", + "start": 37, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + } + ] + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/29/expected.json b/test/fixtures/core/uncategorised/29/expected.json index afb4307190..6cd7aee600 100644 --- a/test/fixtures/core/uncategorised/29/expected.json +++ b/test/fixtures/core/uncategorised/29/expected.json @@ -1,138 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "width", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "kind": "get", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": { - "type": "Identifier", - "name": "m_width", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } - } - } - ], + "type": "File", + "start": 0, + "end": 38, "loc": { "start": { "line": 1, @@ -142,5 +11,189 @@ "line": 1, "column": 38 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "width" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 15, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 20, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "argument": { + "type": "Identifier", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "name": "m_width" + } + } + ] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/290/expected.json b/test/fixtures/core/uncategorised/290/expected.json index 1bbafe042f..3d1b214f48 100644 --- a/test/fixtures/core/uncategorised/290/expected.json +++ b/test/fixtures/core/uncategorised/290/expected.json @@ -1,106 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "hello", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "sayHi", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], + "type": "File", + "start": 0, + "end": 30, "loc": { "start": { "line": 1, @@ -110,5 +11,138 @@ "line": 1, "column": 30 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "a" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "CallExpression", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "callee": { + "type": "Identifier", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "sayHi" + }, + "arguments": [] + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/291/expected.json b/test/fixtures/core/uncategorised/291/expected.json index 77c1953458..8bc6714852 100644 --- a/test/fixtures/core/uncategorised/291/expected.json +++ b/test/fixtures/core/uncategorised/291/expected.json @@ -1,120 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "hello", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "sayHi", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], + "type": "File", + "start": 0, + "end": 33, "loc": { "start": { "line": 1, @@ -124,5 +11,154 @@ "line": 1, "column": 33 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "b" + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 23, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "CallExpression", + "start": 23, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "callee": { + "type": "Identifier", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "name": "sayHi" + }, + "arguments": [] + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/292/expected.json b/test/fixtures/core/uncategorised/292/expected.json index 350aa3f2a2..70213bc4ee 100644 --- a/test/fixtures/core/uncategorised/292/expected.json +++ b/test/fixtures/core/uncategorised/292/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "hello", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "rest", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], + "type": "File", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -71,5 +11,105 @@ "line": 1, "column": 27 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "RestElement", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "argument": { + "type": "Identifier", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "rest" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/293/expected.json b/test/fixtures/core/uncategorised/293/expected.json index 105ef534fe..73f53f2cd1 100644 --- a/test/fixtures/core/uncategorised/293/expected.json +++ b/test/fixtures/core/uncategorised/293/expected.json @@ -1,81 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "hello", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "rest", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], + "type": "File", + "start": 0, + "end": 30, "loc": { "start": { "line": 1, @@ -85,5 +11,121 @@ "line": 1, "column": 30 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "hello" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "argument": { + "type": "Identifier", + "start": 21, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "rest" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/294/expected.json b/test/fixtures/core/uncategorised/294/expected.json index 876dee77aa..6483debdcd 100644 --- a/test/fixtures/core/uncategorised/294/expected.json +++ b/test/fixtures/core/uncategorised/294/expected.json @@ -1,121 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "hi", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "init": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "sayHi", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], + "type": "File", + "start": 0, + "end": 32, "loc": { "start": { "line": 1, @@ -125,5 +11,155 @@ "line": 1, "column": 32 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "hi" + }, + "init": { + "type": "FunctionExpression", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expression": { + "type": "CallExpression", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "callee": { + "type": "Identifier", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "sayHi" + }, + "arguments": [] + } + } + ] + } + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/295/expected.json b/test/fixtures/core/uncategorised/295/expected.json index 007386e963..3aee1a20fd 100644 --- a/test/fixtures/core/uncategorised/295/expected.json +++ b/test/fixtures/core/uncategorised/295/expected.json @@ -1,139 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "hi", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "init": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "r", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "sayHi", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - } - } - ], + "type": "File", + "start": 0, + "end": 37, "loc": { "start": { "line": 1, @@ -143,5 +11,187 @@ "line": 1, "column": 37 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "hi" + }, + "init": { + "type": "FunctionExpression", + "start": 9, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "RestElement", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "argument": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "r" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "CallExpression", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "callee": { + "type": "Identifier", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "sayHi" + }, + "arguments": [] + } + } + ] + } + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/296/expected.json b/test/fixtures/core/uncategorised/296/expected.json index 438dba8044..b4b770ef03 100644 --- a/test/fixtures/core/uncategorised/296/expected.json +++ b/test/fixtures/core/uncategorised/296/expected.json @@ -1,92 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "hi", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "init": { - "type": "FunctionExpression", - "id": { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], + "type": "File", + "start": 0, + "end": 29, "loc": { "start": { "line": 1, @@ -96,5 +11,122 @@ "line": 1, "column": 29 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "hi" + }, + "init": { + "type": "FunctionExpression", + "start": 9, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "eval" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [] + } + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/297/expected.json b/test/fixtures/core/uncategorised/297/expected.json index 8cbcab195a..75abd7b81c 100644 --- a/test/fixtures/core/uncategorised/297/expected.json +++ b/test/fixtures/core/uncategorised/297/expected.json @@ -1,92 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "hi", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "init": { - "type": "FunctionExpression", - "id": { - "type": "Identifier", - "name": "arguments", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], + "type": "File", + "start": 0, + "end": 34, "loc": { "start": { "line": 1, @@ -96,5 +11,122 @@ "line": 1, "column": 34 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "hi" + }, + "init": { + "type": "FunctionExpression", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "arguments" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [] + } + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/298/expected.json b/test/fixtures/core/uncategorised/298/expected.json index ad34c55881..71c7365c51 100644 --- a/test/fixtures/core/uncategorised/298/expected.json +++ b/test/fixtures/core/uncategorised/298/expected.json @@ -1,134 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "hello", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "init": { - "type": "FunctionExpression", - "id": { - "type": "Identifier", - "name": "hi", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "sayHi", - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 37 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } - } - } - ], + "type": "File", + "start": 0, + "end": 38, "loc": { "start": { "line": 1, @@ -138,5 +11,170 @@ "line": 1, "column": 38 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "hello" + }, + "init": { + "type": "FunctionExpression", + "start": 12, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "hi" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 28, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "CallExpression", + "start": 28, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "callee": { + "type": "Identifier", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "name": "sayHi" + }, + "arguments": [] + } + } + ] + } + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/299/expected.json b/test/fixtures/core/uncategorised/299/expected.json index 87a2546c72..4841a07e51 100644 --- a/test/fixtures/core/uncategorised/299/expected.json +++ b/test/fixtures/core/uncategorised/299/expected.json @@ -1,49 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -53,5 +11,74 @@ "line": 1, "column": 14 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "body": [] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/3/expected.json b/test/fixtures/core/uncategorised/3/expected.json index b7637b18d9..c05561829f 100644 --- a/test/fixtures/core/uncategorised/3/expected.json +++ b/test/fixtures/core/uncategorised/3/expected.json @@ -1,5 +1,5 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 7, "loc": { @@ -12,24 +12,24 @@ "column": 6 } }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "expression": { - "type": "Literal", + "end": { + "line": 2, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", "start": 5, "end": 7, "loc": { @@ -42,10 +42,25 @@ "column": 6 } }, - "value": 42, - "rawValue": 42, - "raw": "42" + "expression": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/30/expected.json b/test/fixtures/core/uncategorised/30/expected.json index bbc41a35af..bfcf233e05 100644 --- a/test/fixtures/core/uncategorised/30/expected.json +++ b/test/fixtures/core/uncategorised/30/expected.json @@ -1,110 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "undef", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "kind": "get", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -114,5 +11,157 @@ "line": 1, "column": 22 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "undef" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/300/expected.json b/test/fixtures/core/uncategorised/300/expected.json index cd22c4fb29..bab8079535 100644 --- a/test/fixtures/core/uncategorised/300/expected.json +++ b/test/fixtures/core/uncategorised/300/expected.json @@ -1,91 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -95,5 +11,119 @@ "line": 2, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "x" + } + }, + { + "type": "ExpressionStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "name": "y" + } + } + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/301/expected.json b/test/fixtures/core/uncategorised/301/expected.json index ee3fee07e2..e7aa5f92ff 100644 --- a/test/fixtures/core/uncategorised/301/expected.json +++ b/test/fixtures/core/uncategorised/301/expected.json @@ -1,91 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "--", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -95,5 +11,119 @@ "line": 2, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "x" + } + }, + { + "type": "ExpressionStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "name": "y" + } + } + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/302/expected.json b/test/fixtures/core/uncategorised/302/expected.json index 51bb077835..668b5a1ccc 100644 --- a/test/fixtures/core/uncategorised/302/expected.json +++ b/test/fixtures/core/uncategorised/302/expected.json @@ -1,51 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], + "type": "File", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, @@ -55,5 +11,97 @@ "line": 1, "column": 20 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x", + "leadingComments": null, + "trailingComments": null + }, + "init": null, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " comment ", + "start": 6, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 6, + 19 + ] + } + ] + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/303/expected.json b/test/fixtures/core/uncategorised/303/expected.json index c6c5c13d74..54b06ec57a 100644 --- a/test/fixtures/core/uncategorised/303/expected.json +++ b/test/fixtures/core/uncategorised/303/expected.json @@ -1,147 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "BlockStatement", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "init": { - "type": "Literal", - "value": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "init": { - "type": "Literal", - "value": 3, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - } - } - ], + "type": "File", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, @@ -151,5 +11,187 @@ "line": 2, "column": 4 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 2, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 14, + "rawValue": 14, + "raw": "14" + } + }, + { + "type": "VariableDeclarator", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "y" + }, + "init": { + "type": "Literal", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + } + ], + "kind": "var" + }, + { + "type": "ExpressionStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "name": "z" + } + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/304/expected.json b/test/fixtures/core/uncategorised/304/expected.json index d2714f41fc..417879a077 100644 --- a/test/fixtures/core/uncategorised/304/expected.json +++ b/test/fixtures/core/uncategorised/304/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ContinueStatement", - "label": null, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "there", - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 32, "loc": { "start": { "line": 1, @@ -94,5 +11,120 @@ "line": 2, "column": 8 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "label": null + }, + { + "type": "ExpressionStatement", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "there" + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/305/expected.json b/test/fixtures/core/uncategorised/305/expected.json index d2714f41fc..85d1c9cc9b 100644 --- a/test/fixtures/core/uncategorised/305/expected.json +++ b/test/fixtures/core/uncategorised/305/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ContinueStatement", - "label": null, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "there", - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 43, "loc": { "start": { "line": 1, @@ -94,5 +11,166 @@ "line": 2, "column": 8 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "label": null, + "leadingComments": null, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 24, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 24, + 34 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 35, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 35, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "there", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 24, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 24, + 34 + ] + } + ] + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/306/expected.json b/test/fixtures/core/uncategorised/306/expected.json index 41a196ed9f..420314dcf8 100644 --- a/test/fixtures/core/uncategorised/306/expected.json +++ b/test/fixtures/core/uncategorised/306/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ContinueStatement", - "label": null, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "there", - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 55, "loc": { "start": { "line": 1, @@ -94,5 +11,166 @@ "line": 2, "column": 18 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "label": null, + "leadingComments": null, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 24, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 24, + 47 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 47, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "expression": { + "type": "Identifier", + "start": 47, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "name": "there", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 24, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 24, + 47 + ] + } + ] + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/307/expected.json b/test/fixtures/core/uncategorised/307/expected.json index 0a0418a45d..6f55ed4658 100644 --- a/test/fixtures/core/uncategorised/307/expected.json +++ b/test/fixtures/core/uncategorised/307/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "BreakStatement", - "label": null, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "there", - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 29, "loc": { "start": { "line": 1, @@ -94,5 +11,120 @@ "line": 2, "column": 8 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "label": null + }, + { + "type": "ExpressionStatement", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 21, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "there" + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/308/expected.json b/test/fixtures/core/uncategorised/308/expected.json index 0a0418a45d..16b5f8de23 100644 --- a/test/fixtures/core/uncategorised/308/expected.json +++ b/test/fixtures/core/uncategorised/308/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "BreakStatement", - "label": null, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "there", - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 40, "loc": { "start": { "line": 1, @@ -94,5 +11,166 @@ "line": 2, "column": 8 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "label": null, + "leadingComments": null, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 21, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 21, + 31 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 32, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "there", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 21, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 21, + 31 + ] + } + ] + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/309/expected.json b/test/fixtures/core/uncategorised/309/expected.json index 312cbfb418..f41d20534e 100644 --- a/test/fixtures/core/uncategorised/309/expected.json +++ b/test/fixtures/core/uncategorised/309/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "WhileStatement", - "test": { - "type": "Literal", - "value": true, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "BreakStatement", - "label": null, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "there", - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 52, "loc": { "start": { "line": 1, @@ -94,5 +11,166 @@ "line": 2, "column": 18 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "test": { + "type": "Literal", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "label": null, + "leadingComments": null, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 21, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 21, + 44 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 44, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "expression": { + "type": "Identifier", + "start": 44, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "name": "there", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 21, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 21, + 44 + ] + } + ] + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/31/expected.json b/test/fixtures/core/uncategorised/31/expected.json index b3798b19ba..a81f0be417 100644 --- a/test/fixtures/core/uncategorised/31/expected.json +++ b/test/fixtures/core/uncategorised/31/expected.json @@ -1,110 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "if", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "kind": "get", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], + "type": "File", + "start": 0, + "end": 19, "loc": { "start": { "line": 1, @@ -114,5 +11,157 @@ "line": 1, "column": 19 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "if" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/310/expected.json b/test/fixtures/core/uncategorised/310/expected.json index cb564bb40f..9098864a2b 100644 --- a/test/fixtures/core/uncategorised/310/expected.json +++ b/test/fixtures/core/uncategorised/310/expected.json @@ -1,91 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": null, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 2, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 25, "loc": { "start": { "line": 1, @@ -95,5 +11,122 @@ "line": 2, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "argument": null + }, + { + "type": "ExpressionStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "name": "x" + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/311/expected.json b/test/fixtures/core/uncategorised/311/expected.json index cb564bb40f..f9a8a99635 100644 --- a/test/fixtures/core/uncategorised/311/expected.json +++ b/test/fixtures/core/uncategorised/311/expected.json @@ -1,91 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": null, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 2, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, @@ -95,5 +11,168 @@ "line": 2, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "argument": null, + "leadingComments": null, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 20, + 30 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "name": "x", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 20, + 30 + ] + } + ] + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/312/expected.json b/test/fixtures/core/uncategorised/312/expected.json index a451b76b12..217daeda72 100644 --- a/test/fixtures/core/uncategorised/312/expected.json +++ b/test/fixtures/core/uncategorised/312/expected.json @@ -1,91 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": null, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - } - } - ], + "type": "File", + "start": 0, + "end": 47, "loc": { "start": { "line": 1, @@ -95,5 +11,168 @@ "line": 2, "column": 15 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "argument": null, + "leadingComments": null, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 19, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 19, + 42 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "expression": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "name": "x", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 19, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 19, + 42 + ] + } + ] + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/313/expected.json b/test/fixtures/core/uncategorised/313/expected.json index 83b1e30f9e..d55af430c7 100644 --- a/test/fixtures/core/uncategorised/313/expected.json +++ b/test/fixtures/core/uncategorised/313/expected.json @@ -1,76 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "BlockStatement", - "body": [ - { - "type": "ThrowStatement", - "argument": { - "type": "Identifier", - "name": "error", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "error", - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -80,5 +11,102 @@ "line": 2, "column": 8 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "body": [ + { + "type": "ThrowStatement", + "start": 2, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "argument": { + "type": "Identifier", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "error" + } + }, + { + "type": "ExpressionStatement", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "error" + } + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/314/expected.json b/test/fixtures/core/uncategorised/314/expected.json index 83b1e30f9e..d0361e267d 100644 --- a/test/fixtures/core/uncategorised/314/expected.json +++ b/test/fixtures/core/uncategorised/314/expected.json @@ -1,76 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "BlockStatement", - "body": [ - { - "type": "ThrowStatement", - "argument": { - "type": "Identifier", - "name": "error", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "error", - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 32, "loc": { "start": { "line": 1, @@ -80,5 +11,149 @@ "line": 2, "column": 8 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "body": [ + { + "type": "ThrowStatement", + "start": 2, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "argument": { + "type": "Identifier", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "error", + "leadingComments": null, + "trailingComments": null + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 13, + 23 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "name": "error", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Comment", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 13, + 23 + ] + } + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/315/expected.json b/test/fixtures/core/uncategorised/315/expected.json index d56eea3cd0..51f1550026 100644 --- a/test/fixtures/core/uncategorised/315/expected.json +++ b/test/fixtures/core/uncategorised/315/expected.json @@ -1,76 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "BlockStatement", - "body": [ - { - "type": "ThrowStatement", - "argument": { - "type": "Identifier", - "name": "error", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "error", - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 44, "loc": { "start": { "line": 1, @@ -80,5 +11,149 @@ "line": 2, "column": 18 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "body": [ + { + "type": "ThrowStatement", + "start": 2, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "argument": { + "type": "Identifier", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "error", + "leadingComments": null, + "trailingComments": null + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 13, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 13, + 36 + ] + } + ] + }, + { + "type": "ExpressionStatement", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "expression": { + "type": "Identifier", + "start": 36, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "name": "error", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " Multiline\nComment ", + "start": 13, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 13, + 36 + ] + } + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/316/expected.json b/test/fixtures/core/uncategorised/316/expected.json index 6605671082..10130f3578 100644 --- a/test/fixtures/core/uncategorised/316/expected.json +++ b/test/fixtures/core/uncategorised/316/expected.json @@ -1,6 +1,7 @@ { - "type": "Program", - "body": [], + "type": "File", + "start": 0, + "end": 0, "loc": { "start": { "line": 1, @@ -10,5 +11,22 @@ "line": 1, "column": 0 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "sourceType": "script", + "body": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/317/expected.json b/test/fixtures/core/uncategorised/317/expected.json index 58ab24f1dd..70a7b043b5 100644 --- a/test/fixtures/core/uncategorised/317/expected.json +++ b/test/fixtures/core/uncategorised/317/expected.json @@ -1,5 +1,7 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 25, "loc": { "start": { "line": 1, @@ -10,76 +12,26 @@ "column": 25 } }, - "body": [ - { - "type": "LabeledStatement", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "body": { - "type": "IfStatement", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "test": { - "type": "Literal", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "value": true - }, - "consequent": { - "type": "BreakStatement", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "label": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "name": "foo" - } - }, - "alternate": null - }, - "label": { - "type": "Identifier", + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 25, "loc": { "start": { "line": 1, @@ -87,11 +39,91 @@ }, "end": { "line": 1, - "column": 3 + "column": 25 } }, - "name": "foo" + "body": { + "type": "IfStatement", + "start": 5, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "test": { + "type": "Literal", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": true, + "rawValue": true, + "raw": "true" + }, + "consequent": { + "type": "BreakStatement", + "start": 15, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "label": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "foo" + } + }, + "alternate": null + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "foo" + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/318/expected.json b/test/fixtures/core/uncategorised/318/expected.json index d0c2574676..1af7d36137 100644 --- a/test/fixtures/core/uncategorised/318/expected.json +++ b/test/fixtures/core/uncategorised/318/expected.json @@ -1,5 +1,7 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 40, "loc": { "start": { "line": 1, @@ -10,33 +12,40 @@ "column": 4 } }, - "body": [ - { - "type": "ExpressionStatement", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 4 - } + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "expression": { - "type": "CallExpression", + "end": { + "line": 4, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 40, "loc": { "start": { "line": 1, - "column": 1 + "column": 0 }, "end": { "line": 4, - "column": 3 + "column": 4 } }, - "callee": { - "type": "FunctionExpression", + "expression": { + "type": "CallExpression", + "start": 1, + "end": 39, "loc": { "start": { "line": 1, @@ -44,65 +53,79 @@ }, "end": { "line": 4, - "column": 1 + "column": 3 } }, - "id": null, - "params": [], - "body": { - "type": "BlockStatement", + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 37, "loc": { "start": { "line": 1, - "column": 13 + "column": 1 }, "end": { "line": 4, "column": 1 } }, - "body": [ - { - "type": "ExpressionStatement", - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 14 - } + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 13 }, - "expression": { - "type": "Literal", - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 13 - } - }, - "value": "use strict" + "end": { + "line": 4, + "column": 1 } }, - { - "type": "ExpressionStatement", - "loc": { - "start": { - "line": 3, - "column": 1 + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 14 + } }, - "end": { - "line": 3, - "column": 5 + "expression": { + "type": "Literal", + "start": 16, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" } }, - "expression": { - "type": "Literal", + { + "type": "ExpressionStatement", + "start": 31, + "end": 35, "loc": { "start": { "line": 3, @@ -110,17 +133,35 @@ }, "end": { "line": 3, - "column": 4 + "column": 5 } }, - "value": "\u0000" + "expression": { + "type": "Literal", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "value": "\u0000", + "rawValue": "\u0000", + "raw": "'\u0000'" + } } - } - ] - } - }, - "arguments": [] + ] + } + }, + "arguments": [], + "parenthesizedExpression": true + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/319/expected.json b/test/fixtures/core/uncategorised/319/expected.json index 420ac0a7e5..7bfda37783 100644 --- a/test/fixtures/core/uncategorised/319/expected.json +++ b/test/fixtures/core/uncategorised/319/expected.json @@ -1,29 +1,133 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Literal", - "value": 123 - }, - "property": { - "type": "Identifier", - "name": "toString" - }, - "computed": false - }, - "arguments": [ - { - "type": "Literal", - "value": 10 - } - ] - } + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "object": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": 123, + "rawValue": 123, + "raw": "123." + }, + "property": { + "type": "Identifier", + "start": 5, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "toString" + }, + "computed": false + }, + "arguments": [ + { + "type": "Literal", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/32/expected.json b/test/fixtures/core/uncategorised/32/expected.json index 298a4d14dd..755ded80c2 100644 --- a/test/fixtures/core/uncategorised/32/expected.json +++ b/test/fixtures/core/uncategorised/32/expected.json @@ -1,110 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "true", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "kind": "get", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], + "type": "File", + "start": 0, + "end": 21, "loc": { "start": { "line": 1, @@ -114,5 +11,157 @@ "line": 1, "column": 21 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "true" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/320/expected.json b/test/fixtures/core/uncategorised/320/expected.json index 0a80f897a3..d18528b0b3 100644 --- a/test/fixtures/core/uncategorised/320/expected.json +++ b/test/fixtures/core/uncategorised/320/expected.json @@ -1,20 +1,100 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Literal", - "value": 123 + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } }, - "operator": "+", - "right": { - "type": "Literal", - "value": 2 + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": 123, + "rawValue": 123, + "raw": "123." + }, + "operator": "+", + "right": { + "type": "Literal", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/321/expected.json b/test/fixtures/core/uncategorised/321/expected.json index 4ee9db8038..0fbaec1ec3 100644 --- a/test/fixtures/core/uncategorised/321/expected.json +++ b/test/fixtures/core/uncategorised/321/expected.json @@ -1,19 +1,95 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "a" + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 } }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "b" + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "a" + } + }, + { + "type": "ExpressionStatement", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "expression": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "name": "b" + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/322/expected.json b/test/fixtures/core/uncategorised/322/expected.json index 93d210e45d..4bb48ca6a4 100644 --- a/test/fixtures/core/uncategorised/322/expected.json +++ b/test/fixtures/core/uncategorised/322/expected.json @@ -1,12 +1,66 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "a&b" - } + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": "a&b", + "rawValue": "a&b", + "raw": "'a\\u0026b'" + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/323/expected.json b/test/fixtures/core/uncategorised/323/expected.json index 7229089d51..ed6fd4e376 100644 --- a/test/fixtures/core/uncategorised/323/expected.json +++ b/test/fixtures/core/uncategorised/323/expected.json @@ -1,35 +1,161 @@ { - "type": "Program", - "body": [ - { - "type": "LabeledStatement", - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 10, - "raw": "10" - } + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "label": { - "type": "Identifier", - "name": "foo" + "end": { + "line": 1, + "column": 17 } }, - { - "type": "LabeledStatement", - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 20, - "raw": "20" + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "body": { + "type": "ExpressionStatement", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "Literal", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "foo" } }, - "label": { - "type": "Identifier", - "name": "foo" + { + "type": "LabeledStatement", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": { + "type": "ExpressionStatement", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "Literal", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": 20, + "rawValue": 20, + "raw": "20" + } + }, + "label": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "foo" + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/324/expected.json b/test/fixtures/core/uncategorised/324/expected.json index 6970b65879..e3345265ad 100644 --- a/test/fixtures/core/uncategorised/324/expected.json +++ b/test/fixtures/core/uncategorised/324/expected.json @@ -1,21 +1,104 @@ { - "type": "Program", - "body": [ - { - "type": "IfStatement", - "test": { - "type": "Literal", - "value": 1, - "raw": "1" - }, - "consequent": { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "raw": "/ foo/" - } - }, - "alternate": null + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "test": { + "type": "Literal", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + "consequent": { + "type": "ExpressionStatement", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "Literal", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": {}, + "rawValue": {}, + "raw": "/ foo/", + "regex": { + "pattern": " foo", + "flags": "" + } + } + }, + "alternate": null + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/325/expected.json b/test/fixtures/core/uncategorised/325/expected.json index 66714d2adf..60a0422da0 100644 --- a/test/fixtures/core/uncategorised/325/expected.json +++ b/test/fixtures/core/uncategorised/325/expected.json @@ -1,12 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "price_9̶9̶_89" - } + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "price_9̶9̶_89" + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/326/expected.json b/test/fixtures/core/uncategorised/326/expected.json index 4fb2fc4901..ddb03e0cb1 100644 --- a/test/fixtures/core/uncategorised/326/expected.json +++ b/test/fixtures/core/uncategorised/326/expected.json @@ -1,28 +1,128 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "a" + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "property": { - "type": "Identifier", - "name": "in" - }, - "computed": false + "end": { + "line": 1, + "column": 8 + } }, - "operator": "/", - "right": { - "type": "Identifier", - "name": "b" + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "left": { + "type": "MemberExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "a" + }, + "property": { + "type": "Identifier", + "start": 2, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "in" + }, + "computed": false + }, + "operator": "/", + "right": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "b" + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/33/expected.json b/test/fixtures/core/uncategorised/33/expected.json index 1570064db1..c8111bb6cc 100644 --- a/test/fixtures/core/uncategorised/33/expected.json +++ b/test/fixtures/core/uncategorised/33/expected.json @@ -1,110 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "false", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "kind": "get", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -114,5 +11,157 @@ "line": 1, "column": 22 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "false" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/34/expected.json b/test/fixtures/core/uncategorised/34/expected.json index 21c70541de..dd04ddeac2 100644 --- a/test/fixtures/core/uncategorised/34/expected.json +++ b/test/fixtures/core/uncategorised/34/expected.json @@ -1,110 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "null", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "kind": "get", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], + "type": "File", + "start": 0, + "end": 21, "loc": { "start": { "line": 1, @@ -114,5 +11,157 @@ "line": 1, "column": 21 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "null" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/341/expected.json b/test/fixtures/core/uncategorised/341/expected.json index a6bce01434..b7f3d7c7f4 100644 --- a/test/fixtures/core/uncategorised/341/expected.json +++ b/test/fixtures/core/uncategorised/341/expected.json @@ -1,16 +1,86 @@ { - "type": "Program", - "body": [ - { - "type": "BlockStatement", - "body": [] + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "raw": "/=/" - } + "end": { + "line": 1, + "column": 5 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "body": [] + }, + { + "type": "ExpressionStatement", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "Literal", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": {}, + "rawValue": {}, + "raw": "/=/", + "regex": { + "pattern": "=", + "flags": "" + } + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/342/expected.json b/test/fixtures/core/uncategorised/342/expected.json index f45317f483..4e26603533 100644 --- a/test/fixtures/core/uncategorised/342/expected.json +++ b/test/fixtures/core/uncategorised/342/expected.json @@ -1,20 +1,141 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Identifier", - "name": "foo" + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } }, - "operator": "+", - "right": { - "type": "Identifier", - "name": "baz" + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "foo", + "leadingComments": null, + "trailingComments": [ + { + "type": "CommentLine", + "value": "bar", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 4, + 11 + ] + } + ] + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "name": "baz", + "leadingComments": [ + { + "type": "CommentLine", + "value": "bar", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 4, + 11 + ] + } + ] + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/343/expected.json b/test/fixtures/core/uncategorised/343/expected.json index d6c7a2b209..4d99a8faca 100644 --- a/test/fixtures/core/uncategorised/343/expected.json +++ b/test/fixtures/core/uncategorised/343/expected.json @@ -1,33 +1,169 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x" + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } }, - "right": { - "type": "BinaryExpression", - "left": { - "type": "UpdateExpression", - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "y" + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 } }, - "operator": ">", + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, "right": { - "type": "Literal", - "value": 10 + "type": "BinaryExpression", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "UpdateExpression", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + }, + "operator": ">", + "right": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + } } - } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " nothing", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "range": [ + 13, + 24 + ] + } + ] } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/344/expected.json b/test/fixtures/core/uncategorised/344/expected.json index 43d34396f7..d8e160600f 100644 --- a/test/fixtures/core/uncategorised/344/expected.json +++ b/test/fixtures/core/uncategorised/344/expected.json @@ -1,32 +1,145 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "use strict", - "raw": "'use strict'" + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 } }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "object" + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "property": { - "type": "Identifier", - "name": "static" - }, - "computed": false + "end": { + "line": 1, + "column": 13 + } }, - "arguments": [] + "expression": { + "type": "Literal", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + }, + { + "type": "ExpressionStatement", + "start": 14, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "expression": { + "type": "CallExpression", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "callee": { + "type": "MemberExpression", + "start": 14, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "object": { + "type": "Identifier", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "name": "object" + }, + "property": { + "type": "Identifier", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "name": "static" + }, + "computed": false + }, + "arguments": [] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/35/expected.json b/test/fixtures/core/uncategorised/35/expected.json index 79053d1df8..d8f2ba1cf2 100644 --- a/test/fixtures/core/uncategorised/35/expected.json +++ b/test/fixtures/core/uncategorised/35/expected.json @@ -1,110 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Literal", - "value": "undef", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "kind": "get", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], + "type": "File", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, @@ -114,5 +11,159 @@ "line": 1, "column": 24 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Literal", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": "undef", + "rawValue": "undef", + "raw": "\"undef\"" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/36/expected.json b/test/fixtures/core/uncategorised/36/expected.json index 3eda42d065..a9d4864fed 100644 --- a/test/fixtures/core/uncategorised/36/expected.json +++ b/test/fixtures/core/uncategorised/36/expected.json @@ -1,110 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Literal", - "value": 10, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "kind": "get", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], + "type": "File", + "start": 0, + "end": 19, "loc": { "start": { "line": 1, @@ -114,5 +11,159 @@ "line": 1, "column": 19 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/37/expected.json b/test/fixtures/core/uncategorised/37/expected.json index ce48e303e1..04f9698103 100644 --- a/test/fixtures/core/uncategorised/37/expected.json +++ b/test/fixtures/core/uncategorised/37/expected.json @@ -1,181 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "width", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "kind": "set", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "m_width", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "right": { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], + "type": "File", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, @@ -185,5 +11,238 @@ "line": 1, "column": 36 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "width" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 15, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 21, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "name": "m_width" + }, + "right": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "w" + } + } + } + ] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/38/expected.json b/test/fixtures/core/uncategorised/38/expected.json index d5018c2302..360b95f14c 100644 --- a/test/fixtures/core/uncategorised/38/expected.json +++ b/test/fixtures/core/uncategorised/38/expected.json @@ -1,181 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "if", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "kind": "set", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "m_if", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "right": { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], + "type": "File", + "start": 0, + "end": 30, "loc": { "start": { "line": 1, @@ -185,5 +11,238 @@ "line": 1, "column": 30 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "if" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 12, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "m_if" + }, + "right": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "w" + } + } + } + ] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/39/expected.json b/test/fixtures/core/uncategorised/39/expected.json index e6c3f5a308..3a2ec9b899 100644 --- a/test/fixtures/core/uncategorised/39/expected.json +++ b/test/fixtures/core/uncategorised/39/expected.json @@ -1,181 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "true", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "kind": "set", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "m_true", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "right": { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], + "type": "File", + "start": 0, + "end": 34, "loc": { "start": { "line": 1, @@ -185,5 +11,238 @@ "line": 1, "column": 34 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "true" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 14, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "m_true" + }, + "right": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "name": "w" + } + } + } + ] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/4/expected.json b/test/fixtures/core/uncategorised/4/expected.json index 55ace9408f..8a599a7f4a 100644 --- a/test/fixtures/core/uncategorised/4/expected.json +++ b/test/fixtures/core/uncategorised/4/expected.json @@ -1,14 +1,37 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "regex": { - "pattern": "foobar", - "flags": "" - }, + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, "loc": { "start": { "line": 1, @@ -18,8 +41,30 @@ "line": 1, "column": 8 } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": {}, + "rawValue": {}, + "raw": "/foobar/", + "regex": { + "pattern": "foobar", + "flags": "" + } } } - } - ] -} + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/40/expected.json b/test/fixtures/core/uncategorised/40/expected.json index 3ea234a071..198c6f8e8d 100644 --- a/test/fixtures/core/uncategorised/40/expected.json +++ b/test/fixtures/core/uncategorised/40/expected.json @@ -1,181 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "false", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "kind": "set", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "m_false", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "right": { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], + "type": "File", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, @@ -185,5 +11,238 @@ "line": 1, "column": 36 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "false" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 15, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 21, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "name": "m_false" + }, + "right": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "w" + } + } + } + ] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/41/expected.json b/test/fixtures/core/uncategorised/41/expected.json index ce5e7a6e6b..8624ffd5ef 100644 --- a/test/fixtures/core/uncategorised/41/expected.json +++ b/test/fixtures/core/uncategorised/41/expected.json @@ -1,181 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "null", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "kind": "set", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "m_null", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "right": { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], + "type": "File", + "start": 0, + "end": 34, "loc": { "start": { "line": 1, @@ -185,5 +11,238 @@ "line": 1, "column": 34 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "null" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 14, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "m_null" + }, + "right": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "name": "w" + } + } + } + ] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/42/expected.json b/test/fixtures/core/uncategorised/42/expected.json index 1c17723f61..fbaae8d9f1 100644 --- a/test/fixtures/core/uncategorised/42/expected.json +++ b/test/fixtures/core/uncategorised/42/expected.json @@ -1,181 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Literal", - "value": "null", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "kind": "set", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "m_null", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "right": { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], + "type": "File", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, @@ -185,5 +11,240 @@ "line": 1, "column": 36 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Literal", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": "null", + "rawValue": "null", + "raw": "\"null\"" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 16, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 22, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "name": "m_null" + }, + "right": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "w" + } + } + } + ] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/43/expected.json b/test/fixtures/core/uncategorised/43/expected.json index 7b570465a9..ae9c51390d 100644 --- a/test/fixtures/core/uncategorised/43/expected.json +++ b/test/fixtures/core/uncategorised/43/expected.json @@ -1,181 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Literal", - "value": 10, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "kind": "set", - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "m_null", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "right": { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], + "type": "File", + "start": 0, + "end": 32, "loc": { "start": { "line": 1, @@ -185,5 +11,240 @@ "line": 1, "column": 32 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 12, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "w" + } + ], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 18, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "m_null" + }, + "right": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "name": "w" + } + } + } + ] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/44/expected.json b/test/fixtures/core/uncategorised/44/expected.json index 7ffd0f04b6..fa0228a80c 100644 --- a/test/fixtures/core/uncategorised/44/expected.json +++ b/test/fixtures/core/uncategorised/44/expected.json @@ -1,95 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "value": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "kind": "init" - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], + "type": "File", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, @@ -99,5 +11,140 @@ "line": 1, "column": 15 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "get" + }, + "value": { + "type": "Literal", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + }, + "kind": "init" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/45/expected.json b/test/fixtures/core/uncategorised/45/expected.json index e983e5cf2b..360cc1183c 100644 --- a/test/fixtures/core/uncategorised/45/expected.json +++ b/test/fixtures/core/uncategorised/45/expected.json @@ -1,95 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "set", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "value": { - "type": "Literal", - "value": 43, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "kind": "init" - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], + "type": "File", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, @@ -99,5 +11,140 @@ "line": 1, "column": 15 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "properties": [ + { + "type": "Property", + "start": 6, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "set" + }, + "value": { + "type": "Literal", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 43, + "rawValue": 43, + "raw": "43" + }, + "kind": "init" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/46/expected.json b/test/fixtures/core/uncategorised/46/expected.json index f6801a2335..70440e8cff 100644 --- a/test/fixtures/core/uncategorised/46/expected.json +++ b/test/fixtures/core/uncategorised/46/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -38,5 +11,79 @@ "line": 1, "column": 22 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "Literal", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " block comment ", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/47/expected.json b/test/fixtures/core/uncategorised/47/expected.json index e1e613dbe8..972e9a1f34 100644 --- a/test/fixtures/core/uncategorised/47/expected.json +++ b/test/fixtures/core/uncategorised/47/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 21, "loc": { "start": { "line": 1, @@ -38,5 +11,100 @@ "line": 1, "column": 21 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42", + "leadingComments": null, + "trailingComments": null + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "The", + "start": 3, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 3, + 10 + ] + }, + { + "type": "CommentBlock", + "value": "Answer", + "start": 11, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 11, + 21 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/48/expected.json b/test/fixtures/core/uncategorised/48/expected.json index e1e613dbe8..48a16dd3ba 100644 --- a/test/fixtures/core/uncategorised/48/expected.json +++ b/test/fixtures/core/uncategorised/48/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 21, "loc": { "start": { "line": 1, @@ -38,5 +11,100 @@ "line": 1, "column": 21 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42", + "leadingComments": null, + "trailingComments": null + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "the", + "start": 3, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 3, + 10 + ] + }, + { + "type": "CommentBlock", + "value": "answer", + "start": 11, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 11, + 21 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/49/expected.json b/test/fixtures/core/uncategorised/49/expected.json index ca9afb0826..3571b1a22a 100644 --- a/test/fixtures/core/uncategorised/49/expected.json +++ b/test/fixtures/core/uncategorised/49/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 5, - "column": 11 - }, - "end": { - "line": 5, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 5, - "column": 11 - }, - "end": { - "line": 5, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 44, "loc": { "start": { "line": 1, @@ -38,5 +11,79 @@ "line": 5, "column": 13 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "expression": { + "type": "Literal", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " multiline\ncomment\nshould\nbe\nignored ", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 0, + 41 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/5/expected.json b/test/fixtures/core/uncategorised/5/expected.json index aa77955d92..13360f90cf 100644 --- a/test/fixtures/core/uncategorised/5/expected.json +++ b/test/fixtures/core/uncategorised/5/expected.json @@ -1,14 +1,37 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "regex": { - "pattern": "[a-z]", - "flags": "g" - }, + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, "loc": { "start": { "line": 1, @@ -18,8 +41,30 @@ "line": 1, "column": 8 } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": {}, + "rawValue": {}, + "raw": "/[a-z]/g", + "regex": { + "pattern": "[a-z]", + "flags": "g" + } } } - } - ] -} + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/50/expected.json b/test/fixtures/core/uncategorised/50/expected.json index 49c20f9569..b39cabe82a 100644 --- a/test/fixtures/core/uncategorised/50/expected.json +++ b/test/fixtures/core/uncategorised/50/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 10, "loc": { "start": { "line": 1, @@ -38,5 +11,79 @@ "line": 2, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": "a\nb", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 0, + 7 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/51/expected.json b/test/fixtures/core/uncategorised/51/expected.json index 49c20f9569..5028451839 100644 --- a/test/fixtures/core/uncategorised/51/expected.json +++ b/test/fixtures/core/uncategorised/51/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 10, "loc": { "start": { "line": 1, @@ -38,5 +11,79 @@ "line": 2, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": "a\rb", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 0, + 7 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/52/expected.json b/test/fixtures/core/uncategorised/52/expected.json index 49c20f9569..b39cabe82a 100644 --- a/test/fixtures/core/uncategorised/52/expected.json +++ b/test/fixtures/core/uncategorised/52/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 10, "loc": { "start": { "line": 1, @@ -38,5 +11,79 @@ "line": 2, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": "a\nb", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 0, + 7 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/525/expected.json b/test/fixtures/core/uncategorised/525/expected.json index 92d600816e..9e7caa0016 100644 --- a/test/fixtures/core/uncategorised/525/expected.json +++ b/test/fixtures/core/uncategorised/525/expected.json @@ -1,51 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -55,5 +11,73 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": null + } + ], + "kind": "let" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/526/expected.json b/test/fixtures/core/uncategorised/526/expected.json index 23e1036f30..9e32e59ad2 100644 --- a/test/fixtures/core/uncategorised/526/expected.json +++ b/test/fixtures/core/uncategorised/526/expected.json @@ -1,79 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -83,5 +11,105 @@ "line": 1, "column": 9 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "y" + }, + "init": null + } + ], + "kind": "let" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/527/expected.json b/test/fixtures/core/uncategorised/527/expected.json index ef0172b830..26048dfd5a 100644 --- a/test/fixtures/core/uncategorised/527/expected.json +++ b/test/fixtures/core/uncategorised/527/expected.json @@ -1,64 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], + "type": "File", + "start": 0, + "end": 10, "loc": { "start": { "line": 1, @@ -68,5 +11,90 @@ "line": 1, "column": 10 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "let" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/528/expected.json b/test/fixtures/core/uncategorised/528/expected.json index 0b1e13d7a6..769f0e0bf2 100644 --- a/test/fixtures/core/uncategorised/528/expected.json +++ b/test/fixtures/core/uncategorised/528/expected.json @@ -1,105 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "init": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "arguments", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "init": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], + "type": "File", + "start": 0, + "end": 29, "loc": { "start": { "line": 1, @@ -109,5 +11,139 @@ "line": 1, "column": 29 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "eval" + }, + "init": { + "type": "Literal", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + }, + { + "type": "VariableDeclarator", + "start": 15, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "arguments" + }, + "init": { + "type": "Literal", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "let" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/529/expected.json b/test/fixtures/core/uncategorised/529/expected.json index 89542fd62d..72a0f70422 100644 --- a/test/fixtures/core/uncategorised/529/expected.json +++ b/test/fixtures/core/uncategorised/529/expected.json @@ -1,146 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": { - "type": "Literal", - "value": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "init": { - "type": "Literal", - "value": 3, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "init": { - "type": "Literal", - "value": 1977, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], + "type": "File", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -150,5 +11,188 @@ "line": 1, "column": 27 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": 14, + "rawValue": 14, + "raw": "14" + } + }, + { + "type": "VariableDeclarator", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "y" + }, + "init": { + "type": "Literal", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + }, + { + "type": "VariableDeclarator", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "z" + }, + "init": { + "type": "Literal", + "start": 23, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "value": 1977, + "rawValue": 1977, + "raw": "1977" + } + } + ], + "kind": "let" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/53/expected.json b/test/fixtures/core/uncategorised/53/expected.json index 49c20f9569..87e3d95851 100644 --- a/test/fixtures/core/uncategorised/53/expected.json +++ b/test/fixtures/core/uncategorised/53/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 10, "loc": { "start": { "line": 1, @@ -38,5 +11,79 @@ "line": 2, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": "a\nc", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 0, + 7 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/530/expected.json b/test/fixtures/core/uncategorised/530/expected.json index a4ed4afe19..5f7188a434 100644 --- a/test/fixtures/core/uncategorised/530/expected.json +++ b/test/fixtures/core/uncategorised/530/expected.json @@ -1,92 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForStatement", - "init": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "init": { - "type": "Literal", - "value": 0, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "test": null, - "update": null, - "body": { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -96,5 +11,122 @@ "line": 1, "column": 17 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "let" + }, + "test": null, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/531/expected.json b/test/fixtures/core/uncategorised/531/expected.json index 592295c3a8..e7d044a4ed 100644 --- a/test/fixtures/core/uncategorised/531/expected.json +++ b/test/fixtures/core/uncategorised/531/expected.json @@ -1,133 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForStatement", - "init": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "init": { - "type": "Literal", - "value": 0, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "init": { - "type": "Literal", - "value": 1, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "test": null, - "update": null, - "body": { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], + "type": "File", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, @@ -137,5 +11,171 @@ "line": 1, "column": 24 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 4, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + }, + { + "type": "VariableDeclarator", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "y" + }, + "init": { + "type": "Literal", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "kind": "let" + }, + "test": null, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/532/expected.json b/test/fixtures/core/uncategorised/532/expected.json index 33a700889e..12d30b3dd3 100644 --- a/test/fixtures/core/uncategorised/532/expected.json +++ b/test/fixtures/core/uncategorised/532/expected.json @@ -1,134 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForInStatement", - "left": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "right": { - "type": "Identifier", - "name": "list", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "process", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], + "type": "File", + "start": 0, + "end": 31, "loc": { "start": { "line": 1, @@ -138,5 +11,168 @@ "line": 1, "column": 31 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "x" + }, + "init": null + } + ], + "kind": "let" + }, + "right": { + "type": "Identifier", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "CallExpression", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "callee": { + "type": "Identifier", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "x" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/533/expected.json b/test/fixtures/core/uncategorised/533/expected.json index ea08bc49d3..7a3105b73c 100644 --- a/test/fixtures/core/uncategorised/533/expected.json +++ b/test/fixtures/core/uncategorised/533/expected.json @@ -1,64 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "init": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -68,5 +11,90 @@ "line": 1, "column": 12 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "const" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/534/expected.json b/test/fixtures/core/uncategorised/534/expected.json index 99349067f8..6fe8322ba5 100644 --- a/test/fixtures/core/uncategorised/534/expected.json +++ b/test/fixtures/core/uncategorised/534/expected.json @@ -1,105 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "init": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "arguments", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "init": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], + "type": "File", + "start": 0, + "end": 31, "loc": { "start": { "line": 1, @@ -109,5 +11,139 @@ "line": 1, "column": 31 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "eval" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + }, + { + "type": "VariableDeclarator", + "start": 17, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "arguments" + }, + "init": { + "type": "Literal", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "const" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/535/expected.json b/test/fixtures/core/uncategorised/535/expected.json index b8b28f2765..8a1741ec4b 100644 --- a/test/fixtures/core/uncategorised/535/expected.json +++ b/test/fixtures/core/uncategorised/535/expected.json @@ -1,146 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "init": { - "type": "Literal", - "value": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "init": { - "type": "Literal", - "value": 3, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "init": { - "type": "Literal", - "value": 1977, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], + "type": "File", + "start": 0, + "end": 29, "loc": { "start": { "line": 1, @@ -150,5 +11,188 @@ "line": 1, "column": 29 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "x" + }, + "init": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 14, + "rawValue": 14, + "raw": "14" + } + }, + { + "type": "VariableDeclarator", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "y" + }, + "init": { + "type": "Literal", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + }, + { + "type": "VariableDeclarator", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "z" + }, + "init": { + "type": "Literal", + "start": 25, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": 1977, + "rawValue": 1977, + "raw": "1977" + } + } + ], + "kind": "const" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/537/expected.json b/test/fixtures/core/uncategorised/537/expected.json index 8355722366..bda1dbf787 100644 --- a/test/fixtures/core/uncategorised/537/expected.json +++ b/test/fixtures/core/uncategorised/537/expected.json @@ -1,58 +1,164 @@ { - "type": "Program", - "body": [ - { - "type": "ForStatement", - "init": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "range": [ - 10, - 11 - ] - }, - "init": { - "type": "Literal", - "value": 0, - "range": [ - 14, - 15 - ] - }, - "range": [ - 10, - 15 - ] - } - ], - "kind": "const", - "range": [ - 4, - 15 - ] - }, - "test": null, - "update": null, - "body": { - "type": "EmptyStatement", - "range": [ - 18, - 19 - ] - }, - "range": [ - 0, - 19 - ] + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 } - ], + }, "range": [ 0, 19 - ] + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "sourceType": "script", + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "init": { + "type": "VariableDeclaration", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 4, + 15 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 10, + 15 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "x" + }, + "init": { + "type": "Literal", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ], + "kind": "const" + }, + "test": null, + "update": null, + "body": { + "type": "EmptyStatement", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/538/expected.json b/test/fixtures/core/uncategorised/538/expected.json index 556689a188..d17094a6c6 100644 --- a/test/fixtures/core/uncategorised/538/expected.json +++ b/test/fixtures/core/uncategorised/538/expected.json @@ -1,8 +1,70 @@ { - "type": "Program", - "body": [ - { - "type": "EmptyStatement" + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "EmptyStatement", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ] + } + ] + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/54/expected.json b/test/fixtures/core/uncategorised/54/expected.json index 68eb024bd7..848acc5805 100644 --- a/test/fixtures/core/uncategorised/54/expected.json +++ b/test/fixtures/core/uncategorised/54/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -38,5 +11,79 @@ "line": 2, "column": 2 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "Literal", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " line comment", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/540/expected.json b/test/fixtures/core/uncategorised/540/expected.json index 985d4c5c83..1363375b12 100644 --- a/test/fixtures/core/uncategorised/540/expected.json +++ b/test/fixtures/core/uncategorised/540/expected.json @@ -1,25 +1,118 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [] + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 } }, - "operator": "/", - "right": { - "type": "Literal", - "value": 1 + "expression": { + "type": "BinaryExpression", + "start": 1, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "left": { + "type": "FunctionExpression", + "start": 1, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": [] + } + }, + "operator": "/", + "right": { + "type": "Literal", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + "parenthesizedExpression": true } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/541/expected.json b/test/fixtures/core/uncategorised/541/expected.json index 02ce1f0826..77d7d954ac 100644 --- a/test/fixtures/core/uncategorised/541/expected.json +++ b/test/fixtures/core/uncategorised/541/expected.json @@ -1,27 +1,120 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "f" + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [] + "end": { + "line": 1, + "column": 21 } }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "regex": { - "pattern": " 1 ", - "flags": "" + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "f" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": [] + } + }, + { + "type": "ExpressionStatement", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "Literal", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": {}, + "rawValue": {}, + "raw": "/ 1 /", + "regex": { + "pattern": " 1 ", + "flags": "" + } } } - } - ] -} + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/55/expected.json b/test/fixtures/core/uncategorised/55/expected.json index 99267d0aed..5694227afb 100644 --- a/test/fixtures/core/uncategorised/55/expected.json +++ b/test/fixtures/core/uncategorised/55/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -38,5 +11,80 @@ "line": 1, "column": 18 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42", + "leadingComments": null, + "trailingComments": null + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " line comment", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 3, + 18 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/56/expected.json b/test/fixtures/core/uncategorised/56/expected.json index 68eb024bd7..df154b7af9 100644 --- a/test/fixtures/core/uncategorised/56/expected.json +++ b/test/fixtures/core/uncategorised/56/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 19, "loc": { "start": { "line": 1, @@ -38,5 +11,79 @@ "line": 2, "column": 2 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "Literal", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Hello, world!", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/57/expected.json b/test/fixtures/core/uncategorised/57/expected.json index ff77cf347d..0966e60e5c 100644 --- a/test/fixtures/core/uncategorised/57/expected.json +++ b/test/fixtures/core/uncategorised/57/expected.json @@ -1,5 +1,5 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 16, "loc": { @@ -12,29 +12,44 @@ "column": 16 } }, - "sourceType": "script", - "body": [], - "leadingComments": null, - "innerComments": [ - { - "type": "CommentLine", - "value": " Hello, world!", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "range": [ - 0, - 16 - ] - } - ] + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [], + "leadingComments": null, + "innerComments": [ + { + "type": "CommentLine", + "value": " Hello, world!", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ] + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/58/expected.json b/test/fixtures/core/uncategorised/58/expected.json index aa01b36347..fe87c3c143 100644 --- a/test/fixtures/core/uncategorised/58/expected.json +++ b/test/fixtures/core/uncategorised/58/expected.json @@ -1,5 +1,5 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 16, "loc": { @@ -12,29 +12,44 @@ "column": 16 } }, - "sourceType": "script", - "body": [], - "leadingComments": null, - "innerComments": [ - { - "type": "CommentLine", - "value": " Hallo, world!", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "range": [ - 0, - 16 - ] - } - ] + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [], + "leadingComments": null, + "innerComments": [ + { + "type": "CommentLine", + "value": " Hallo, world!", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ] + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/59/expected.json b/test/fixtures/core/uncategorised/59/expected.json index 68eb024bd7..70cab4ee43 100644 --- a/test/fixtures/core/uncategorised/59/expected.json +++ b/test/fixtures/core/uncategorised/59/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -38,5 +11,79 @@ "line": 2, "column": 2 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 3, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "Literal", + "start": 3, + "end": 5, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": "", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 0, + 2 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/6/expected.json b/test/fixtures/core/uncategorised/6/expected.json index e7c31834ec..22d4ac246e 100644 --- a/test/fixtures/core/uncategorised/6/expected.json +++ b/test/fixtures/core/uncategorised/6/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Literal", - "value": 1, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "operator": "+", - "right": { - "type": "Literal", - "value": 2, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "operator": "*", - "right": { - "type": "Literal", - "value": 3, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -94,5 +11,125 @@ "line": 1, "column": 12 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "left": { + "type": "BinaryExpression", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Literal", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + "operator": "+", + "right": { + "type": "Literal", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + }, + "parenthesizedExpression": true + }, + "operator": "*", + "right": { + "type": "Literal", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/60/expected.json b/test/fixtures/core/uncategorised/60/expected.json index 661b0ae985..665ffa4700 100644 --- a/test/fixtures/core/uncategorised/60/expected.json +++ b/test/fixtures/core/uncategorised/60/expected.json @@ -1,6 +1,7 @@ { - "type": "Program", - "body": [], + "type": "File", + "start": 0, + "end": 2, "loc": { "start": { "line": 1, @@ -10,5 +11,45 @@ "line": 1, "column": 2 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [], + "leadingComments": null, + "innerComments": [ + { + "type": "CommentLine", + "value": "", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 0, + 2 + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/61/expected.json b/test/fixtures/core/uncategorised/61/expected.json index 58b20484dc..665ffa4700 100644 --- a/test/fixtures/core/uncategorised/61/expected.json +++ b/test/fixtures/core/uncategorised/61/expected.json @@ -1,5 +1,5 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 2, "loc": { @@ -12,29 +12,44 @@ "column": 2 } }, - "sourceType": "script", - "body": [], - "leadingComments": null, - "innerComments": [ - { - "type": "CommentLine", - "value": "", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "range": [ - 0, - 2 - ] - } - ] + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [], + "leadingComments": null, + "innerComments": [ + { + "type": "CommentLine", + "value": "", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 0, + 2 + ] + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/62/expected.json b/test/fixtures/core/uncategorised/62/expected.json index ce35fb0e4f..b8e255f5e1 100644 --- a/test/fixtures/core/uncategorised/62/expected.json +++ b/test/fixtures/core/uncategorised/62/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -38,5 +11,79 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "Literal", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": "", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/63/expected.json b/test/fixtures/core/uncategorised/63/expected.json index ab9aee454e..b28ab11a53 100644 --- a/test/fixtures/core/uncategorised/63/expected.json +++ b/test/fixtures/core/uncategorised/63/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 39, "loc": { "start": { "line": 1, @@ -38,5 +11,99 @@ "line": 4, "column": 2 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 2 + } + }, + "expression": { + "type": "Literal", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 2 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Hello, world!", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ] + }, + { + "type": "CommentLine", + "value": " Another hello", + "start": 18, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "range": [ + 18, + 36 + ] + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/64/expected.json b/test/fixtures/core/uncategorised/64/expected.json index 90ba14f905..4b8b974f5f 100644 --- a/test/fixtures/core/uncategorised/64/expected.json +++ b/test/fixtures/core/uncategorised/64/expected.json @@ -1,91 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "IfStatement", - "test": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "consequent": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "doThat", - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 2, - "column": 11 - } - } - }, - "alternate": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, @@ -95,5 +11,143 @@ "line": 2, "column": 11 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "test": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + }, + "consequent": { + "type": "BlockStatement", + "start": 7, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 25, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "expression": { + "type": "CallExpression", + "start": 25, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "callee": { + "type": "Identifier", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "name": "doThat", + "leadingComments": null + }, + "arguments": [], + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Some comment", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 9, + 24 + ] + } + ] + } + ] + }, + "alternate": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/65/expected.json b/test/fixtures/core/uncategorised/65/expected.json index c6608b6725..2ca6132248 100644 --- a/test/fixtures/core/uncategorised/65/expected.json +++ b/test/fixtures/core/uncategorised/65/expected.json @@ -1,106 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "SwitchStatement", - "discriminant": { - "type": "Identifier", - "name": "answer", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "cases": [ - { - "type": "SwitchCase", - "consequent": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "bingo", - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 46 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 48 - } - } - } - ], - "test": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 48 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - } - } - ], + "type": "File", + "start": 0, + "end": 50, "loc": { "start": { "line": 1, @@ -110,5 +11,162 @@ "line": 1, "column": 50 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "sourceType": "script", + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "discriminant": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "answer" + }, + "cases": [ + { + "type": "SwitchCase", + "start": 18, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "consequent": [ + { + "type": "ExpressionStatement", + "start": 41, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "expression": { + "type": "CallExpression", + "start": 41, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "callee": { + "type": "Identifier", + "start": 41, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "name": "bingo", + "leadingComments": null + }, + "arguments": [], + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " perfect ", + "start": 27, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 27, + 40 + ] + } + ] + } + ], + "test": { + "type": "Literal", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/66/expected.json b/test/fixtures/core/uncategorised/66/expected.json index 0ec6363607..3c10744dbc 100644 --- a/test/fixtures/core/uncategorised/66/expected.json +++ b/test/fixtures/core/uncategorised/66/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 0, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], + "type": "File", + "start": 0, + "end": 1, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 1 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/67/expected.json b/test/fixtures/core/uncategorised/67/expected.json index 539f5b2e2f..b5ce31672a 100644 --- a/test/fixtures/core/uncategorised/67/expected.json +++ b/test/fixtures/core/uncategorised/67/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], + "type": "File", + "start": 0, + "end": 1, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 1 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/68/expected.json b/test/fixtures/core/uncategorised/68/expected.json index 2d4395f267..8197c99729 100644 --- a/test/fixtures/core/uncategorised/68/expected.json +++ b/test/fixtures/core/uncategorised/68/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], + "type": "File", + "start": 0, + "end": 1, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 1 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "value": 5, + "rawValue": 5, + "raw": "5" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/69/expected.json b/test/fixtures/core/uncategorised/69/expected.json index cfb04c2f5b..c9032e42b5 100644 --- a/test/fixtures/core/uncategorised/69/expected.json +++ b/test/fixtures/core/uncategorised/69/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 2, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 2 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/7/expected.json b/test/fixtures/core/uncategorised/7/expected.json index 6cbc0f3cc7..eecbadfa66 100644 --- a/test/fixtures/core/uncategorised/7/expected.json +++ b/test/fixtures/core/uncategorised/7/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ArrayExpression", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/70/expected.json b/test/fixtures/core/uncategorised/70/expected.json index 152c130d2a..16bb765432 100644 --- a/test/fixtures/core/uncategorised/70/expected.json +++ b/test/fixtures/core/uncategorised/70/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 0.14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 3 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": 0.14, + "rawValue": 0.14, + "raw": ".14" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/71/expected.json b/test/fixtures/core/uncategorised/71/expected.json index f8e93759a2..77caa9f92d 100644 --- a/test/fixtures/core/uncategorised/71/expected.json +++ b/test/fixtures/core/uncategorised/71/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 3.14159, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 3.14159, + "rawValue": 3.14159, + "raw": "3.14159" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/72/expected.json b/test/fixtures/core/uncategorised/72/expected.json index 0a7f0dff3d..0e80f889c4 100644 --- a/test/fixtures/core/uncategorised/72/expected.json +++ b/test/fixtures/core/uncategorised/72/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 6.02214179e+23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 14 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 6.02214179e+23, + "rawValue": 6.02214179e+23, + "raw": "6.02214179e+23" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/73/expected.json b/test/fixtures/core/uncategorised/73/expected.json index a3c1f70a50..a4929925aa 100644 --- a/test/fixtures/core/uncategorised/73/expected.json +++ b/test/fixtures/core/uncategorised/73/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 1.49241783e-10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], + "type": "File", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 15 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": 1.49241783e-10, + "rawValue": 1.49241783e-10, + "raw": "1.492417830e-10" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/74/expected.json b/test/fixtures/core/uncategorised/74/expected.json index f0c7133039..80d8d72652 100644 --- a/test/fixtures/core/uncategorised/74/expected.json +++ b/test/fixtures/core/uncategorised/74/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 0, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 3 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0x0" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/75/expected.json b/test/fixtures/core/uncategorised/75/expected.json index 15d6a111ca..9fbcefb6e6 100644 --- a/test/fixtures/core/uncategorised/75/expected.json +++ b/test/fixtures/core/uncategorised/75/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 0, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0e+100" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/76/expected.json b/test/fixtures/core/uncategorised/76/expected.json index 2389e725dd..76c1f1c523 100644 --- a/test/fixtures/core/uncategorised/76/expected.json +++ b/test/fixtures/core/uncategorised/76/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 2748, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": 2748, + "rawValue": 2748, + "raw": "0xabc" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/77/expected.json b/test/fixtures/core/uncategorised/77/expected.json index 6a747e9309..0039bb62d0 100644 --- a/test/fixtures/core/uncategorised/77/expected.json +++ b/test/fixtures/core/uncategorised/77/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 3567, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": 3567, + "rawValue": 3567, + "raw": "0xdef" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/78/expected.json b/test/fixtures/core/uncategorised/78/expected.json index f77fbd100a..34f104d94a 100644 --- a/test/fixtures/core/uncategorised/78/expected.json +++ b/test/fixtures/core/uncategorised/78/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], + "type": "File", + "start": 0, + "end": 4, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 4 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": 26, + "rawValue": 26, + "raw": "0X1A" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/79/expected.json b/test/fixtures/core/uncategorised/79/expected.json index a78b7fde6a..60fe7b9e32 100644 --- a/test/fixtures/core/uncategorised/79/expected.json +++ b/test/fixtures/core/uncategorised/79/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], + "type": "File", + "start": 0, + "end": 4, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 4 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": 16, + "rawValue": 16, + "raw": "0x10" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/8/expected.json b/test/fixtures/core/uncategorised/8/expected.json index f1db0515bd..afd3885785 100644 --- a/test/fixtures/core/uncategorised/8/expected.json +++ b/test/fixtures/core/uncategorised/8/expected.json @@ -1,62 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -66,5 +11,86 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ArrayExpression", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/80/expected.json b/test/fixtures/core/uncategorised/80/expected.json index 24cb9c50f8..656eba441e 100644 --- a/test/fixtures/core/uncategorised/80/expected.json +++ b/test/fixtures/core/uncategorised/80/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 256, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 5 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": 256, + "rawValue": 256, + "raw": "0x100" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/81/expected.json b/test/fixtures/core/uncategorised/81/expected.json index cf787637d8..0f25cbbe5a 100644 --- a/test/fixtures/core/uncategorised/81/expected.json +++ b/test/fixtures/core/uncategorised/81/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], + "type": "File", + "start": 0, + "end": 4, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 4 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": 4, + "rawValue": 4, + "raw": "0X04" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/82/expected.json b/test/fixtures/core/uncategorised/82/expected.json index 8d7a237d27..a3d0753826 100644 --- a/test/fixtures/core/uncategorised/82/expected.json +++ b/test/fixtures/core/uncategorised/82/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 2, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 2 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "value": 2, + "rawValue": 2, + "raw": "02" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/83/expected.json b/test/fixtures/core/uncategorised/83/expected.json index fb7c4b32d6..775be2d87f 100644 --- a/test/fixtures/core/uncategorised/83/expected.json +++ b/test/fixtures/core/uncategorised/83/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 3 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": 10, + "rawValue": 10, + "raw": "012" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/84/expected.json b/test/fixtures/core/uncategorised/84/expected.json index bfe70a9a84..3d5cb353e0 100644 --- a/test/fixtures/core/uncategorised/84/expected.json +++ b/test/fixtures/core/uncategorised/84/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], + "type": "File", + "start": 0, + "end": 4, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 4 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": 10, + "rawValue": 10, + "raw": "0012" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/85/expected.json b/test/fixtures/core/uncategorised/85/expected.json index fbad26b7ad..8404808409 100644 --- a/test/fixtures/core/uncategorised/85/expected.json +++ b/test/fixtures/core/uncategorised/85/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "Hello", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 7 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": "Hello", + "rawValue": "Hello", + "raw": "\"Hello\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/86/expected.json b/test/fixtures/core/uncategorised/86/expected.json index c82999a04e..dcc47b071b 100644 --- a/test/fixtures/core/uncategorised/86/expected.json +++ b/test/fixtures/core/uncategorised/86/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "\n\r\t\u000b\b\f\\'\"\u0000", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 22 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": "\n\r\t\u000b\b\f\\'\"\u0000", + "rawValue": "\n\r\t\u000b\b\f\\'\"\u0000", + "raw": "\"\\n\\r\\t\\v\\b\\f\\\\\\'\\\"\\0\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/87/expected.json b/test/fixtures/core/uncategorised/87/expected.json index bf97fe120c..6fe6d8067b 100644 --- a/test/fixtures/core/uncategorised/87/expected.json +++ b/test/fixtures/core/uncategorised/87/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "a", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 8, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 8 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": "a", + "rawValue": "a", + "raw": "\"\\u0061\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/88/expected.json b/test/fixtures/core/uncategorised/88/expected.json index 1c5b234e54..6dd6810aa8 100644 --- a/test/fixtures/core/uncategorised/88/expected.json +++ b/test/fixtures/core/uncategorised/88/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "a", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 6, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": "a", + "rawValue": "a", + "raw": "\"\\x61\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/89/expected.json b/test/fixtures/core/uncategorised/89/expected.json index c2203aeeb9..9cfa9faad2 100644 --- a/test/fixtures/core/uncategorised/89/expected.json +++ b/test/fixtures/core/uncategorised/89/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "Hello\nworld", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 14 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": "Hello\nworld", + "rawValue": "Hello\nworld", + "raw": "\"Hello\\nworld\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/9/expected.json b/test/fixtures/core/uncategorised/9/expected.json index fdfaff1611..6cae01b125 100644 --- a/test/fixtures/core/uncategorised/9/expected.json +++ b/test/fixtures/core/uncategorised/9/expected.json @@ -1,77 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [ - { - "type": "Literal", - "value": 42, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], + "type": "File", + "start": 0, + "end": 10, "loc": { "start": { "line": 1, @@ -81,5 +11,105 @@ "line": 1, "column": 10 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "x" + }, + "right": { + "type": "ArrayExpression", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "Literal", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": 42, + "rawValue": 42, + "raw": "42" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/90/expected.json b/test/fixtures/core/uncategorised/90/expected.json index d90f337fd7..aaafd737c7 100644 --- a/test/fixtures/core/uncategorised/90/expected.json +++ b/test/fixtures/core/uncategorised/90/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "Helloworld", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 2, "column": 6 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "value": "Helloworld", + "rawValue": "Helloworld", + "raw": "\"Hello\\\nworld\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/91/expected.json b/test/fixtures/core/uncategorised/91/expected.json index 4a22aaed86..2e79d5b096 100644 --- a/test/fixtures/core/uncategorised/91/expected.json +++ b/test/fixtures/core/uncategorised/91/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "Hello\u0002World", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], + "type": "File", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 15 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": "Hello\u0002World", + "rawValue": "Hello\u0002World", + "raw": "\"Hello\\02World\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/92/expected.json b/test/fixtures/core/uncategorised/92/expected.json index 7690a67eb3..d25c9ba139 100644 --- a/test/fixtures/core/uncategorised/92/expected.json +++ b/test/fixtures/core/uncategorised/92/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "Hello\nWorld", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 16 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": "Hello\nWorld", + "rawValue": "Hello\nWorld", + "raw": "\"Hello\\012World\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/93/expected.json b/test/fixtures/core/uncategorised/93/expected.json index 0fdd2da809..806ba7acba 100644 --- a/test/fixtures/core/uncategorised/93/expected.json +++ b/test/fixtures/core/uncategorised/93/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "HelloRWorld", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 16 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": "HelloRWorld", + "rawValue": "HelloRWorld", + "raw": "\"Hello\\122World\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/94/expected.json b/test/fixtures/core/uncategorised/94/expected.json index 7462b5ab33..5b15026354 100644 --- a/test/fixtures/core/uncategorised/94/expected.json +++ b/test/fixtures/core/uncategorised/94/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "Hello\n2World", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 17 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": "Hello\n2World", + "rawValue": "Hello\n2World", + "raw": "\"Hello\\0122World\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/95/expected.json b/test/fixtures/core/uncategorised/95/expected.json index f50936246f..e624d06929 100644 --- a/test/fixtures/core/uncategorised/95/expected.json +++ b/test/fixtures/core/uncategorised/95/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "HelloÊWorld", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 16 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": "HelloÊWorld", + "rawValue": "HelloÊWorld", + "raw": "\"Hello\\312World\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/96/expected.json b/test/fixtures/core/uncategorised/96/expected.json index 62bffd2d4f..bd2f1ea9ac 100644 --- a/test/fixtures/core/uncategorised/96/expected.json +++ b/test/fixtures/core/uncategorised/96/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "Hello!2World", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 16 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": "Hello!2World", + "rawValue": "Hello!2World", + "raw": "\"Hello\\412World\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/97/expected.json b/test/fixtures/core/uncategorised/97/expected.json index 18fbc83491..4ae045ff0c 100644 --- a/test/fixtures/core/uncategorised/97/expected.json +++ b/test/fixtures/core/uncategorised/97/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "Hello812World", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 16 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": "Hello812World", + "rawValue": "Hello812World", + "raw": "\"Hello\\812World\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/98/expected.json b/test/fixtures/core/uncategorised/98/expected.json index 6793b7fb82..9774cae16c 100644 --- a/test/fixtures/core/uncategorised/98/expected.json +++ b/test/fixtures/core/uncategorised/98/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "Hello92World", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 16 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": "Hello92World", + "rawValue": "Hello92World", + "raw": "\"Hello\\712World\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/99/expected.json b/test/fixtures/core/uncategorised/99/expected.json index 5b8141b749..09dd15f3b3 100644 --- a/test/fixtures/core/uncategorised/99/expected.json +++ b/test/fixtures/core/uncategorised/99/expected.json @@ -1,34 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "Hello\u0000World", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -38,5 +11,56 @@ "line": 1, "column": 14 } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": "Hello\u0000World", + "rawValue": "Hello\u0000World", + "raw": "\"Hello\\0World\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/10/expected.json b/test/fixtures/experimental/uncategorised/10/expected.json index 583a962d0d..306cf66aef 100644 --- a/test/fixtures/experimental/uncategorised/10/expected.json +++ b/test/fixtures/experimental/uncategorised/10/expected.json @@ -1,65 +1,181 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 17, - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 17, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 17, - "id": { - "type": "ObjectPattern", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", "start": 4, - "end": 13, - "properties": [ - { - "type": "Property", - "start": 5, - "end": 6, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 5, - "end": 6, - "name": "x" + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 }, - "kind": "init", - "value": { - "type": "Identifier", - "start": 5, - "end": 6, - "name": "x" + "end": { + "line": 1, + "column": 13 } }, - { - "type": "SpreadProperty", - "start": 8, - "end": 12, - "argument": { - "type": "Identifier", - "start": 11, + "properties": [ + { + "type": "Property", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" + } + }, + { + "type": "SpreadProperty", + "start": 8, "end": 12, - "name": "y" + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "argument": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "y" + } } - } - ] - }, - "init": { - "type": "Identifier", - "start": 16, - "end": 17, - "name": "z" + ] + }, + "init": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "z" + } } - } - ], - "kind": "let" - } - ] + ], + "kind": "let" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/11/expected.json b/test/fixtures/experimental/uncategorised/11/expected.json index 18636849a6..4507ca2447 100644 --- a/test/fixtures/experimental/uncategorised/11/expected.json +++ b/test/fixtures/experimental/uncategorised/11/expected.json @@ -1,67 +1,184 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 25, - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 25, - "expression": { - "type": "FunctionExpression", - "start": 1, - "end": 24, - "id": null, - "params": [ - { - "type": "ObjectPattern", - "start": 10, - "end": 19, - "properties": [ - { - "type": "Property", - "start": 11, - "end": 12, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 11, - "end": 12, - "name": "x" + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 10 }, - "kind": "init", - "value": { - "type": "Identifier", - "start": 11, - "end": 12, - "name": "x" + "end": { + "line": 1, + "column": 19 } }, - { - "type": "SpreadProperty", - "start": 14, - "end": 18, - "argument": { - "type": "Identifier", - "start": 17, + "properties": [ + { + "type": "Property", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" + } + }, + { + "type": "SpreadProperty", + "start": 14, "end": 18, - "name": "y" + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "argument": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "y" + } } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 } - ] - } - ], - "generator": false, - "body": { - "type": "BlockStatement", - "start": 21, - "end": 24, - "body": [] - }, - "expression": false + }, + "body": [] + }, + "parenthesizedExpression": true + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/12/expected.json b/test/fixtures/experimental/uncategorised/12/expected.json index bdfef03d9a..0a777c2a2f 100644 --- a/test/fixtures/experimental/uncategorised/12/expected.json +++ b/test/fixtures/experimental/uncategorised/12/expected.json @@ -1,44 +1,130 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 14, - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 14, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 14, - "id": { - "type": "Identifier", - "start": 4, - "end": 5, - "name": "z" - }, - "init": { - "type": "ObjectExpression", - "start": 8, - "end": 14, - "properties": [ - { - "type": "SpreadProperty", - "start": 9, - "end": 13, - "argument": { - "type": "Identifier", - "start": 12, - "end": 13, - "name": "x" - } - } - ] - } - } - ], - "kind": "let" + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "z" + }, + "init": { + "type": "ObjectExpression", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "properties": [ + { + "type": "SpreadProperty", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "argument": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "x" + } + } + ] + } + } + ], + "kind": "let" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/13/expected.json b/test/fixtures/experimental/uncategorised/13/expected.json index 6096836451..bbf2490867 100644 --- a/test/fixtures/experimental/uncategorised/13/expected.json +++ b/test/fixtures/experimental/uncategorised/13/expected.json @@ -1,63 +1,179 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 13, - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 13, - "expression": { - "type": "AssignmentExpression", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", "start": 0, "end": 13, - "operator": "=", - "left": { - "type": "Identifier", - "start": 0, - "end": 1, - "name": "z" + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } }, - "right": { - "type": "ObjectExpression", - "start": 4, + "expression": { + "type": "AssignmentExpression", + "start": 0, "end": 13, - "properties": [ - { - "type": "Property", - "start": 5, - "end": 6, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 5, - "end": 6, - "name": "x" + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "kind": "init", - "value": { - "type": "Identifier", - "start": 5, - "end": 6, - "name": "x" + "end": { + "line": 1, + "column": 1 } }, - { - "type": "SpreadProperty", - "start": 8, - "end": 12, - "argument": { - "type": "Identifier", - "start": 11, - "end": 12, - "name": "y" + "name": "z" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 } - } - ] + }, + "properties": [ + { + "type": "Property", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" + } + }, + { + "type": "SpreadProperty", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "argument": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "y" + } + } + ] + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/14/expected.json b/test/fixtures/experimental/uncategorised/14/expected.json index 30e47db5c8..1002fb1e60 100644 --- a/test/fixtures/experimental/uncategorised/14/expected.json +++ b/test/fixtures/experimental/uncategorised/14/expected.json @@ -1,104 +1,281 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 23, - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 23, - "expression": { - "type": "ObjectExpression", - "start": 1, - "end": 22, - "properties": [ - { - "type": "Property", - "start": 2, - "end": 3, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 2, - "end": 3, - "name": "x" - }, - "kind": "init", - "value": { - "type": "Identifier", - "start": 2, - "end": 3, - "name": "x" - } - }, - { - "type": "SpreadProperty", - "start": 5, - "end": 9, - "argument": { - "type": "Identifier", - "start": 8, - "end": 9, - "name": "y" - } - }, - { - "type": "Property", - "start": 11, - "end": 12, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 11, - "end": 12, - "name": "a" - }, - "kind": "init", - "value": { - "type": "Identifier", - "start": 11, - "end": 12, - "name": "a" - } - }, - { - "type": "SpreadProperty", - "start": 14, - "end": 18, - "argument": { - "type": "Identifier", - "start": 17, - "end": 18, - "name": "b" - } - }, - { - "type": "Property", - "start": 20, - "end": 21, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 20, - "end": 21, - "name": "c" - }, - "kind": "init", - "value": { - "type": "Identifier", - "start": 20, - "end": 21, - "name": "c" - } - } - ] - } + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [ + { + "type": "Property", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "x" + } + }, + { + "type": "SpreadProperty", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "argument": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "y" + } + }, + { + "type": "Property", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "a" + } + }, + { + "type": "SpreadProperty", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "argument": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "b" + } + }, + { + "type": "Property", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "c" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "c" + } + } + ], + "parenthesizedExpression": true + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/17/expected.json b/test/fixtures/experimental/uncategorised/17/expected.json index da40e7705b..4a9da1d79e 100644 --- a/test/fixtures/experimental/uncategorised/17/expected.json +++ b/test/fixtures/experimental/uncategorised/17/expected.json @@ -1,11 +1,37 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "async", + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -15,63 +41,75 @@ "line": 1, "column": 5 } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 5 - } - } - }, - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 2, - "column": 9 + "expression": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } }, - "end": { - "line": 2, - "column": 12 - } + "name": "async" } }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], + { + "type": "FunctionDeclaration", + "start": 6, + "end": 23, "loc": { "start": { "line": 2, - "column": 15 + "column": 0 }, "end": { "line": 2, "column": 17 } - } - }, - "generator": false, - "expression": false, - "async": false, - "loc": { - "start": { - "line": 2, - "column": 0 }, - "end": { - "line": 2, - "column": 17 + "id": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/18/expected.json b/test/fixtures/experimental/uncategorised/18/expected.json index b28e4860ef..556ab1b1c3 100644 --- a/test/fixtures/experimental/uncategorised/18/expected.json +++ b/test/fixtures/experimental/uncategorised/18/expected.json @@ -1,59 +1,103 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", + "type": "File", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, "loc": { "start": { "line": 1, - "column": 15 + "column": 0 }, "end": { "line": 1, - "column": 18 + "column": 46 } - } - }, - "params": [ - { + }, + "id": { "type": "Identifier", - "name": "promise", + "start": 15, + "end": 18, "loc": { "start": { "line": 1, - "column": 19 + "column": 15 }, "end": { "line": 1, - "column": 26 + "column": 18 } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ + }, + "name": "foo" + }, + "generator": false, + "expression": false, + "async": true, + "params": [ { - "type": "ExpressionStatement", - "expression": { - "type": "AwaitExpression", - "argument": { - "type": "Identifier", - "name": "promise", - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 43 - } - } + "type": "Identifier", + "start": 19, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 19 }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "promise" + } + ], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 30, + "end": 44, "loc": { "start": { "line": 1, @@ -61,46 +105,45 @@ }, "end": { "line": 1, - "column": 43 + "column": 44 + } + }, + "expression": { + "type": "AwaitExpression", + "start": 30, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "all": false, + "argument": { + "type": "Identifier", + "start": 36, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "name": "promise" } } - }, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 44 - } } - } - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 46 - } - } - }, - "generator": false, - "expression": false, - "async": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 46 + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/19/expected.json b/test/fixtures/experimental/uncategorised/19/expected.json index 6ac87de8b4..954665acdb 100644 --- a/test/fixtures/experimental/uncategorised/19/expected.json +++ b/test/fixtures/experimental/uncategorised/19/expected.json @@ -1,68 +1,151 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "x", + "type": "File", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "x" + } + ], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 51, "loc": { "start": { "line": 1, - "column": 10 + "column": 13 }, "end": { "line": 1, - "column": 11 + "column": 51 } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "inner", + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 15, + "end": 49, "loc": { "start": { "line": 1, - "column": 30 + "column": 15 }, "end": { "line": 1, - "column": 35 + "column": 49 } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AwaitExpression", - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 47 - } - } - }, + }, + "id": { + "type": "Identifier", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "inner" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 40, + "end": 47, "loc": { "start": { "line": 1, @@ -72,80 +155,48 @@ "line": 1, "column": 47 } - } - }, - "loc": { - "start": { - "line": 1, - "column": 40 }, - "end": { - "line": 1, - "column": 47 + "expression": { + "type": "AwaitExpression", + "start": 40, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "all": false, + "argument": { + "type": "Identifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "name": "x" + } } } - } - ], - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, - "generator": false, - "expression": false, - "async": true, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 49 + ] } } - } - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 51 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 1 + ] }, - "end": { - "line": 1, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 + "parenthesizedExpression": true } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/20/expected.json b/test/fixtures/experimental/uncategorised/20/expected.json index 49b58c5f84..4a03ca9df0 100644 --- a/test/fixtures/experimental/uncategorised/20/expected.json +++ b/test/fixtures/experimental/uncategorised/20/expected.json @@ -1,14 +1,52 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "foo", + "type": "File", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 52, "loc": { "start": { "line": 1, @@ -16,50 +54,80 @@ }, "end": { "line": 1, - "column": 7 + "column": 52 } - } - }, - "init": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "promise", + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "foo" + }, + "init": { + "type": "FunctionExpression", + "start": 10, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 25, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": "promise" + } + ], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 52, "loc": { "start": { "line": 1, - "column": 25 + "column": 34 }, "end": { "line": 1, - "column": 32 + "column": 52 } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AwaitExpression", - "argument": { - "type": "Identifier", - "name": "promise", - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 36, + "end": 50, "loc": { "start": { "line": 1, @@ -67,70 +135,49 @@ }, "end": { "line": 1, - "column": 49 + "column": 50 + } + }, + "expression": { + "type": "AwaitExpression", + "start": 36, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "all": false, + "argument": { + "type": "Identifier", + "start": 42, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "name": "promise" } } - }, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 50 - } } - } - ], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 52 - } + ] } - }, - "generator": false, - "expression": false, - "async": true, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 52 } } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/21/expected.json b/test/fixtures/experimental/uncategorised/21/expected.json index b4de573aea..21fcf81f56 100644 --- a/test/fixtures/experimental/uncategorised/21/expected.json +++ b/test/fixtures/experimental/uncategorised/21/expected.json @@ -1,14 +1,52 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "o", + "type": "File", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 54, "loc": { "start": { "line": 1, @@ -16,114 +54,182 @@ }, "end": { "line": 1, - "column": 5 + "column": 54 } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "o" + }, + "init": { + "type": "ObjectExpression", + "start": 8, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "properties": [ + { + "type": "Property", + "start": 10, + "end": 14, "loc": { "start": { "line": 1, "column": 10 }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "value": { - "type": "Literal", - "value": 1, - "loc": { - "start": { - "line": 1, - "column": 13 - }, "end": { "line": 1, "column": 14 } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 10 }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "foo", + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "a" + }, + "value": { + "type": "Literal", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 16, + "end": 52, "loc": { "start": { "line": 1, - "column": 22 + "column": 16 }, "end": { "line": 1, - "column": 25 + "column": 52 } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "promise", + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "foo" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 25, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 26, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "name": "promise" + } + ], + "body": { + "type": "BlockStatement", + "start": 35, + "end": 52, "loc": { "start": { "line": 1, - "column": 26 + "column": 35 }, "end": { "line": 1, - "column": 33 + "column": 52 } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AwaitExpression", - "argument": { - "type": "Identifier", - "name": "promise", - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 37, + "end": 50, "loc": { "start": { "line": 1, @@ -133,95 +239,50 @@ "line": 1, "column": 50 } - } - }, - "loc": { - "start": { - "line": 1, - "column": 37 }, - "end": { - "line": 1, - "column": 50 + "expression": { + "type": "AwaitExpression", + "start": 37, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "all": false, + "argument": { + "type": "Identifier", + "start": 43, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "name": "promise" + } } } - } - ], - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 52 - } + ] } - }, - "generator": false, - "expression": false, - "async": true, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 52 - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 52 } } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 54 + ] } } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/22/expected.json b/test/fixtures/experimental/uncategorised/22/expected.json index c439d854f7..3f2e2fe5b0 100644 --- a/test/fixtures/experimental/uncategorised/22/expected.json +++ b/test/fixtures/experimental/uncategorised/22/expected.json @@ -1,82 +1,167 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 50, "loc": { "start": { "line": 1, - "column": 6 + "column": 0 }, "end": { "line": 1, - "column": 9 + "column": 50 } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 12, + "end": 48, "loc": { "start": { "line": 1, - "column": 18 + "column": 12 }, "end": { "line": 1, - "column": 21 + "column": 48 } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "promise", + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "bar" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 21, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "promise" + } + ], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 48, "loc": { "start": { "line": 1, - "column": 22 + "column": 31 }, "end": { "line": 1, - "column": 29 + "column": 48 } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AwaitExpression", - "argument": { - "type": "Identifier", - "name": "promise", - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 46 - } - } - }, + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 33, + "end": 46, "loc": { "start": { "line": 1, @@ -86,80 +171,47 @@ "line": 1, "column": 46 } - } - }, - "loc": { - "start": { - "line": 1, - "column": 33 }, - "end": { - "line": 1, - "column": 46 + "expression": { + "type": "AwaitExpression", + "start": 33, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "all": false, + "argument": { + "type": "Identifier", + "start": 39, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "name": "promise" + } } } - } - ], - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 48 - } + ] } - }, - "generator": false, - "expression": false, - "async": true, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 48 - } - } - }, - "kind": "method", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 48 } } - } - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/23/expected.json b/test/fixtures/experimental/uncategorised/23/expected.json index 5b7c9b1193..605c1f789f 100644 --- a/test/fixtures/experimental/uncategorised/23/expected.json +++ b/test/fixtures/experimental/uncategorised/23/expected.json @@ -1,100 +1,37 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "promise", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "body": { - "type": "AwaitExpression", - "argument": { - "type": "Identifier", - "name": "promise", - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "generator": false, - "expression": true, - "async": true, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, @@ -104,18 +41,126 @@ "line": 1, "column": 36 } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 36 + "expression": { + "type": "CallExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "f" + }, + "arguments": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "a" + }, + { + "type": "ArrowFunctionExpression", + "start": 5, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "promise" + } + ], + "body": { + "type": "AwaitExpression", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "all": false, + "argument": { + "type": "Identifier", + "start": 28, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "promise" + } + } + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/24/expected.json b/test/fixtures/experimental/uncategorised/24/expected.json index c271c7f56c..a4559ce87a 100644 --- a/test/fixtures/experimental/uncategorised/24/expected.json +++ b/test/fixtures/experimental/uncategorised/24/expected.json @@ -1,157 +1,37 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "body": { - "type": "AwaitExpression", - "argument": { - "type": "ArrayExpression", - "elements": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "generator": false, - "expression": true, - "async": true, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, @@ -161,18 +41,191 @@ "line": 1, "column": 36 } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 36 + "expression": { + "type": "CallExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "f" + }, + "arguments": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "a" + }, + { + "type": "ArrowFunctionExpression", + "start": 5, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "y" + } + ], + "body": { + "type": "AwaitExpression", + "start": 20, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "all": false, + "argument": { + "type": "ArrayExpression", + "start": 26, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "name": "y" + } + ] + } + } + }, + { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "name": "b" + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/25/expected.json b/test/fixtures/experimental/uncategorised/25/expected.json index e14a063cf9..b194ce1ae8 100644 --- a/test/fixtures/experimental/uncategorised/25/expected.json +++ b/test/fixtures/experimental/uncategorised/25/expected.json @@ -1,114 +1,37 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "arguments": [ - { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "promise", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AwaitExpression", - "argument": { - "type": "Identifier", - "name": "promise", - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 43 - } - } - }, - "generator": false, - "expression": false, - "async": true, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 43 - } - } - } - ], + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 44, "loc": { "start": { "line": 1, @@ -118,18 +41,142 @@ "line": 1, "column": 44 } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 44 + "expression": { + "type": "CallExpression", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "f" + }, + "arguments": [ + { + "type": "FunctionExpression", + "start": 2, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 17, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "promise" + } + ], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 28, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expression": { + "type": "AwaitExpression", + "start": 28, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "all": false, + "argument": { + "type": "Identifier", + "start": 34, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "name": "promise" + } + } + } + ] + } + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/26/expected.json b/test/fixtures/experimental/uncategorised/26/expected.json index 757bab2644..ecd65e95b9 100644 --- a/test/fixtures/experimental/uncategorised/26/expected.json +++ b/test/fixtures/experimental/uncategorised/26/expected.json @@ -1,145 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "f", - "range": [ - 0, - 1 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "a", - "range": [ - 2, - 3 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "async", - "range": [ - 5, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "arguments": [ - { - "type": "Literal", - "value": 1, - "raw": "1", - "range": [ - 11, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - { - "type": "Literal", - "value": 2, - "raw": "2", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "range": [ - 5, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "Identifier", - "name": "b", - "range": [ - 18, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "range": [ - 0, - 20 - ], + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, @@ -149,22 +49,178 @@ "line": 1, "column": 20 } - } - }, - "range": [ - 0, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 20 + "range": [ + 0, + 20 + ], + "expression": { + "type": "CallExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "callee": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "f" + }, + "arguments": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 2, + 3 + ], + "name": "a" + }, + { + "type": "CallExpression", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 5, + 16 + ], + "callee": { + "type": "Identifier", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 5, + 10 + ], + "name": "async" + }, + "arguments": [ + { + "type": "Literal", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "value": 1, + "rawValue": 1, + "raw": "1" + }, + { + "type": "Literal", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "value": 2, + "rawValue": 2, + "raw": "2" + } + ] + }, + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "b" + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/27/expected.json b/test/fixtures/experimental/uncategorised/27/expected.json index be8233948d..7ab68c5779 100644 --- a/test/fixtures/experimental/uncategorised/27/expected.json +++ b/test/fixtures/experimental/uncategorised/27/expected.json @@ -1,18 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ok", - "range": [ - 4, - 6 - ], + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 17, "loc": { "start": { "line": 1, @@ -20,19 +66,37 @@ }, "end": { "line": 1, - "column": 6 + "column": 17 } - } - }, - "init": { - "type": "CallExpression", - "callee": { + }, + "range": [ + 4, + 17 + ], + "id": { "type": "Identifier", - "name": "async", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, "range": [ - 9, - 14 + 4, + 6 ], + "name": "ok" + }, + "init": { + "type": "CallExpression", + "start": 9, + "end": 17, "loc": { "start": { "line": 1, @@ -40,76 +104,60 @@ }, "end": { "line": 1, - "column": 14 + "column": 17 } - } - }, - "arguments": [ - { + }, + "range": [ + 9, + 17 + ], + "callee": { "type": "Identifier", - "name": "x", - "range": [ - 15, - 16 - ], + "start": 9, + "end": 14, "loc": { "start": { "line": 1, - "column": 15 + "column": 9 }, "end": { "line": 1, - "column": 16 + "column": 14 } - } - } - ], - "range": [ - 9, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 9 + }, + "range": [ + 9, + 14 + ], + "name": "async" }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 4, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 + "arguments": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "x" + } + ] } } - } - ], - "kind": "var", - "range": [ - 0, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/28/expected.json b/test/fixtures/experimental/uncategorised/28/expected.json index 049f900177..d5a6fc48de 100644 --- a/test/fixtures/experimental/uncategorised/28/expected.json +++ b/test/fixtures/experimental/uncategorised/28/expected.json @@ -1,27 +1,124 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "async", - "range": [ - 18, - 23 - ], + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 1, + 37 + ], + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 12, + 37 + ], + "body": [ + { + "type": "VariableDeclaration", + "start": 14, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 14, + 24 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 18, + "end": 23, "loc": { "start": { "line": 1, @@ -31,87 +128,40 @@ "line": 1, "column": 23 } - } - }, - "init": null, - "range": [ - 18, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 18 }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], - "kind": "var", - "range": [ - 14, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "async", - "range": [ - 25, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 25 + "range": [ + 18, + 23 + ], + "id": { + "type": "Identifier", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 18, + 23 + ], + "name": "async" }, - "end": { - "line": 1, - "column": 30 - } + "init": null } - }, - "right": { - "type": "Literal", - "value": 10, - "raw": "10", - "range": [ - 33, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "range": [ - 25, - 35 ], + "kind": "var" + }, + { + "type": "ExpressionStatement", + "start": 25, + "end": 35, "loc": { "start": { "line": 1, @@ -121,70 +171,79 @@ "line": 1, "column": 35 } - } - }, - "range": [ - 25, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 25 }, - "end": { - "line": 1, - "column": 35 + "range": [ + 25, + 35 + ], + "expression": { + "type": "AssignmentExpression", + "start": 25, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 25, + 35 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 25, + 30 + ], + "name": "async" + }, + "right": { + "type": "Literal", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 33, + 35 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + } } } - } - ], - "range": [ - 12, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "generator": false, - "expression": false, - "range": [ - 1, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 1 + ] }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "range": [ - 0, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 + "parenthesizedExpression": true } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/29/expected.json b/test/fixtures/experimental/uncategorised/29/expected.json index 48b080c544..8b5de05d88 100644 --- a/test/fixtures/experimental/uncategorised/29/expected.json +++ b/test/fixtures/experimental/uncategorised/29/expected.json @@ -1,55 +1,152 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 25, - "body": [ - { - "type": "ClassDeclaration", - "start": 0, - "end": 25, - "id": { - "type": "Identifier", - "start": 6, - "end": 10, - "name": "Test" - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 11, - "end": 25, - "body": [ - { - "type": "MethodDefinition", - "start": 13, - "end": 23, - "static": false, - "key": { - "type": "Identifier", - "start": 13, - "end": 18, - "name": "async" - }, - "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 18, - "end": 23, - "id": null, - "params": [], - "generator": false, - "async": false, - "body": { - "type": "BlockStatement", - "start": 21, - "end": 23, - "body": [] - }, - "expression": false - } - } - ] - } + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "Test" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 11, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "async" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/3/expected.json b/test/fixtures/experimental/uncategorised/3/expected.json index e04ad262ff..b3b034a0f3 100644 --- a/test/fixtures/experimental/uncategorised/3/expected.json +++ b/test/fixtures/experimental/uncategorised/3/expected.json @@ -1,30 +1,98 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 8, - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 8, - "expression": { - "type": "AssignmentExpression", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", "start": 0, - "end": 7, - "operator": "**=", - "left": { - "type": "Identifier", - "start": 0, - "end": 1, - "name": "a" + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } }, - "right": { - "type": "Literal", - "start": 6, + "expression": { + "type": "AssignmentExpression", + "start": 0, "end": 7, - "value": 2 + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "**=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "name": "a" + }, + "right": { + "type": "Literal", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/30/expected.json b/test/fixtures/experimental/uncategorised/30/expected.json index df663c1582..b632f91acc 100644 --- a/test/fixtures/experimental/uncategorised/30/expected.json +++ b/test/fixtures/experimental/uncategorised/30/expected.json @@ -1,54 +1,151 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 28, - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 28, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 27, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "obj" - }, - "init": { - "type": "ObjectExpression", - "start": 10, - "end": 27, - "properties": [ - { - "type": "Property", - "start": 12, - "end": 25, - "method": false, - "shorthand": false, - "key": { - "type": "Identifier", - "start": 12, - "end": 17, - "name": "async" - }, - "value": { - "type": "Literal", - "start": 19, - "end": 25, - "value": "test", - "raw": "\"test\"" - }, - "kind": "init" - } - ] - } - } - ], - "kind": "var" + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "obj" + }, + "init": { + "type": "ObjectExpression", + "start": 10, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "properties": [ + { + "type": "Property", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "method": false, + "shorthand": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "async" + }, + "value": { + "type": "Literal", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": "test", + "rawValue": "test", + "raw": "\"test\"" + }, + "kind": "init" + } + ] + } + } + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/31/expected.json b/test/fixtures/experimental/uncategorised/31/expected.json index 88a4640da1..a05229ee4e 100644 --- a/test/fixtures/experimental/uncategorised/31/expected.json +++ b/test/fixtures/experimental/uncategorised/31/expected.json @@ -1,62 +1,169 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 25, - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 25, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 24, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "obj" - }, - "init": { - "type": "ObjectExpression", - "start": 10, - "end": 24, - "properties": [ - { - "type": "Property", - "start": 12, - "end": 22, - "method": true, - "shorthand": false, - "key": { - "type": "Identifier", - "start": 12, - "end": 17, - "name": "async" - }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "start": 17, - "end": 22, - "id": null, - "params": [], - "generator": false, - "body": { - "type": "BlockStatement", - "start": 20, - "end": 22, - "body": [] - }, - "expression": false - } - } - ] - } - } - ], - "kind": "var" + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "obj" + }, + "init": { + "type": "ObjectExpression", + "start": 10, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "properties": [ + { + "type": "Property", + "start": 12, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "method": true, + "shorthand": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "async" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [] + } + } + } + ] + } + } + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/32/expected.json b/test/fixtures/experimental/uncategorised/32/expected.json index 1c53410247..42199f83cd 100644 --- a/test/fixtures/experimental/uncategorised/32/expected.json +++ b/test/fixtures/experimental/uncategorised/32/expected.json @@ -1,35 +1,101 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 29, - "body": [ - { - "type": "ExportNamedDeclaration", - "start": 0, - "end": 29, - "declaration": { - "type": "FunctionDeclaration", - "start": 7, - "end": 29, - "id": { - "type": "Identifier", - "start": 22, - "end": 25, - "name": "foo" - }, - "params": [], - "generator": false, - "async": true, - "body": { - "type": "BlockStatement", - "start": 27, - "end": 29, - "body": [] - }, - "expression": false - }, - "specifiers": [], - "source": null + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declaration": { + "type": "FunctionDeclaration", + "start": 7, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "foo" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [] + } + }, + "specifiers": [], + "source": null + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/33/expected.json b/test/fixtures/experimental/uncategorised/33/expected.json index d17f62c630..11f4e10cdb 100644 --- a/test/fixtures/experimental/uncategorised/33/expected.json +++ b/test/fixtures/experimental/uncategorised/33/expected.json @@ -1,38 +1,114 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 5, - "decorators": [ - { - "start": 0, - "expression": { - "start": 1, - "name": "foo", - "type": "Identifier", - "end": 4 - }, - "type": "Decorator", - "end": 4 - } - ], - "id": { - "start": 11, - "name": "Foo", - "type": "Identifier", - "end": 14 - }, - "superClass": null, - "body": { - "start": 15, - "body": [], - "type": "ClassBody", - "end": 17 - }, - "type": "ClassDeclaration", - "end": 17 + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 } - ], - "type": "Program", - "end": 17 + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 5, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Identifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "foo" + } + } + ], + "id": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/34/expected.json b/test/fixtures/experimental/uncategorised/34/expected.json index 883599e64a..8186beeeb5 100644 --- a/test/fixtures/experimental/uncategorised/34/expected.json +++ b/test/fixtures/experimental/uncategorised/34/expected.json @@ -1,57 +1,163 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "declarations": [ - { - "start": 4, - "id": { - "start": 4, - "name": "Foo", - "type": "Identifier", - "end": 7 - }, - "init": { - "start": 15, - "decorators": [ - { - "start": 10, - "expression": { - "start": 11, - "name": "foo", - "type": "Identifier", - "end": 14 - }, - "type": "Decorator", - "end": 14 - } - ], - "id": { - "start": 21, - "name": "Foo", - "type": "Identifier", - "end": 24 - }, - "superClass": null, - "body": { - "start": 25, - "body": [], - "type": "ClassBody", - "end": 27 - }, - "type": "ClassExpression", - "end": 27 - }, - "type": "VariableDeclarator", - "end": 27 - } - ], - "kind": "var", - "type": "VariableDeclaration", - "end": 27 + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 } - ], - "type": "Program", - "end": 27 + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "Foo" + }, + "init": { + "type": "ClassExpression", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "foo" + } + } + ], + "id": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [] + } + } + } + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/35/expected.json b/test/fixtures/experimental/uncategorised/35/expected.json index 325211881d..03c8437135 100644 --- a/test/fixtures/experimental/uncategorised/35/expected.json +++ b/test/fixtures/experimental/uncategorised/35/expected.json @@ -1,68 +1,184 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "id": { - "start": 6, - "name": "Foo", - "type": "Identifier", - "end": 9 - }, - "superClass": null, - "body": { - "start": 10, - "body": [ - { - "start": 17, - "decorators": [ - { - "start": 12, - "expression": { - "start": 13, - "name": "foo", - "type": "Identifier", - "end": 16 - }, - "type": "Decorator", - "end": 16 - } - ], - "computed": false, - "key": { - "start": 17, - "name": "bar", - "type": "Identifier", - "end": 20 - }, - "static": false, - "kind": "method", - "value": { - "start": 20, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "start": 23, - "body": [], - "type": "BlockStatement", - "end": 25 - }, - "type": "FunctionExpression", - "end": 25 - }, - "type": "MethodDefinition", - "end": 25 - } - ], - "type": "ClassBody", - "end": 27 - }, - "type": "ClassDeclaration", - "end": 27 + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 } - ], - "type": "Program", - "end": 27 + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 17, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "foo" + } + } + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "bar" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/36/expected.json b/test/fixtures/experimental/uncategorised/36/expected.json index ac6ec599f1..50d2011f36 100644 --- a/test/fixtures/experimental/uncategorised/36/expected.json +++ b/test/fixtures/experimental/uncategorised/36/expected.json @@ -1,73 +1,201 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "id": { - "start": 6, - "name": "Foo", - "type": "Identifier", - "end": 9 + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "superClass": null, - "body": { - "start": 10, - "body": [ - { - "start": 17, - "decorators": [ - { - "start": 12, - "expression": { - "start": 13, - "name": "foo", - "type": "Identifier", - "end": 16 - }, - "type": "Decorator", - "end": 16 - } - ], - "computed": false, - "key": { - "start": 21, - "name": "bar", - "type": "Identifier", - "end": 24 + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 }, - "static": false, - "kind": "set", - "value": { - "start": 24, - "id": null, - "generator": false, - "expression": false, - "params": [ + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 17, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "decorators": [ { - "type": "Identifier", - "name": "f" + "type": "Decorator", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "foo" + } } ], - "body": { - "start": 28, - "body": [], - "type": "BlockStatement", - "end": 30 + "computed": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "bar" }, - "type": "FunctionExpression", - "end": 30 - }, - "type": "MethodDefinition", - "end": 30 - } - ], - "type": "ClassBody", - "end": 32 - }, - "type": "ClassDeclaration", - "end": 32 - } - ], - "type": "Program", - "end": 32 + "static": false, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "f" + } + ], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/37/expected.json b/test/fixtures/experimental/uncategorised/37/expected.json index 13e163c2f4..ac0fa38fc3 100644 --- a/test/fixtures/experimental/uncategorised/37/expected.json +++ b/test/fixtures/experimental/uncategorised/37/expected.json @@ -1,68 +1,184 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "id": { - "start": 6, - "name": "Foo", - "type": "Identifier", - "end": 9 - }, - "superClass": null, - "body": { - "start": 10, - "body": [ - { - "start": 17, - "decorators": [ - { - "start": 12, - "expression": { - "start": 13, - "name": "foo", - "type": "Identifier", - "end": 16 - }, - "type": "Decorator", - "end": 16 - } - ], - "computed": false, - "key": { - "start": 21, - "name": "bar", - "type": "Identifier", - "end": 24 - }, - "static": false, - "kind": "get", - "value": { - "start": 24, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "start": 27, - "body": [], - "type": "BlockStatement", - "end": 29 - }, - "type": "FunctionExpression", - "end": 29 - }, - "type": "MethodDefinition", - "end": 29 - } - ], - "type": "ClassBody", - "end": 31 - }, - "type": "ClassDeclaration", - "end": 31 + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 } - ], - "type": "Program", - "end": 31 + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "foo" + } + } + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "name": "bar" + }, + "static": false, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/38/expected.json b/test/fixtures/experimental/uncategorised/38/expected.json index 89dc3fe4a6..c538000216 100644 --- a/test/fixtures/experimental/uncategorised/38/expected.json +++ b/test/fixtures/experimental/uncategorised/38/expected.json @@ -1,79 +1,215 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "id": { - "start": 6, - "name": "Foo", - "type": "Identifier", - "end": 9 - }, - "superClass": null, - "body": { - "start": 10, - "body": [ - { - "start": 22, - "decorators": [ - { - "start": 12, - "expression": { - "start": 13, - "name": "foo", - "type": "Identifier", - "end": 16 - }, - "type": "Decorator", - "end": 16 - }, - { - "start": 17, - "expression": { - "start": 18, - "name": "bar", - "type": "Identifier", - "end": 21 - }, - "type": "Decorator", - "end": 21 - } - ], - "computed": false, - "key": { - "start": 22, - "name": "bar", - "type": "Identifier", - "end": 25 - }, - "static": false, - "kind": "method", - "value": { - "start": 25, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "start": 28, - "body": [], - "type": "BlockStatement", - "end": 30 - }, - "type": "FunctionExpression", - "end": 30 - }, - "type": "MethodDefinition", - "end": 30 - } - ], - "type": "ClassBody", - "end": 32 - }, - "type": "ClassDeclaration", - "end": 32 + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 } - ], - "type": "Program", - "end": 32 + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 22, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "foo" + } + }, + { + "type": "Decorator", + "start": 17, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "Identifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "bar" + } + } + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "bar" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/39/expected.json b/test/fixtures/experimental/uncategorised/39/expected.json index 3ac44b9acb..ae7ad96b18 100644 --- a/test/fixtures/experimental/uncategorised/39/expected.json +++ b/test/fixtures/experimental/uncategorised/39/expected.json @@ -1,99 +1,265 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 31, - "decorators": [ - { - "start": 0, - "expression": { - "start": 1, - "callee": { - "start": 1, - "name": "foo", - "type": "Identifier", - "end": 4 - }, - "arguments": [ - { - "start": 5, - "properties": [ - { - "start": 12, - "decorators": [ - { - "start": 7, - "expression": { - "start": 8, - "name": "bar", - "type": "Identifier", - "end": 11 - }, - "type": "Decorator", - "end": 11 - } - ], - "method": false, - "shorthand": false, - "computed": false, - "key": { - "start": 12, - "name": "foo", - "type": "Identifier", - "end": 15 - }, - "value": { - "start": 17, - "value": "bar", - "raw": "\"bar\"", - "type": "Literal", - "end": 22 - }, - "kind": "init", - "type": "Property", - "end": 22 - } - ], - "type": "ObjectExpression", - "end": 24 - } - ], - "type": "CallExpression", - "end": 25 - }, - "type": "Decorator", - "end": 25 - }, - { - "start": 26, - "expression": { - "start": 27, - "name": "bar", - "type": "Identifier", - "end": 30 - }, - "type": "Decorator", - "end": 30 - } - ], - "id": { - "start": 37, - "name": "Foo", - "type": "Identifier", - "end": 40 - }, - "superClass": null, - "body": { - "start": 41, - "body": [], - "type": "ClassBody", - "end": 43 - }, - "type": "ClassDeclaration", - "end": 43 + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 } - ], - "sourceType": "script", - "type": "Program", - "end": 43 + }, + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 31, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "CallExpression", + "start": 1, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "callee": { + "type": "Identifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "foo" + }, + "arguments": [ + { + "type": "ObjectExpression", + "start": 5, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "properties": [ + { + "type": "Property", + "start": 12, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "bar" + } + } + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "foo" + }, + "value": { + "type": "Literal", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" + }, + "kind": "init" + } + ] + } + ] + } + }, + { + "type": "Decorator", + "start": 26, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "Identifier", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "name": "bar" + } + } + ], + "id": { + "type": "Identifier", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "body": [] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/4/expected.json b/test/fixtures/experimental/uncategorised/4/expected.json index e48fde443b..b80d1e3d1d 100644 --- a/test/fixtures/experimental/uncategorised/4/expected.json +++ b/test/fixtures/experimental/uncategorised/4/expected.json @@ -1,44 +1,134 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 21, - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 21, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 20, - "id": { - "type": "Identifier", - "start": 4, - "end": 11, - "name": "squared" + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "init": { - "type": "BinaryExpression", - "start": 14, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, "end": 20, - "left": { - "type": "Literal", - "start": 14, - "end": 15, - "value": 2 + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } }, - "operator": "**", - "right": { - "type": "Literal", - "start": 19, + "id": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "squared" + }, + "init": { + "type": "BinaryExpression", + "start": 14, "end": 20, - "value": 2 + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "left": { + "type": "Literal", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + }, + "operator": "**", + "right": { + "type": "Literal", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + } } } - } - ], - "kind": "var" - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/40/expected.json b/test/fixtures/experimental/uncategorised/40/expected.json index ce71c6ac77..561ed2763d 100644 --- a/test/fixtures/experimental/uncategorised/40/expected.json +++ b/test/fixtures/experimental/uncategorised/40/expected.json @@ -1,69 +1,194 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 5, - "decorators": [ - { - "start": 0, - "expression": { - "start": 1, - "name": "bar", - "type": "Identifier", - "end": 4 - }, - "type": "Decorator", - "end": 4 - } - ], - "id": { - "start": 11, - "name": "Foo", - "type": "Identifier", - "end": 14 + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "superClass": { - "start": 28, + "end": { + "line": 1, + "column": 43 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 5, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 43 + } + }, "decorators": [ { - "start": 23, - "expression": { - "start": 24, - "name": "foo", - "type": "Identifier", - "end": 27 - }, "type": "Decorator", - "end": 27 + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Identifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "bar" + } } ], "id": { - "start": 34, - "name": "Bar", "type": "Identifier", - "end": 37 + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "Foo" + }, + "superClass": { + "type": "ClassExpression", + "start": 28, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 23, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "foo" + } + } + ], + "id": { + "type": "Identifier", + "start": 34, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "name": "Bar" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "body": [] + } }, - "superClass": null, "body": { - "start": 38, - "body": [], "type": "ClassBody", - "end": 40 - }, - "type": "ClassExpression", - "end": 40 - }, - "body": { - "start": 41, - "body": [], - "type": "ClassBody", - "end": 43 - }, - "type": "ClassDeclaration", - "end": 43 - } - ], - "sourceType": "script", - "type": "Program", - "end": 43 + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "body": [] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/43/expected.json b/test/fixtures/experimental/uncategorised/43/expected.json index 31b8fa9e26..b60ecb31ce 100644 --- a/test/fixtures/experimental/uncategorised/43/expected.json +++ b/test/fixtures/experimental/uncategorised/43/expected.json @@ -1,46 +1,133 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "id": { - "start": 6, - "name": "Foo", - "type": "Identifier", - "end": 9 - }, - "superClass": null, - "body": { - "start": 10, - "body": [ - { - "start": 12, - "computed": false, - "key": { - "start": 12, - "name": "foo", - "type": "Identifier", - "end": 15 - }, - "static": false, - "value": { - "start": 18, - "value": "bar", - "raw": "\"bar\"", - "type": "Literal", - "end": 23 - }, - "type": "ClassProperty", - "end": 24 - } - ], - "type": "ClassBody", - "end": 26 - }, - "type": "ClassDeclaration", - "end": 26 + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 } - ], - "type": "Program", - "end": 26 + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "foo" + }, + "static": false, + "value": { + "type": "Literal", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" + } + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/44/expected.json b/test/fixtures/experimental/uncategorised/44/expected.json index be17aaa2ce..f0a0229229 100644 --- a/test/fixtures/experimental/uncategorised/44/expected.json +++ b/test/fixtures/experimental/uncategorised/44/expected.json @@ -1,40 +1,116 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "id": { - "start": 6, - "name": "Foo", - "type": "Identifier", - "end": 9 - }, - "superClass": null, - "body": { - "start": 10, - "body": [ - { - "start": 12, - "computed": false, - "key": { - "start": 12, - "name": "foo", - "type": "Identifier", - "end": 15 - }, - "static": false, - "value": null, - "type": "ClassProperty", - "end": 16 - } - ], - "type": "ClassBody", - "end": 18 - }, - "type": "ClassDeclaration", - "end": 18 + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 } - ], - "type": "Program", - "end": 18 + }, + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "foo" + }, + "static": false, + "value": null + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/45/expected.json b/test/fixtures/experimental/uncategorised/45/expected.json index ff5801a713..5b0f534e52 100644 --- a/test/fixtures/experimental/uncategorised/45/expected.json +++ b/test/fixtures/experimental/uncategorised/45/expected.json @@ -1,40 +1,116 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "id": { - "start": 6, - "name": "Foo", - "type": "Identifier", - "end": 9 - }, - "superClass": null, - "body": { - "start": 10, - "body": [ - { - "start": 12, - "computed": false, - "key": { - "start": 19, - "name": "foo", - "type": "Identifier", - "end": 22 - }, - "static": true, - "value": null, - "type": "ClassProperty", - "end": 23 - } - ], - "type": "ClassBody", - "end": 25 - }, - "type": "ClassDeclaration", - "end": 25 + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 } - ], - "type": "Program", - "end": 25 + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "foo" + }, + "static": true, + "value": null + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/46/expected.json b/test/fixtures/experimental/uncategorised/46/expected.json index 3b6dae2f51..c04b1ed63a 100644 --- a/test/fixtures/experimental/uncategorised/46/expected.json +++ b/test/fixtures/experimental/uncategorised/46/expected.json @@ -1,46 +1,133 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "id": { - "start": 6, - "name": "Foo", - "type": "Identifier", - "end": 9 - }, - "superClass": null, - "body": { - "start": 10, - "body": [ - { - "start": 12, - "computed": false, - "key": { - "start": 19, - "name": "foo", - "type": "Identifier", - "end": 22 - }, - "static": true, - "value": { - "start": 25, - "value": "bar", - "raw": "\"bar\"", - "type": "Literal", - "end": 30 - }, - "type": "ClassProperty", - "end": 31 - } - ], - "type": "ClassBody", - "end": 33 - }, - "type": "ClassDeclaration", - "end": 33 + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 } - ], - "type": "Program", - "end": 33 + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 12, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "foo" + }, + "static": true, + "value": { + "type": "Literal", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" + } + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/47/expected.json b/test/fixtures/experimental/uncategorised/47/expected.json index 05f4a76bbf..bda9a3aa5f 100644 --- a/test/fixtures/experimental/uncategorised/47/expected.json +++ b/test/fixtures/experimental/uncategorised/47/expected.json @@ -1,59 +1,166 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "id": { - "start": 6, - "name": "Foo", - "type": "Identifier", - "end": 9 - }, - "superClass": null, - "body": { - "start": 10, - "body": [ - { - "start": 17, - "decorators": [ - { - "start": 12, - "expression": { - "start": 13, - "name": "bar", - "type": "Identifier", - "end": 16 - }, - "type": "Decorator", - "end": 16 - } - ], - "computed": false, - "key": { - "start": 17, - "name": "foo", - "type": "Identifier", - "end": 20 - }, - "static": false, - "value": { - "start": 23, - "value": "bar", - "raw": "\"bar\"", - "type": "Literal", - "end": 28 - }, - "type": "ClassProperty", - "end": 29 - } - ], - "type": "ClassBody", - "end": 31 - }, - "type": "ClassDeclaration", - "end": 31 + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 } - ], - "type": "Program", - "end": 31 + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "bar" + } + } + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "foo" + }, + "static": false, + "value": { + "type": "Literal", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" + } + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/48/expected.json b/test/fixtures/experimental/uncategorised/48/expected.json index 323b65adeb..4a67cce782 100644 --- a/test/fixtures/experimental/uncategorised/48/expected.json +++ b/test/fixtures/experimental/uncategorised/48/expected.json @@ -1,59 +1,166 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "id": { - "start": 6, - "name": "Foo", - "type": "Identifier", - "end": 9 - }, - "superClass": null, - "body": { - "start": 10, - "body": [ - { - "start": 17, - "decorators": [ - { - "start": 12, - "expression": { - "start": 13, - "name": "bar", - "type": "Identifier", - "end": 16 - }, - "type": "Decorator", - "end": 16 - } - ], - "computed": false, - "key": { - "start": 24, - "name": "foo", - "type": "Identifier", - "end": 27 - }, - "static": true, - "value": { - "start": 30, - "value": "bar", - "raw": "\"bar\"", - "type": "Literal", - "end": 35 - }, - "type": "ClassProperty", - "end": 36 - } - ], - "type": "ClassBody", - "end": 38 - }, - "type": "ClassDeclaration", - "end": 38 + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 } - ], - "type": "Program", - "end": 38 + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 17, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "bar" + } + } + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "foo" + }, + "static": true, + "value": { + "type": "Literal", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" + } + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/49/expected.json b/test/fixtures/experimental/uncategorised/49/expected.json index 219efa1834..dfcd786eed 100644 --- a/test/fixtures/experimental/uncategorised/49/expected.json +++ b/test/fixtures/experimental/uncategorised/49/expected.json @@ -1,65 +1,185 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "declarations": [ - { - "start": 4, - "id": { - "start": 4, - "name": "obj", - "type": "Identifier", - "end": 7 - }, - "init": { - "start": 10, - "properties": [ - { - "start": 17, - "key": { - "start": 17, - "name": "bar", - "type": "Identifier", - "end": 20 - }, - "value": { - "start": 22, - "value": "wow", - "raw": "'wow'", - "type": "Literal", - "end": 27 - }, - "kind": "init", - "decorators": [ - { - "start": 12, - "expression": { - "start": 13, - "name": "foo", - "type": "Identifier", - "end": 16 - }, - "type": "Decorator", - "end": 16 - } - ], - "type": "Property", - "end": 27 - } - ], - "type": "ObjectExpression", - "end": 29 - }, - "type": "VariableDeclarator", - "end": 29 - } - ], - "kind": "var", - "type": "VariableDeclaration", - "end": 30 + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 } - ], - "type": "Program", - "end": 30 + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "obj" + }, + "init": { + "type": "ObjectExpression", + "start": 10, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "properties": [ + { + "type": "Property", + "start": 17, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "foo" + } + } + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "bar" + }, + "value": { + "type": "Literal", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "value": "wow", + "rawValue": "wow", + "raw": "'wow'" + }, + "kind": "init" + } + ] + } + } + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/5/expected.json b/test/fixtures/experimental/uncategorised/5/expected.json index 99059ad8f5..645aef02a4 100644 --- a/test/fixtures/experimental/uncategorised/5/expected.json +++ b/test/fixtures/experimental/uncategorised/5/expected.json @@ -1,28 +1,135 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Literal", - "value": 2 + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } }, - "operator": "**", - "right": { + "expression": { "type": "BinaryExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, "left": { "type": "Literal", - "value": 3 + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" }, "operator": "**", "right": { - "type": "Literal", - "value": 2 + "type": "BinaryExpression", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "left": { + "type": "Literal", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + }, + "operator": "**", + "right": { + "type": "Literal", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + }, + "parenthesizedExpression": true } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/50/expected.json b/test/fixtures/experimental/uncategorised/50/expected.json index 652ac2c214..1ee24c7d22 100644 --- a/test/fixtures/experimental/uncategorised/50/expected.json +++ b/test/fixtures/experimental/uncategorised/50/expected.json @@ -1,34 +1,146 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "start": 0, - "end": 31, - "specifiers": [ - { - "type": "ExportDefaultSpecifier", - "exported": { - "type": "Identifier", - "name": "foo", - "start": 7, - "end": 10 + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 } }, - { - "type": "ExportSpecifier", - "exported": { - "type": "Identifier", - "name": "bar" + "specifiers": [ + { + "type": "ExportDefaultSpecifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "exported": { + "type": "Identifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "foo" + } + }, + { + "type": "ExportSpecifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "local": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "bar" + }, + "exported": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "bar" + } } + ], + "source": { + "type": "Literal", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" } - ], - "source": { - "type": "Literal", - "value": "bar", - "start": 25, - "end": 30 } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/51/expected.json b/test/fixtures/experimental/uncategorised/51/expected.json index a6b9c2af4a..fce4a529c1 100644 --- a/test/fixtures/experimental/uncategorised/51/expected.json +++ b/test/fixtures/experimental/uncategorised/51/expected.json @@ -1,34 +1,146 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "start": 0, - "end": 36, - "specifiers": [ - { - "type": "ExportNamespaceSpecifier", - "exported": { - "type": "Identifier", - "name": "foo", - "start": 12, - "end": 15 + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 } }, - { - "type": "ExportSpecifier", - "exported": { - "type": "Identifier", - "name": "bar" + "specifiers": [ + { + "type": "ExportNamespaceSpecifier", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "exported": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "foo" + } + }, + { + "type": "ExportSpecifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "local": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "bar" + }, + "exported": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": "bar" + } } + ], + "source": { + "type": "Literal", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" } - ], - "source": { - "type": "Literal", - "value": "bar", - "start": 30, - "end": 35 } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/52/expected.json b/test/fixtures/experimental/uncategorised/52/expected.json index 3ff3cc7329..ce4be697a2 100644 --- a/test/fixtures/experimental/uncategorised/52/expected.json +++ b/test/fixtures/experimental/uncategorised/52/expected.json @@ -1,27 +1,99 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "start": 0, - "end": 22, - "specifiers": [ - { - "type": "ExportDefaultSpecifier", - "exported": { - "type": "Identifier", - "name": "foo", - "start": 7, - "end": 10 - } - } - ], - "source": { - "type": "Literal", - "value": "bar", - "start": 16, - "end": 21 - } + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "specifiers": [ + { + "type": "ExportDefaultSpecifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "exported": { + "type": "Identifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "foo" + } + } + ], + "source": { + "type": "Literal", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/53/expected.json b/test/fixtures/experimental/uncategorised/53/expected.json index e6ff527236..2808aa7406 100644 --- a/test/fixtures/experimental/uncategorised/53/expected.json +++ b/test/fixtures/experimental/uncategorised/53/expected.json @@ -1,27 +1,99 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "start": 0, - "end": 26, - "specifiers": [ - { - "type": "ExportDefaultSpecifier", - "exported": { - "type": "Identifier", - "name": "default", - "start": 7, - "end": 14 - } - } - ], - "source": { - "type": "Literal", - "value": "bar", - "start": 20, - "end": 25 - } + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "specifiers": [ + { + "type": "ExportDefaultSpecifier", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "exported": { + "type": "Identifier", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "default" + } + } + ], + "source": { + "type": "Literal", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/54/expected.json b/test/fixtures/experimental/uncategorised/54/expected.json index a584f70ba5..a8787da9bf 100644 --- a/test/fixtures/experimental/uncategorised/54/expected.json +++ b/test/fixtures/experimental/uncategorised/54/expected.json @@ -1,27 +1,99 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "start": 0, - "end": 27, - "specifiers": [ - { - "type": "ExportNamespaceSpecifier", - "exported": { - "type": "Identifier", - "name": "foo", - "start": 12, - "end": 15 - } - } - ], - "source": { - "type": "Literal", - "value": "bar", - "start": 21, - "end": 26 - } + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "specifiers": [ + { + "type": "ExportNamespaceSpecifier", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "exported": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "foo" + } + } + ], + "source": { + "type": "Literal", + "start": 21, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/55/expected.json b/test/fixtures/experimental/uncategorised/55/expected.json index 7e912fe464..7f7e0e35a4 100644 --- a/test/fixtures/experimental/uncategorised/55/expected.json +++ b/test/fixtures/experimental/uncategorised/55/expected.json @@ -1,43 +1,133 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 16, - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 16, - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "log", - "start": 0, - "end": 3 - }, - "arguments": [ - { - "type": "Identifier", - "name": "n", - "start": 4, - "end": 5 - }, - { - "type": "Literal", - "value": "=", - "raw": "'='", - "start": 7, - "end": 10 - }, - { - "type": "Literal", - "raw": "2", - "value": 2, - "start": 12, - "end": 13 - } - ] - } + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "log" + }, + "arguments": [ + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "n" + }, + { + "type": "Literal", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "value": "=", + "rawValue": "=", + "raw": "'='" + }, + { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/56/expected.json b/test/fixtures/experimental/uncategorised/56/expected.json index befe2bfddb..31ecdf84a7 100644 --- a/test/fixtures/experimental/uncategorised/56/expected.json +++ b/test/fixtures/experimental/uncategorised/56/expected.json @@ -1,45 +1,132 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 29, - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "log", - "start": 9, - "end": 12 - }, - "start": 0, - "end": 29, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "n", - "start": 13, - "end": 14 - }, - { - "type": "Identifier", - "name": "op", - "start": 16, - "end": 18 - }, - { - "type": "Identifier", - "name": "val", - "start": 20, - "end": 23 - } - ], - "body": { - "type": "BlockStatement", - "start": 26, - "end": 29, - "body": [] - } + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "log" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "n" + }, + { + "type": "Identifier", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "name": "op" + }, + { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "val" + } + ], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/57/expected.json b/test/fixtures/experimental/uncategorised/57/expected.json index b0188f7797..ebb3ee0019 100644 --- a/test/fixtures/experimental/uncategorised/57/expected.json +++ b/test/fixtures/experimental/uncategorised/57/expected.json @@ -1,61 +1,168 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 25, - "body": [ - { - "type": "ClassDeclaration", - "start": 0, - "end": 25, - "id": { - "type": "Identifier", - "name": "Foo", - "start": 6, - "end": 9 - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 10, - "end": 25, - "body": [ - { - "type": "MethodDefinition", - "start": 12, - "end": 23, - "static": false, - "key": { - "type": "Identifier", - "start": 12, - "end": 15, - "name": "bar" - }, - "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 15, - "end": 23, - "id": null, - "params": [ - { - "type": "Identifier", - "name": "a", - "start": 16, - "end": 17 - } - ], - "generator": false, - "body": { - "type": "BlockStatement", - "start": 20, - "end": 23, - "body": [] - }, - "expression": false - } - } - ] - } + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "bar" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "a" + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [] + } + } + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/58/expected.json b/test/fixtures/experimental/uncategorised/58/expected.json index 5d9dd80d09..81f0200f6c 100644 --- a/test/fixtures/experimental/uncategorised/58/expected.json +++ b/test/fixtures/experimental/uncategorised/58/expected.json @@ -1,41 +1,118 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "expression": { - "start": 0, - "id": null, - "generator": false, - "expression": true, - "params": [ - { - "start": 1, - "name": "x", - "type": "Identifier", - "end": 2 - }, - { - "start": 4, - "name": "y", - "type": "Identifier", - "end": 5 - } - ], - "body": { - "start": 12, - "value": 1, - "raw": "1", - "type": "Literal", - "end": 13 - }, - "type": "ArrowFunctionExpression", - "end": 13 - }, - "type": "ExpressionStatement", - "end": 14 + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 } - ], - "type": "Program", - "end": 14 + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "y" + } + ], + "body": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/6/expected.json b/test/fixtures/experimental/uncategorised/6/expected.json index 99059ad8f5..15ed38285c 100644 --- a/test/fixtures/experimental/uncategorised/6/expected.json +++ b/test/fixtures/experimental/uncategorised/6/expected.json @@ -1,28 +1,134 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Literal", - "value": 2 + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } }, - "operator": "**", - "right": { + "expression": { "type": "BinaryExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, "left": { "type": "Literal", - "value": 3 + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" }, "operator": "**", "right": { - "type": "Literal", - "value": 2 + "type": "BinaryExpression", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "Literal", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": 3, + "rawValue": 3, + "raw": "3" + }, + "operator": "**", + "right": { + "type": "Literal", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + } } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/7/expected.json b/test/fixtures/experimental/uncategorised/7/expected.json index da04b9ae83..2bf4b6353d 100644 --- a/test/fixtures/experimental/uncategorised/7/expected.json +++ b/test/fixtures/experimental/uncategorised/7/expected.json @@ -1,33 +1,152 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Literal", - "value": 2 + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "operator": "**", - "right": { - "type": "UnaryExpression", - "operator": "-", - "prefix": true, - "argument": { - "type": "Literal", - "value": 1 - } + "end": { + "line": 1, + "column": 13 } }, - "operator": "*", - "right": { - "type": "Literal", - "value": 2 + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "BinaryExpression", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "left": { + "type": "Literal", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + }, + "operator": "**", + "right": { + "type": "UnaryExpression", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "-", + "prefix": true, + "argument": { + "type": "Literal", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + }, + "parenthesizedExpression": true + }, + "operator": "*", + "right": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/8/expected.json b/test/fixtures/experimental/uncategorised/8/expected.json index da04b9ae83..f9cf647bff 100644 --- a/test/fixtures/experimental/uncategorised/8/expected.json +++ b/test/fixtures/experimental/uncategorised/8/expected.json @@ -1,33 +1,151 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "BinaryExpression", - "left": { - "type": "Literal", - "value": 2 + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "operator": "**", - "right": { - "type": "UnaryExpression", - "operator": "-", - "prefix": true, - "argument": { - "type": "Literal", - "value": 1 - } + "end": { + "line": 1, + "column": 11 } }, - "operator": "*", - "right": { - "type": "Literal", - "value": 2 + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Literal", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + }, + "operator": "**", + "right": { + "type": "UnaryExpression", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "-", + "prefix": true, + "argument": { + "type": "Literal", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + }, + "operator": "*", + "right": { + "type": "Literal", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": 2, + "rawValue": 2, + "raw": "2" + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/9/expected.json b/test/fixtures/experimental/uncategorised/9/expected.json index 91a08f8a48..f1dfa90a4f 100644 --- a/test/fixtures/experimental/uncategorised/9/expected.json +++ b/test/fixtures/experimental/uncategorised/9/expected.json @@ -1,44 +1,130 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 14, - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 14, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 14, - "id": { - "type": "ObjectPattern", - "start": 4, - "end": 10, - "properties": [ - { - "type": "SpreadProperty", - "start": 5, - "end": 9, - "argument": { - "type": "Identifier", - "start": 8, - "end": 9, - "name": "x" - } - } - ] - }, - "init": { - "type": "Identifier", - "start": 13, - "end": 14, - "name": "z" - } - } - ], - "kind": "let" + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "properties": [ + { + "type": "SpreadProperty", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "argument": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "name": "x" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "z" + } + } + ], + "kind": "let" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/array-types/1/expected.json b/test/fixtures/flow/array-types/1/expected.json index 3b4e1569a4..4e440eea85 100644 --- a/test/fixtures/flow/array-types/1/expected.json +++ b/test/fixtures/flow/array-types/1/expected.json @@ -1,69 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ArrayTypeAnnotation", - "elementType": { - "type": "NumberTypeAnnotation", - "range": [ - 7, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "range": [ - 7, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "range": [ - 5, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "range": [ - 4, - 15 - ], + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 15, "loc": { "start": { "line": 1, @@ -73,40 +68,93 @@ "line": 1, "column": 15 } - } - }, - "init": null, - "range": [ - 4, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 15 - } + "range": [ + 4, + 15 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 4, + 15 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 5, + 15 + ], + "typeAnnotation": { + "type": "ArrayTypeAnnotation", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 7, + 15 + ], + "elementType": { + "type": "NumberTypeAnnotation", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 7, + 13 + ] + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/array-types/2/expected.json b/test/fixtures/flow/array-types/2/expected.json index 42e01fbd0d..5e5ae5b72e 100644 --- a/test/fixtures/flow/array-types/2/expected.json +++ b/test/fixtures/flow/array-types/2/expected.json @@ -1,86 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "typeAnnotation": { - "type": "ArrayTypeAnnotation", - "elementType": { - "type": "NumberTypeAnnotation", - "range": [ - 8, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 8, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "range": [ - 7, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "range": [ - 5, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "range": [ - 4, - 16 - ], + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 16, "loc": { "start": { "line": 1, @@ -90,40 +68,112 @@ "line": 1, "column": 16 } - } - }, - "init": null, - "range": [ - 4, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 16 - } + "range": [ + 4, + 16 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 4, + 16 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 5, + 16 + ], + "typeAnnotation": { + "type": "NullableTypeAnnotation", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 7, + 16 + ], + "typeAnnotation": { + "type": "ArrayTypeAnnotation", + "start": 8, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 8, + 16 + ], + "elementType": { + "type": "NumberTypeAnnotation", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ] + } + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/array-types/3/expected.json b/test/fixtures/flow/array-types/3/expected.json index d2c24b0e35..5bb0bc53ec 100644 --- a/test/fixtures/flow/array-types/3/expected.json +++ b/test/fixtures/flow/array-types/3/expected.json @@ -1,86 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ArrayTypeAnnotation", - "elementType": { - "type": "NullableTypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 9, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "range": [ - 8, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "range": [ - 7, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "range": [ - 5, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "range": [ - 4, - 18 - ], + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 18, "loc": { "start": { "line": 1, @@ -90,40 +68,112 @@ "line": 1, "column": 18 } - } - }, - "init": null, - "range": [ - 4, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 18 - } + "range": [ + 4, + 18 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 4, + 18 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 5, + 18 + ], + "typeAnnotation": { + "type": "ArrayTypeAnnotation", + "start": 7, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 7, + 18 + ], + "elementType": { + "type": "NullableTypeAnnotation", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 8, + 15 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 9, + 15 + ] + } + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/array-types/4/expected.json b/test/fixtures/flow/array-types/4/expected.json index 25dc3cff04..6f14f7b527 100644 --- a/test/fixtures/flow/array-types/4/expected.json +++ b/test/fixtures/flow/array-types/4/expected.json @@ -1,88 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "ArrayTypeAnnotation", - "elementType": { - "type": "NumberTypeAnnotation", - "range": [ - 13, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "range": [ - 13, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "typeParameters": null, - "range": [ - 7, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "range": [ - 5, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "range": [ - 4, - 21 - ], + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 21, "loc": { "start": { "line": 1, @@ -92,40 +68,115 @@ "line": 1, "column": 21 } - } - }, - "init": null, - "range": [ - 4, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 21 - } + "range": [ + 4, + 21 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 4, + 21 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 5, + 21 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 7, + 21 + ], + "params": [], + "rest": null, + "returnType": { + "type": "ArrayTypeAnnotation", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 13, + 21 + ], + "elementType": { + "type": "NumberTypeAnnotation", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 13, + 19 + ] + } + }, + "typeParameters": null + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/array-types/5/expected.json b/test/fixtures/flow/array-types/5/expected.json index 0ad4e38e03..203a1a4220 100644 --- a/test/fixtures/flow/array-types/5/expected.json +++ b/test/fixtures/flow/array-types/5/expected.json @@ -1,88 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ArrayTypeAnnotation", - "elementType": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 14, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "typeParameters": null, - "range": [ - 8, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "range": [ - 7, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 5, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 4, - 23 - ], + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 23, "loc": { "start": { "line": 1, @@ -92,40 +68,115 @@ "line": 1, "column": 23 } - } - }, - "init": null, - "range": [ - 4, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 23 - } + "range": [ + 4, + 23 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 4, + 23 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 5, + 23 + ], + "typeAnnotation": { + "type": "ArrayTypeAnnotation", + "start": 7, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 7, + 23 + ], + "elementType": { + "type": "FunctionTypeAnnotation", + "start": 8, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 8, + 20 + ], + "params": [], + "rest": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 14, + 20 + ] + }, + "typeParameters": null + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/array-types/6/expected.json b/test/fixtures/flow/array-types/6/expected.json index a2a9bf7229..bb49227b27 100644 --- a/test/fixtures/flow/array-types/6/expected.json +++ b/test/fixtures/flow/array-types/6/expected.json @@ -1,105 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ArrayTypeAnnotation", - "elementType": { - "type": "TypeofTypeAnnotation", - "argument": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "typeParameters": null, - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "range": [ - 7, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "range": [ - 7, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 5, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 4, - 17 - ], + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 17, "loc": { "start": { "line": 1, @@ -109,40 +68,133 @@ "line": 1, "column": 17 } - } - }, - "init": null, - "range": [ - 4, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 17 - } + "range": [ + 4, + 17 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 4, + 17 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 5, + 17 + ], + "typeAnnotation": { + "type": "ArrayTypeAnnotation", + "start": 7, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 7, + 17 + ], + "elementType": { + "type": "TypeofTypeAnnotation", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 7, + 15 + ], + "argument": { + "type": "GenericTypeAnnotation", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "A" + } + } + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/bounded-polymorphism/1/expected.json b/test/fixtures/flow/bounded-polymorphism/1/expected.json index 3691542dff..595c54bddb 100644 --- a/test/fixtures/flow/bounded-polymorphism/1/expected.json +++ b/test/fixtures/flow/bounded-polymorphism/1/expected.json @@ -1,62 +1,139 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 6, - 7 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [], - "range": [ - 16, - 18 - ], + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, - "column": 16 + "column": 0 }, "end": { "line": 1, "column": 18 } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "typeAnnotation": { - "type": "TypeAnnotation", + }, + "range": [ + 0, + 18 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 7, + 15 + ], + "params": [ + { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ], + "name": "T", "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 11, - 14 - ], + "type": "TypeAnnotation", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 9, + 14 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 11, + "end": 14, "loc": { "start": { "line": 1, @@ -66,84 +143,59 @@ "line": 1, "column": 14 } - } - }, - "typeParameters": null, - "range": [ - 11, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 11 }, - "end": { - "line": 1, - "column": 14 + "range": [ + 11, + 14 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 11, + 14 + ], + "name": "Foo" } } - }, - "range": [ - 9, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 8, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 } } - } - ], - "range": [ - 7, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "range": [ - 0, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 0 + ] }, - "end": { - "line": 1, - "column": 18 + "superClass": null, + "body": { + "type": "ClassBody", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 16, + 18 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/bounded-polymorphism/2/expected.json b/test/fixtures/flow/bounded-polymorphism/2/expected.json index 649a6f4f3f..960c7e01d3 100644 --- a/test/fixtures/flow/bounded-polymorphism/2/expected.json +++ b/test/fixtures/flow/bounded-polymorphism/2/expected.json @@ -1,149 +1,202 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "bar", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 27, - 29 - ], + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 29, "loc": { "start": { "line": 1, - "column": 27 + "column": 0 }, "end": { "line": 1, "column": 29 } - } - }, - "generator": false, - "expression": false, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 17, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 16, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 14, - 23 - ], + }, + "range": [ + 0, + 29 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "bar" + }, + "generator": false, + "expression": false, + "async": false, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 12, + 24 + ], + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 23, "loc": { "start": { "line": 1, - "column": 14 + "column": 13 }, "end": { "line": 1, "column": 23 } - } - }, - "range": [ - 13, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 13 }, - "end": { - "line": 1, - "column": 23 + "range": [ + 13, + 23 + ], + "name": "T", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 14, + 23 + ], + "typeAnnotation": { + "type": "NullableTypeAnnotation", + "start": 16, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 16, + 23 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 17, + 23 + ] + } + } } } - } - ], - "range": [ - 12, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "range": [ - 0, - 29 - ], - "loc": { - "start": { - "line": 1, - "column": 0 + ] }, - "end": { - "line": 1, - "column": 29 + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 27, + 29 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/call-properties/1/expected.json b/test/fixtures/flow/call-properties/1/expected.json index a754fa04ae..a771258acb 100644 --- a/test/fixtures/flow/call-properties/1/expected.json +++ b/test/fixtures/flow/call-properties/1/expected.json @@ -1,109 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [], - "indexers": [], - "callProperties": [ - { - "type": "ObjectTypeCallProperty", - "value": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 14, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "typeParameters": null, - "range": [ - 10, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "range": [ - 10, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "range": [ - 8, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "range": [ - 6, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "range": [ - 4, - 22 - ], + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, "loc": { "start": { "line": 1, @@ -113,40 +68,138 @@ "line": 1, "column": 22 } - } - }, - "init": null, - "range": [ - 4, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 22 - } + "range": [ + 4, + 22 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 4, + 22 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 6, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 6, + 22 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 8, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 8, + 22 + ], + "callProperties": [ + { + "type": "ObjectTypeCallProperty", + "start": 10, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 10, + 20 + ], + "value": { + "type": "FunctionTypeAnnotation", + "start": 10, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 10, + 20 + ], + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 14, + 20 + ] + } + } + } + ], + "properties": [], + "indexers": [] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/call-properties/2/expected.json b/test/fixtures/flow/call-properties/2/expected.json index 702392cd15..a52ef1b5b8 100644 --- a/test/fixtures/flow/call-properties/2/expected.json +++ b/test/fixtures/flow/call-properties/2/expected.json @@ -1,109 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [], - "indexers": [], - "callProperties": [ - { - "type": "ObjectTypeCallProperty", - "value": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 14, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "typeParameters": null, - "range": [ - 10, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "range": [ - 10, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], - "range": [ - 8, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 6, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 4, - 23 - ], + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 23, "loc": { "start": { "line": 1, @@ -113,40 +68,138 @@ "line": 1, "column": 23 } - } - }, - "init": null, - "range": [ - 4, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 23 - } + "range": [ + 4, + 23 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 4, + 23 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 6, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 6, + 23 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 8, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 8, + 23 + ], + "callProperties": [ + { + "type": "ObjectTypeCallProperty", + "start": 10, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 10, + 21 + ], + "value": { + "type": "FunctionTypeAnnotation", + "start": 10, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 10, + 20 + ], + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 14, + 20 + ] + } + } + } + ], + "properties": [], + "indexers": [] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/call-properties/3/expected.json b/test/fixtures/flow/call-properties/3/expected.json index 31a7d30636..a10007ce45 100644 --- a/test/fixtures/flow/call-properties/3/expected.json +++ b/test/fixtures/flow/call-properties/3/expected.json @@ -1,270 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "y", - "range": [ - 22, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 25, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "optional": false, - "range": [ - 22, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "indexers": [], - "callProperties": [ - { - "type": "ObjectTypeCallProperty", - "value": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 14, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "typeParameters": null, - "range": [ - 10, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "range": [ - 10, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - { - "type": "ObjectTypeCallProperty", - "value": { - "type": "FunctionTypeAnnotation", - "params": [ - { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "x", - "range": [ - 34, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "range": [ - 37, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - } - }, - "optional": false, - "range": [ - 34, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 43 - } - } - } - ], - "returnType": { - "type": "StringTypeAnnotation", - "range": [ - 46, - 52 - ], - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 52 - } - } - }, - "typeParameters": null, - "range": [ - 33, - 52 - ], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 52 - } - } - }, - "range": [ - 33, - 52 - ], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 52 - } - } - } - ], - "range": [ - 8, - 54 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 54 - } - } - }, - "range": [ - 6, - 54 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 54 - } - } - }, - "range": [ - 4, - 54 - ], + "type": "File", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 0, + 54 + ], + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 0, + 54 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 0, + 54 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 54, "loc": { "start": { "line": 1, @@ -274,40 +68,318 @@ "line": 1, "column": 54 } - } - }, - "init": null, - "range": [ - 4, - 54 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 54 - } + "range": [ + 4, + 54 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 4, + 54 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 6, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 6, + 54 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 8, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 8, + 54 + ], + "callProperties": [ + { + "type": "ObjectTypeCallProperty", + "start": 10, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 10, + 21 + ], + "value": { + "type": "FunctionTypeAnnotation", + "start": 10, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 10, + 20 + ], + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 14, + 20 + ] + } + } + }, + { + "type": "ObjectTypeCallProperty", + "start": 33, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 33, + 52 + ], + "value": { + "type": "FunctionTypeAnnotation", + "start": 33, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 33, + 52 + ], + "params": [ + { + "type": "FunctionTypeParam", + "start": 34, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 34, + 43 + ], + "name": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 34, + 35 + ], + "name": "x" + }, + "optional": false, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 37, + 43 + ] + } + } + ], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "StringTypeAnnotation", + "start": 46, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 46, + 52 + ] + } + } + } + ], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 22, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 22, + 32 + ], + "key": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ], + "name": "y" + }, + "value": { + "type": "StringTypeAnnotation", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 25, + 31 + ] + }, + "optional": false + } + ], + "indexers": [] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 54 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/call-properties/4/expected.json b/test/fixtures/flow/call-properties/4/expected.json index eae762ca89..8483776849 100644 --- a/test/fixtures/flow/call-properties/4/expected.json +++ b/test/fixtures/flow/call-properties/4/expected.json @@ -1,218 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [], - "indexers": [], - "callProperties": [ - { - "type": "ObjectTypeCallProperty", - "value": { - "type": "FunctionTypeAnnotation", - "params": [ - { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "x", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 17, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "typeParameters": null, - "range": [ - 17, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "optional": false, - "range": [ - 14, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 21, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 11, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], - "range": [ - 10, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "range": [ - 10, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "range": [ - 10, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], - "range": [ - 8, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "range": [ - 6, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "range": [ - 4, - 30 - ], + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 30, "loc": { "start": { "line": 1, @@ -222,40 +68,259 @@ "line": 1, "column": 30 } - } - }, - "init": null, - "range": [ - 4, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 30 - } + "range": [ + 4, + 30 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 4, + 30 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 6, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 6, + 30 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 8, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 8, + 30 + ], + "callProperties": [ + { + "type": "ObjectTypeCallProperty", + "start": 10, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 10, + 28 + ], + "value": { + "type": "FunctionTypeAnnotation", + "start": 10, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 10, + 27 + ], + "params": [ + { + "type": "FunctionTypeParam", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 14, + 18 + ], + "name": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "x" + }, + "optional": false, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "name": "T" + } + } + } + ], + "rest": null, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 10, + 13 + ], + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "T" + } + ] + }, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 21, + 27 + ] + } + } + } + ], + "properties": [], + "indexers": [] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/call-properties/5/expected.json b/test/fixtures/flow/call-properties/5/expected.json index 8847c5a107..85f0a7d87e 100644 --- a/test/fixtures/flow/call-properties/5/expected.json +++ b/test/fixtures/flow/call-properties/5/expected.json @@ -1,59 +1,104 @@ { - "type": "Program", - "body": [ - { - "type": "InterfaceDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 10, - 11 - ], + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "module", + "body": [ + { + "type": "InterfaceDeclaration", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, - "column": 10 + "column": 0 }, "end": { "line": 1, - "column": 11 + "column": 27 } - } - }, - "typeParameters": null, - "body": { - "type": "ObjectTypeAnnotation", - "properties": [], - "indexers": [], - "callProperties": [ - { - "type": "ObjectTypeCallProperty", - "value": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 18, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "typeParameters": null, - "range": [ - 14, - 24 - ], + }, + "range": [ + 0, + 27 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "A" + }, + "typeParameters": null, + "extends": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 12, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 12, + 27 + ], + "callProperties": [ + { + "type": "ObjectTypeCallProperty", + "start": 14, + "end": 25, "loc": { "start": { "line": 1, @@ -61,57 +106,61 @@ }, "end": { "line": 1, - "column": 24 + "column": 25 + } + }, + "range": [ + 14, + 25 + ], + "static": false, + "value": { + "type": "FunctionTypeAnnotation", + "start": 14, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 14, + 24 + ], + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 18, + 24 + ] } } - }, - "static": false, - "range": [ - 14, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 25 - } } - } - ], - "range": [ - 12, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "extends": [], - "range": [ - 0, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 + ], + "properties": [], + "indexers": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-module/1/expected.json b/test/fixtures/flow/declare-module/1/expected.json index 7b59008792..c83e3338cf 100644 --- a/test/fixtures/flow/declare-module/1/expected.json +++ b/test/fixtures/flow/declare-module/1/expected.json @@ -1,58 +1,100 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareModule", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 17, - 19 - ], + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 19, "loc": { "start": { "line": 1, - "column": 17 + "column": 0 }, "end": { "line": 1, "column": 19 } - } - }, - "range": [ - 0, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 19 + "range": [ + 0, + 19 + ], + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "A" + }, + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 17, + 19 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-module/2/expected.json b/test/fixtures/flow/declare-module/2/expected.json index 701576809b..e165a24e7b 100644 --- a/test/fixtures/flow/declare-module/2/expected.json +++ b/test/fixtures/flow/declare-module/2/expected.json @@ -1,59 +1,102 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareModule", - "id": { - "type": "Literal", - "value": "./a/b.js", - "raw": "\"./a/b.js\"", - "range": [ - 15, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - } + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 26, - 28 - ], + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 28, "loc": { "start": { "line": 1, - "column": 26 + "column": 0 }, "end": { "line": 1, "column": 28 } - } - }, - "range": [ - 0, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 28 + "range": [ + 0, + 28 + ], + "id": { + "type": "Literal", + "start": 15, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 15, + 25 + ], + "value": "./a/b.js", + "rawValue": "./a/b.js", + "raw": "\"./a/b.js\"" + }, + "body": { + "type": "BlockStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 26, + 28 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-module/3/expected.json b/test/fixtures/flow/declare-module/3/expected.json index 077964afd6..490f0eca8f 100644 --- a/test/fixtures/flow/declare-module/3/expected.json +++ b/test/fixtures/flow/declare-module/3/expected.json @@ -1,128 +1,178 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareModule", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 0, + 43 + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "DeclareVariable", - "id": { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 34, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "range": [ - 32, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "range": [ - 31, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "range": [ - 19, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 41 - } - } - } - ], - "range": [ - 17, - 43 - ], + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 0, + 43 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 43, "loc": { "start": { "line": 1, - "column": 17 + "column": 0 }, "end": { "line": 1, "column": 43 } - } - }, - "range": [ - 0, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 43 + "range": [ + 0, + 43 + ], + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "A" + }, + "body": { + "type": "BlockStatement", + "start": 17, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 17, + 43 + ], + "body": [ + { + "type": "DeclareVariable", + "start": 19, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 19, + 41 + ], + "id": { + "type": "Identifier", + "start": 31, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 31, + 40 + ], + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 32, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 32, + 40 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 34, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 34, + 40 + ] + } + } + } + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-module/4/expected.json b/test/fixtures/flow/declare-module/4/expected.json index 039ba59798..5a11624484 100644 --- a/test/fixtures/flow/declare-module/4/expected.json +++ b/test/fixtures/flow/declare-module/4/expected.json @@ -1,61 +1,139 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareModule", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 15, - 16 - ], + "type": "File", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 0, + 52 + ], + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 0, + 52 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 52, "loc": { "start": { "line": 1, - "column": 15 + "column": 0 }, "end": { "line": 1, - "column": 16 + "column": 52 } - } - }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "DeclareFunction", - "id": { - "type": "Identifier", - "name": "foo", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 43, - 49 - ], - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 49 - } - } + }, + "range": [ + 0, + 52 + ], + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "A" + }, + "body": { + "type": "BlockStatement", + "start": 17, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 17, + 52 + ], + "body": [ + { + "type": "DeclareFunction", + "start": 19, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 19, + 50 + ], + "id": { + "type": "Identifier", + "start": 36, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 36 }, - "typeParameters": null, - "range": [ - 39, - 49 - ], + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 36, + 49 + ], + "name": "foo", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 39, + "end": 49, "loc": { "start": { "line": 1, @@ -65,83 +143,58 @@ "line": 1, "column": 49 } - } - }, - "range": [ - 39, - 49 - ], - "loc": { - "start": { - "line": 1, - "column": 39 }, - "end": { - "line": 1, - "column": 49 + "range": [ + 39, + 49 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 39, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 39, + 49 + ], + "typeParameters": null, + "params": [], + "rest": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 43, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 43, + 49 + ] + } } } - }, - "range": [ - 36, - 49 - ], - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, - "range": [ - 19, - 50 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 50 } } - } - ], - "range": [ - 17, - 52 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 52 - } - } - }, - "range": [ - 0, - 52 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-module/5/expected.json b/test/fixtures/flow/declare-module/5/expected.json index c14914cefd..8053dba193 100644 --- a/test/fixtures/flow/declare-module/5/expected.json +++ b/test/fixtures/flow/declare-module/5/expected.json @@ -1,189 +1,246 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareModule", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } + "type": "File", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "range": [ + 0, + 55 + ], + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "DeclareClass", - "id": { - "type": "Identifier", - "name": "B", - "range": [ - 33, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "typeParameters": null, - "body": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "foo", - "range": [ - 37, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "value": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 44, - 50 - ], - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - "typeParameters": null, - "range": [ - 37, - 50 - ], - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - "optional": false, - "range": [ - 37, - 51 - ], - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 51 - } - } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 35, - 53 - ], - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 53 - } - } - }, - "extends": [], - "range": [ - 19, - 53 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 53 - } - } - } - ], - "range": [ - 17, - 55 - ], + "end": { + "line": 1, + "column": 55 + } + }, + "range": [ + 0, + 55 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 55, "loc": { "start": { "line": 1, - "column": 17 + "column": 0 }, "end": { "line": 1, "column": 55 } - } - }, - "range": [ - 0, - 55 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 55 + "range": [ + 0, + 55 + ], + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "A" + }, + "body": { + "type": "BlockStatement", + "start": 17, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "range": [ + 17, + 55 + ], + "body": [ + { + "type": "DeclareClass", + "start": 19, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 19, + 53 + ], + "id": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 33, + 34 + ], + "name": "B" + }, + "typeParameters": null, + "extends": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 35, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 35, + 53 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 37, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 37, + 51 + ], + "value": { + "type": "FunctionTypeAnnotation", + "start": 37, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 37, + 50 + ], + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 44, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 44, + 50 + ] + } + }, + "key": { + "type": "Identifier", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 37, + 40 + ], + "name": "foo" + }, + "optional": false + } + ], + "indexers": [] + } + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/1/expected.json b/test/fixtures/flow/declare-statements/1/expected.json index 01dbbd1e3d..e30c131e56 100644 --- a/test/fixtures/flow/declare-statements/1/expected.json +++ b/test/fixtures/flow/declare-statements/1/expected.json @@ -1,40 +1,80 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareVariable", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 12, - 15 - ], + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareVariable", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, - "column": 12 + "column": 0 }, "end": { "line": 1, "column": 15 } - } - }, - "range": [ - 0, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 15 + "range": [ + 0, + 15 + ], + "id": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 12, + 15 + ], + "name": "foo" } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/10/expected.json b/test/fixtures/flow/declare-statements/10/expected.json index f3ad353672..b5883ad291 100644 --- a/test/fixtures/flow/declare-statements/10/expected.json +++ b/test/fixtures/flow/declare-statements/10/expected.json @@ -1,75 +1,105 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareClass", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 14, - 15 - ], + "type": "File", + "start": 0, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "range": [ + 0, + 59 + ], + "program": { + "type": "Program", + "start": 0, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "range": [ + 0, + 59 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareClass", + "start": 0, + "end": 59, "loc": { "start": { "line": 1, - "column": 14 + "column": 0 }, "end": { "line": 1, - "column": 15 + "column": 59 } - } - }, - "typeParameters": null, - "body": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "foo", - "range": [ - 25, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - } - } + }, + "range": [ + 0, + 59 + ], + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 }, - "value": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 32, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "typeParameters": null, - "range": [ - 18, - 38 - ], + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "A" + }, + "typeParameters": null, + "extends": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 16, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "range": [ + 16, + 59 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 18, + "end": 39, "loc": { "start": { "line": 1, @@ -77,114 +107,141 @@ }, "end": { "line": 1, - "column": 38 + "column": 39 } - } - }, - "optional": false, - "static": true, - "range": [ - 18, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 18 }, - "end": { - "line": 1, - "column": 39 - } - } - }, - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "x", "range": [ - 47, - 48 + 18, + 39 ], - "loc": { - "start": { - "line": 1, - "column": 47 + "value": { + "type": "FunctionTypeAnnotation", + "start": 18, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 38 + } }, - "end": { - "line": 1, - "column": 48 + "range": [ + 18, + 38 + ], + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 32, + 38 + ] } - } + }, + "static": true, + "key": { + "type": "Identifier", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 25, + 28 + ], + "name": "foo" + }, + "optional": false }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 51, - 57 - ], + { + "type": "ObjectTypeProperty", + "start": 40, + "end": 57, "loc": { "start": { "line": 1, - "column": 51 + "column": 40 }, "end": { "line": 1, "column": 57 } - } - }, - "optional": false, - "static": true, - "range": [ - 40, - 57 - ], - "loc": { - "start": { - "line": 1, - "column": 40 }, - "end": { - "line": 1, - "column": 57 - } + "range": [ + 40, + 57 + ], + "key": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 47, + 48 + ], + "name": "x" + }, + "value": { + "type": "StringTypeAnnotation", + "start": 51, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "range": [ + 51, + 57 + ] + }, + "optional": false, + "static": true } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 16, - 59 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 59 - } - } - }, - "extends": [], - "range": [ - 0, - 59 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 + ], + "indexers": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/11/expected.json b/test/fixtures/flow/declare-statements/11/expected.json index 43ef1837dc..59b89aa16f 100644 --- a/test/fixtures/flow/declare-statements/11/expected.json +++ b/test/fixtures/flow/declare-statements/11/expected.json @@ -1,133 +1,183 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareClass", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } + "type": "File", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 0, + 53 + ], + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "typeParameters": null, - "body": { - "type": "ObjectTypeAnnotation", - "properties": [], - "indexers": [ - { - "type": "ObjectTypeIndexer", - "id": { - "type": "Identifier", - "name": "indexer", - "range": [ - 27, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "key": { - "type": "NumberTypeAnnotation", - "range": [ - 36, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - } - }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 45, - 51 - ], - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 51 - } - } - }, - "static": true, - "range": [ - 18, - 51 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 51 - } - } - } - ], - "callProperties": [], - "range": [ - 16, - 53 - ], + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 0, + 53 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareClass", + "start": 0, + "end": 53, "loc": { "start": { "line": 1, - "column": 16 + "column": 0 }, "end": { "line": 1, "column": 53 } - } - }, - "extends": [], - "range": [ - 0, - 53 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 53 + "range": [ + 0, + 53 + ], + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "A" + }, + "typeParameters": null, + "extends": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 16, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 16, + 53 + ], + "callProperties": [], + "properties": [], + "indexers": [ + { + "type": "ObjectTypeIndexer", + "start": 18, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 18, + 51 + ], + "static": true, + "id": { + "type": "Identifier", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 27, + 34 + ], + "name": "indexer" + }, + "key": { + "type": "NumberTypeAnnotation", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 36, + 42 + ] + }, + "value": { + "type": "StringTypeAnnotation", + "start": 45, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 45, + 51 + ] + } + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/12/expected.json b/test/fixtures/flow/declare-statements/12/expected.json index 40b906ced2..04f75f12a1 100644 --- a/test/fixtures/flow/declare-statements/12/expected.json +++ b/test/fixtures/flow/declare-statements/12/expected.json @@ -1,117 +1,166 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareClass", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "typeParameters": null, - "body": { - "type": "ObjectTypeAnnotation", - "properties": [], - "indexers": [], - "callProperties": [ - { - "type": "ObjectTypeCallProperty", - "value": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 30, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "typeParameters": null, - "range": [ - 25, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "static": true, - "range": [ - 18, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], - "range": [ - 16, - 38 - ], + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareClass", + "start": 0, + "end": 38, "loc": { "start": { "line": 1, - "column": 16 + "column": 0 }, "end": { "line": 1, "column": 38 } - } - }, - "extends": [], - "range": [ - 0, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 38 + "range": [ + 0, + 38 + ], + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "A" + }, + "typeParameters": null, + "extends": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 16, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 16, + 38 + ], + "callProperties": [ + { + "type": "ObjectTypeCallProperty", + "start": 18, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 18, + 36 + ], + "static": true, + "value": { + "type": "FunctionTypeAnnotation", + "start": 25, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 25, + 36 + ], + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 30, + 36 + ] + } + } + } + ], + "properties": [], + "indexers": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/2/expected.json b/test/fixtures/flow/declare-statements/2/expected.json index 6aff5e7f52..baa6d5aca5 100644 --- a/test/fixtures/flow/declare-statements/2/expected.json +++ b/test/fixtures/flow/declare-statements/2/expected.json @@ -1,40 +1,80 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareVariable", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 12, - 15 - ], + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareVariable", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, - "column": 12 + "column": 0 }, "end": { "line": 1, - "column": 15 + "column": 16 } - } - }, - "range": [ - 0, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 16 + "range": [ + 0, + 16 + ], + "id": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 12, + 15 + ], + "name": "foo" } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/3/expected.json b/test/fixtures/flow/declare-statements/3/expected.json index 4b4bdd4010..11ef786df6 100644 --- a/test/fixtures/flow/declare-statements/3/expected.json +++ b/test/fixtures/flow/declare-statements/3/expected.json @@ -1,38 +1,82 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareFunction", - "id": { - "type": "Identifier", - "name": "foo", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "VoidTypeAnnotation", - "range": [ - 24, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 28 - } - } + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareFunction", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "id": { + "type": "Identifier", + "start": 17, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 17 }, - "typeParameters": null, - "range": [ - 20, - 28 - ], + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 17, + 28 + ], + "name": "foo", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 20, + "end": 28, "loc": { "start": { "line": 1, @@ -42,52 +86,55 @@ "line": 1, "column": 28 } - } - }, - "range": [ - 20, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 20 }, - "end": { - "line": 1, - "column": 28 + "range": [ + 20, + 28 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 20, + 28 + ], + "typeParameters": null, + "params": [], + "rest": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 24, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 24, + 28 + ] + } } } - }, - "range": [ - 17, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "range": [ - 0, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/4/expected.json b/test/fixtures/flow/declare-statements/4/expected.json index 46ac7ac4af..a7f204c966 100644 --- a/test/fixtures/flow/declare-statements/4/expected.json +++ b/test/fixtures/flow/declare-statements/4/expected.json @@ -1,38 +1,82 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareFunction", - "id": { - "type": "Identifier", - "name": "foo", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "VoidTypeAnnotation", - "range": [ - 24, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 28 - } - } + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareFunction", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "id": { + "type": "Identifier", + "start": 17, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 17 }, - "typeParameters": null, - "range": [ - 20, - 28 - ], + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 17, + 28 + ], + "name": "foo", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 20, + "end": 28, "loc": { "start": { "line": 1, @@ -42,52 +86,55 @@ "line": 1, "column": 28 } - } - }, - "range": [ - 20, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 20 }, - "end": { - "line": 1, - "column": 28 + "range": [ + 20, + 28 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 20, + 28 + ], + "typeParameters": null, + "params": [], + "rest": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 24, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 24, + 28 + ] + } } } - }, - "range": [ - 17, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "range": [ - 0, - 29 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/5/expected.json b/test/fixtures/flow/declare-statements/5/expected.json index a2727fe7ef..ce61c208d4 100644 --- a/test/fixtures/flow/declare-statements/5/expected.json +++ b/test/fixtures/flow/declare-statements/5/expected.json @@ -1,74 +1,82 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareFunction", - "id": { - "type": "Identifier", - "name": "foo", - "typeAnnotation": { - "type": "TypeAnnotation", + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 0, + 32 + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 0, + 32 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareFunction", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 0, + 32 + ], + "id": { + "type": "Identifier", + "start": 17, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 17, + 31 + ], + "name": "foo", "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "VoidTypeAnnotation", - "range": [ - 27, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 21, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], - "range": [ - 20, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 20, - 31 - ], + "type": "TypeAnnotation", + "start": 20, + "end": 31, "loc": { "start": { "line": 1, @@ -78,52 +86,95 @@ "line": 1, "column": 31 } - } - }, - "range": [ - 20, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 20 }, - "end": { - "line": 1, - "column": 31 + "range": [ + 20, + 31 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 20, + 31 + ], + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 20, + 23 + ], + "params": [ + { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "name": "T" + } + ] + }, + "params": [], + "rest": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 27, + 31 + ] + } } } - }, - "range": [ - 17, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "range": [ - 0, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/6/expected.json b/test/fixtures/flow/declare-statements/6/expected.json index 0c71a8075b..e7de9c8dae 100644 --- a/test/fixtures/flow/declare-statements/6/expected.json +++ b/test/fixtures/flow/declare-statements/6/expected.json @@ -1,145 +1,82 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareFunction", - "id": { - "type": "Identifier", - "name": "foo", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [ - { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "x", - "range": [ - 21, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 24, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "optional": false, - "range": [ - 21, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "y", - "range": [ - 32, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "range": [ - 35, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "optional": false, - "range": [ - 32, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 41 - } - } - } - ], - "returnType": { - "type": "VoidTypeAnnotation", - "range": [ - 44, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 48 - } - } + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 0, + 49 + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 0, + 49 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareFunction", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 0, + 49 + ], + "id": { + "type": "Identifier", + "start": 17, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 17 }, - "typeParameters": null, - "range": [ - 20, - 48 - ], + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 17, + 48 + ], + "name": "foo", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 20, + "end": 48, "loc": { "start": { "line": 1, @@ -149,52 +86,174 @@ "line": 1, "column": 48 } - } - }, - "range": [ - 20, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 20 }, - "end": { - "line": 1, - "column": 48 + "range": [ + 20, + 48 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 20, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 20, + 48 + ], + "typeParameters": null, + "params": [ + { + "type": "FunctionTypeParam", + "start": 21, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 21, + 30 + ], + "name": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "name": "x" + }, + "optional": false, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 24, + 30 + ] + } + }, + { + "type": "FunctionTypeParam", + "start": 32, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 32, + 41 + ], + "name": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 32, + 33 + ], + "name": "y" + }, + "optional": false, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 35, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 35, + 41 + ] + } + } + ], + "rest": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 44, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 44, + 48 + ] + } } } - }, - "range": [ - 17, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 48 - } - } - }, - "range": [ - 0, - 49 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/7/expected.json b/test/fixtures/flow/declare-statements/7/expected.json index 6143aad05c..0d4996578e 100644 --- a/test/fixtures/flow/declare-statements/7/expected.json +++ b/test/fixtures/flow/declare-statements/7/expected.json @@ -1,94 +1,326 @@ { - "type": "Program", - "body": [ - { - "start": 0, - "id": { - "start": 14, - "name": "IViewFactory", - "type": "Identifier", - "end": 26 - }, - "typeParameters": null, - "extends": [], - "body": { - "start": 27, - "callProperties": [], - "properties": [ - { - "start": 29, - "value": { - "start": 29, - "params": [ - { - "start": 40, - "name": { - "start": 40, - "name": "view", - "type": "Identifier", - "end": 44 - }, - "optional": false, - "typeAnnotation": { - "start": 45, - "typeParameters": null, - "id": { - "start": 45, - "name": "Object", - "type": "Identifier", - "end": 51 - }, - "type": "GenericTypeAnnotation", - "end": 51 - }, - "type": "FunctionTypeParam", - "end": 51 - }, - { - "start": 53, - "name": { - "start": 53, - "name": "prop", - "type": "Identifier", - "end": 57 - }, - "optional": false, - "typeAnnotation": { - "start": 58, - "type": "StringTypeAnnotation", - "end": 64 - }, - "type": "FunctionTypeParam", - "end": 64 - } - ], - "rest": null, - "typeParameters": null, - "returnType": { - "start": 67, - "type": "VoidTypeAnnotation", - "end": 71 - }, - "type": "FunctionTypeAnnotation", - "end": 71 - }, - "key": { - "start": 29, - "name": "didAnimate", - "type": "Identifier", - "end": 39 - }, - "optional": false, - "type": "ObjectTypeProperty", - "end": 72 - } - ], - "indexers": [], - "type": "ObjectTypeAnnotation", - "end": 74 - }, - "type": "DeclareClass", - "end": 74 + "type": "File", + "start": 0, + "end": 74, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 74 } - ] + }, + "range": [ + 0, + 74 + ], + "program": { + "type": "Program", + "start": 0, + "end": 74, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 74 + } + }, + "range": [ + 0, + 74 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareClass", + "start": 0, + "end": 74, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 74 + } + }, + "range": [ + 0, + 74 + ], + "id": { + "type": "Identifier", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 14, + 26 + ], + "name": "IViewFactory" + }, + "typeParameters": null, + "extends": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 27, + "end": 74, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 74 + } + }, + "range": [ + 27, + 74 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 29, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 72 + } + }, + "range": [ + 29, + 72 + ], + "value": { + "type": "FunctionTypeAnnotation", + "start": 29, + "end": 71, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 71 + } + }, + "range": [ + 29, + 71 + ], + "params": [ + { + "type": "FunctionTypeParam", + "start": 40, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 40, + 51 + ], + "name": { + "type": "Identifier", + "start": 40, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "range": [ + 40, + 44 + ], + "name": "view" + }, + "optional": false, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 45, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 45, + 51 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 45, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 45, + 51 + ], + "name": "Object" + } + } + }, + { + "type": "FunctionTypeParam", + "start": 53, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "range": [ + 53, + 64 + ], + "name": { + "type": "Identifier", + "start": 53, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "range": [ + 53, + 57 + ], + "name": "prop" + }, + "optional": false, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 58, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 58 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "range": [ + 58, + 64 + ] + } + } + ], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 67, + "end": 71, + "loc": { + "start": { + "line": 1, + "column": 67 + }, + "end": { + "line": 1, + "column": 71 + } + }, + "range": [ + 67, + 71 + ] + } + }, + "key": { + "type": "Identifier", + "start": 29, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 29, + 39 + ], + "name": "didAnimate" + }, + "optional": false + } + ], + "indexers": [] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/8/expected.json b/test/fixtures/flow/declare-statements/8/expected.json index 10d7be1337..38971e4232 100644 --- a/test/fixtures/flow/declare-statements/8/expected.json +++ b/test/fixtures/flow/declare-statements/8/expected.json @@ -1,62 +1,104 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareClass", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "typeParameters": null, - "body": { - "type": "ObjectTypeAnnotation", - "properties": [], - "indexers": [], - "callProperties": [], - "range": [ - 16, - 18 - ], + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareClass", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, - "column": 16 + "column": 0 }, "end": { "line": 1, "column": 18 } - } - }, - "extends": [], - "range": [ - 0, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 18 + "range": [ + 0, + 18 + ], + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "A" + }, + "typeParameters": null, + "extends": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 16, + 18 + ], + "callProperties": [], + "properties": [], + "indexers": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/9/expected.json b/test/fixtures/flow/declare-statements/9/expected.json index 2d69dfb641..866fa54fe4 100644 --- a/test/fixtures/flow/declare-statements/9/expected.json +++ b/test/fixtures/flow/declare-statements/9/expected.json @@ -1,147 +1,125 @@ { - "type": "Program", - "body": [ - { - "type": "DeclareClass", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } + "type": "File", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 0, + 45 + ], + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 16, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "range": [ - 15, - 18 - ], + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 0, + 45 + ], + "sourceType": "module", + "body": [ + { + "type": "DeclareClass", + "start": 0, + "end": 45, "loc": { "start": { "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "body": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "x", - "range": [ - 34, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "value": { - "type": "NumberTypeAnnotation", - "range": [ - 37, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - } - }, - "optional": false, - "range": [ - 34, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 43 - } - } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 32, - 45 - ], - "loc": { - "start": { - "line": 1, - "column": 32 + "column": 0 }, "end": { "line": 1, "column": 45 } - } - }, - "extends": [ - { - "type": "InterfaceExtends", - "id": { - "type": "Identifier", - "name": "B", - "range": [ - 27, - 28 - ], + }, + "range": [ + 0, + 45 + ], + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "A" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 15, + 18 + ], + "params": [ + { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "T" + } + ] + }, + "extends": [ + { + "type": "InterfaceExtends", + "start": 27, + "end": 31, "loc": { "start": { "line": 1, @@ -149,22 +127,56 @@ }, "end": { "line": 1, - "column": 28 + "column": 31 } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 29, - 30 - ], + }, + "range": [ + 27, + 31 + ], + "id": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 27, + 28 + ], + "name": "B" + }, + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 28, + 31 + ], + "params": [ + { + "type": "GenericTypeAnnotation", + "start": 29, + "end": 30, "loc": { "start": { "line": 1, @@ -174,70 +186,120 @@ "line": 1, "column": 30 } - } - }, - "typeParameters": null, - "range": [ - 29, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 29 }, - "end": { - "line": 1, - "column": 30 + "range": [ + 29, + 30 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 29, + 30 + ], + "name": "T" } } - } - ], - "range": [ - 28, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - } + ] } - }, - "range": [ - 27, - 31 - ], + } + ], + "body": { + "type": "ObjectTypeAnnotation", + "start": 32, + "end": 45, "loc": { "start": { "line": 1, - "column": 27 + "column": 32 }, "end": { "line": 1, - "column": 31 + "column": 45 } - } - } - ], - "range": [ - 0, - 45 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 45 + }, + "range": [ + 32, + 45 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 34, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 34, + 43 + ], + "key": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 34, + 35 + ], + "name": "x" + }, + "value": { + "type": "NumberTypeAnnotation", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 37, + 43 + ] + }, + "optional": false + } + ], + "indexers": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/1/expected.json b/test/fixtures/flow/interfaces-module-and-script/1/expected.json index 8efc598c45..4ceacd93fe 100644 --- a/test/fixtures/flow/interfaces-module-and-script/1/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/1/expected.json @@ -1,62 +1,104 @@ { - "type": "Program", - "body": [ - { - "type": "InterfaceDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 10, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "typeParameters": null, - "body": { - "type": "ObjectTypeAnnotation", - "properties": [], - "indexers": [], - "callProperties": [], - "range": [ - 12, - 14 - ], + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "sourceType": "module", + "body": [ + { + "type": "InterfaceDeclaration", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, - "column": 12 + "column": 0 }, "end": { "line": 1, "column": 14 } - } - }, - "extends": [], - "range": [ - 0, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 14 + "range": [ + 0, + 14 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "A" + }, + "typeParameters": null, + "extends": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 12, + 14 + ], + "callProperties": [], + "properties": [], + "indexers": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/2/expected.json b/test/fixtures/flow/interfaces-module-and-script/2/expected.json index 8f1c9d1e02..1b03db804e 100644 --- a/test/fixtures/flow/interfaces-module-and-script/2/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/2/expected.json @@ -1,57 +1,85 @@ { - "type": "Program", - "body": [ - { - "type": "InterfaceDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 10, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "typeParameters": null, - "body": { - "type": "ObjectTypeAnnotation", - "properties": [], - "indexers": [], - "callProperties": [], - "range": [ - 22, - 24 - ], + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "sourceType": "module", + "body": [ + { + "type": "InterfaceDeclaration", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, - "column": 22 + "column": 0 }, "end": { "line": 1, "column": 24 } - } - }, - "extends": [ - { - "type": "InterfaceExtends", - "id": { - "type": "Identifier", - "name": "B", - "range": [ - 20, - 21 - ], + }, + "range": [ + 0, + 24 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "A" + }, + "typeParameters": null, + "extends": [ + { + "type": "InterfaceExtends", + "start": 20, + "end": 21, "loc": { "start": { "line": 1, @@ -61,39 +89,57 @@ "line": 1, "column": 21 } - } - }, - "typeParameters": null, - "range": [ - 20, - 21 - ], + }, + "range": [ + 20, + 21 + ], + "id": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 20, + 21 + ], + "name": "B" + }, + "typeParameters": null + } + ], + "body": { + "type": "ObjectTypeAnnotation", + "start": 22, + "end": 24, "loc": { "start": { "line": 1, - "column": 20 + "column": 22 }, "end": { "line": 1, - "column": 21 + "column": 24 } - } - } - ], - "range": [ - 0, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 + }, + "range": [ + 22, + 24 + ], + "callProperties": [], + "properties": [], + "indexers": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/3/expected.json b/test/fixtures/flow/interfaces-module-and-script/3/expected.json index fab3ac9acb..acd086e377 100644 --- a/test/fixtures/flow/interfaces-module-and-script/3/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/3/expected.json @@ -1,93 +1,125 @@ { - "type": "Program", - "body": [ - { - "type": "InterfaceDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 10, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 12, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], - "range": [ - 11, - 14 - ], + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "sourceType": "module", + "body": [ + { + "type": "InterfaceDeclaration", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "body": { - "type": "ObjectTypeAnnotation", - "properties": [], - "indexers": [], - "callProperties": [], - "range": [ - 34, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 34 + "column": 0 }, "end": { "line": 1, "column": 36 } - } - }, - "extends": [ - { - "type": "InterfaceExtends", - "id": { - "type": "Identifier", - "name": "B", - "range": [ - 23, - 24 - ], + }, + "range": [ + 0, + 36 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "A" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 11, + 14 + ], + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "T" + } + ] + }, + "extends": [ + { + "type": "InterfaceExtends", + "start": 23, + "end": 27, "loc": { "start": { "line": 1, @@ -95,22 +127,56 @@ }, "end": { "line": 1, - "column": 24 + "column": 27 } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 25, - 26 - ], + }, + "range": [ + 23, + 27 + ], + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 23, + 24 + ], + "name": "B" + }, + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 24, + 27 + ], + "params": [ + { + "type": "GenericTypeAnnotation", + "start": 25, + "end": 26, "loc": { "start": { "line": 1, @@ -120,64 +186,40 @@ "line": 1, "column": 26 } - } - }, - "typeParameters": null, - "range": [ - 25, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 25 }, - "end": { - "line": 1, - "column": 26 + "range": [ + 25, + 26 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 25, + 26 + ], + "name": "T" } } - } - ], - "range": [ - 24, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } + ] } }, - "range": [ - 23, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - { - "type": "InterfaceExtends", - "id": { - "type": "Identifier", - "name": "C", - "range": [ - 29, - 30 - ], + { + "type": "InterfaceExtends", + "start": 29, + "end": 33, "loc": { "start": { "line": 1, @@ -185,22 +227,56 @@ }, "end": { "line": 1, - "column": 30 + "column": 33 } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 31, - 32 - ], + }, + "range": [ + 29, + 33 + ], + "id": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 29, + 30 + ], + "name": "C" + }, + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 30, + 33 + ], + "params": [ + { + "type": "GenericTypeAnnotation", + "start": 31, + "end": 32, "loc": { "start": { "line": 1, @@ -210,70 +286,60 @@ "line": 1, "column": 32 } - } - }, - "typeParameters": null, - "range": [ - 31, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 31 }, - "end": { - "line": 1, - "column": 32 + "range": [ + 31, + 32 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 31, + 32 + ], + "name": "T" } } - } - ], - "range": [ - 30, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - } + ] } - }, - "range": [ - 29, - 33 - ], + } + ], + "body": { + "type": "ObjectTypeAnnotation", + "start": 34, + "end": 36, "loc": { "start": { "line": 1, - "column": 29 + "column": 34 }, "end": { "line": 1, - "column": 33 + "column": 36 } - } - } - ], - "range": [ - 0, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 + }, + "range": [ + 34, + 36 + ], + "callProperties": [], + "properties": [], + "indexers": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/4/expected.json b/test/fixtures/flow/interfaces-module-and-script/4/expected.json index cc21f303a5..10b189614c 100644 --- a/test/fixtures/flow/interfaces-module-and-script/4/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/4/expected.json @@ -1,39 +1,105 @@ { - "type": "Program", - "body": [ - { - "type": "InterfaceDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 10, - 11 - ], + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "sourceType": "module", + "body": [ + { + "type": "InterfaceDeclaration", + "start": 0, + "end": 34, "loc": { "start": { "line": 1, - "column": 10 + "column": 0 }, "end": { "line": 1, - "column": 11 + "column": 34 } - } - }, - "typeParameters": null, - "body": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "foo", - "range": [ - 14, - 17 - ], + }, + "range": [ + 0, + 34 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "A" + }, + "typeParameters": null, + "extends": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 12, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 12, + 34 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 14, + "end": 32, "loc": { "start": { "line": 1, @@ -41,95 +107,80 @@ }, "end": { "line": 1, - "column": 17 + "column": 32 } - } - }, - "value": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 25, - 31 - ], + }, + "range": [ + 14, + 32 + ], + "key": { + "type": "Identifier", + "start": 14, + "end": 17, "loc": { "start": { "line": 1, - "column": 25 + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 14, + 17 + ], + "name": "foo" + }, + "value": { + "type": "FunctionTypeAnnotation", + "start": 19, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 19 }, "end": { "line": 1, "column": 31 } - } - }, - "typeParameters": null, - "range": [ - 19, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 19 }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "optional": false, - "range": [ - 14, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 14 + "range": [ + 19, + 31 + ], + "params": [], + "rest": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 25, + 31 + ] + }, + "typeParameters": null }, - "end": { - "line": 1, - "column": 32 - } + "optional": false } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 12, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "extends": [], - "range": [ - 0, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 + ], + "indexers": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/5/expected.json b/test/fixtures/flow/interfaces-module-and-script/5/expected.json index a63f354053..20f66b57c4 100644 --- a/test/fixtures/flow/interfaces-module-and-script/5/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/5/expected.json @@ -1,39 +1,105 @@ { - "type": "Program", - "body": [ - { - "type": "InterfaceDeclaration", - "id": { - "type": "Identifier", - "name": "Dictionary", - "range": [ - 10, - 20 - ], + "type": "File", + "start": 0, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "range": [ + 0, + 65 + ], + "program": { + "type": "Program", + "start": 0, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "range": [ + 0, + 65 + ], + "sourceType": "module", + "body": [ + { + "type": "InterfaceDeclaration", + "start": 0, + "end": 65, "loc": { "start": { "line": 1, - "column": 10 + "column": 0 }, "end": { "line": 1, - "column": 20 + "column": 65 } - } - }, - "typeParameters": null, - "body": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "length", - "range": [ - 48, - 54 - ], + }, + "range": [ + 0, + 65 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 10, + 20 + ], + "name": "Dictionary" + }, + "typeParameters": null, + "extends": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 21, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "range": [ + 21, + 65 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 48, + "end": 63, "loc": { "start": { "line": 1, @@ -41,146 +107,136 @@ }, "end": { "line": 1, - "column": 54 + "column": 63 } - } - }, - "value": { - "type": "NumberTypeAnnotation", + }, "range": [ - 56, - 62 + 48, + 63 ], + "key": { + "type": "Identifier", + "start": 48, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 48, + 54 + ], + "name": "length" + }, + "value": { + "type": "NumberTypeAnnotation", + "start": 56, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 56 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "range": [ + 56, + 62 + ] + }, + "optional": false + } + ], + "indexers": [ + { + "type": "ObjectTypeIndexer", + "start": 23, + "end": 47, "loc": { "start": { "line": 1, - "column": 56 + "column": 23 }, "end": { "line": 1, - "column": 62 + "column": 47 } - } - }, - "optional": false, - "range": [ - 48, - 63 - ], - "loc": { - "start": { - "line": 1, - "column": 48 }, - "end": { - "line": 1, - "column": 63 + "range": [ + 23, + 47 + ], + "id": { + "type": "Identifier", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 24, + 29 + ], + "name": "index" + }, + "key": { + "type": "StringTypeAnnotation", + "start": 31, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 31, + 37 + ] + }, + "value": { + "type": "StringTypeAnnotation", + "start": 40, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "range": [ + 40, + 46 + ] } } - } - ], - "indexers": [ - { - "type": "ObjectTypeIndexer", - "id": { - "type": "Identifier", - "name": "index", - "range": [ - 24, - 29 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "key": { - "type": "StringTypeAnnotation", - "range": [ - 31, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 40, - 46 - ], - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 46 - } - } - }, - "range": [ - 23, - 47 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 47 - } - } - } - ], - "callProperties": [], - "range": [ - 21, - 65 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 65 - } - } - }, - "extends": [], - "range": [ - 0, - 65 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 65 + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/6/expected.json b/test/fixtures/flow/interfaces-module-and-script/6/expected.json index adfa0ef188..91be171773 100644 --- a/test/fixtures/flow/interfaces-module-and-script/6/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/6/expected.json @@ -1,55 +1,85 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 6, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [], - "range": [ - 25, - 27 - ], + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, - "column": 25 + "column": 0 }, "end": { "line": 1, "column": 27 } - } - }, - "implements": [ - { - "type": "ClassImplements", - "id": { - "type": "Identifier", - "name": "Bar", - "range": [ - 21, - 24 - ], + }, + "range": [ + 0, + 27 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "name": "Foo" + }, + "superClass": null, + "implements": [ + { + "type": "ClassImplements", + "start": 21, + "end": 24, "loc": { "start": { "line": 1, @@ -59,39 +89,55 @@ "line": 1, "column": 24 } - } - }, - "typeParameters": null, - "range": [ - 21, - 24 - ], + }, + "range": [ + 21, + 24 + ], + "id": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 21, + 24 + ], + "name": "Bar" + }, + "typeParameters": null + } + ], + "body": { + "type": "ClassBody", + "start": 25, + "end": 27, "loc": { "start": { "line": 1, - "column": 21 + "column": 25 }, "end": { "line": 1, - "column": 24 + "column": 27 } - } - } - ], - "range": [ - 0, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 + }, + "range": [ + 25, + 27 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/7/expected.json b/test/fixtures/flow/interfaces-module-and-script/7/expected.json index 880fa74837..c8d915dd47 100644 --- a/test/fixtures/flow/interfaces-module-and-script/7/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/7/expected.json @@ -1,72 +1,104 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 6, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } + "type": "File", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 0, + 52 + ], + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "superClass": { - "type": "Identifier", - "name": "Bar", - "range": [ - 18, - 21 - ], + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 0, + 52 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 52, "loc": { "start": { "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "body": { - "type": "ClassBody", - "body": [], - "range": [ - 50, - 52 - ], - "loc": { - "start": { - "line": 1, - "column": 50 + "column": 0 }, "end": { "line": 1, "column": 52 } - } - }, - "implements": [ - { - "type": "ClassImplements", - "id": { - "type": "Identifier", - "name": "Bat", - "range": [ - 33, - 36 - ], + }, + "range": [ + 0, + 52 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "name": "Foo" + }, + "superClass": { + "type": "Identifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 18, + 21 + ], + "name": "Bar" + }, + "implements": [ + { + "type": "ClassImplements", + "start": 33, + "end": 36, "loc": { "start": { "line": 1, @@ -76,110 +108,134 @@ "line": 1, "column": 36 } - } - }, - "typeParameters": null, - "range": [ - 33, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 33 }, - "end": { - "line": 1, - "column": 36 - } - } - }, - { - "type": "ClassImplements", - "id": { - "type": "Identifier", - "name": "Man", "range": [ - 38, - 41 + 33, + 36 ], + "id": { + "type": "Identifier", + "start": 33, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 33, + 36 + ], + "name": "Bat" + }, + "typeParameters": null + }, + { + "type": "ClassImplements", + "start": 38, + "end": 49, "loc": { "start": { "line": 1, "column": 38 }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "NumberTypeAnnotation", - "range": [ - 42, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 48 - } - } - } - ], - "range": [ - 41, - 49 - ], - "loc": { - "start": { - "line": 1, - "column": 41 - }, "end": { "line": 1, "column": 49 } + }, + "range": [ + 38, + 49 + ], + "id": { + "type": "Identifier", + "start": 38, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 38, + 41 + ], + "name": "Man" + }, + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 41, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 41, + 49 + ], + "params": [ + { + "type": "NumberTypeAnnotation", + "start": 42, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 42, + 48 + ] + } + ] } - }, - "range": [ - 38, - 49 - ], + } + ], + "body": { + "type": "ClassBody", + "start": 50, + "end": 52, "loc": { "start": { "line": 1, - "column": 38 + "column": 50 }, "end": { "line": 1, - "column": 49 + "column": 52 } - } - } - ], - "range": [ - 0, - 52 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 + }, + "range": [ + 50, + 52 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/8/expected.json b/test/fixtures/flow/interfaces-module-and-script/8/expected.json index 37883bf5a0..9a8e2c12fd 100644 --- a/test/fixtures/flow/interfaces-module-and-script/8/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/8/expected.json @@ -1,75 +1,123 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 6, - 9 - ], + "type": "File", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 0, + 48 + ], + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 0, + 48 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 48, "loc": { "start": { "line": 1, - "column": 6 + "column": 0 }, "end": { "line": 1, - "column": 9 + "column": 48 } - } - }, - "superClass": { - "type": "ClassExpression", + }, + "range": [ + 0, + 48 + ], "id": { "type": "Identifier", - "name": "Bar", - "range": [ - 24, - 27 - ], + "start": 6, + "end": 9, "loc": { "start": { "line": 1, - "column": 24 + "column": 6 }, "end": { "line": 1, - "column": 27 + "column": 9 } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [], + }, "range": [ - 43, - 45 + 6, + 9 ], + "name": "Foo" + }, + "superClass": { + "type": "ClassExpression", + "start": 18, + "end": 45, "loc": { "start": { "line": 1, - "column": 43 + "column": 18 }, "end": { "line": 1, "column": 45 } - } - }, - "implements": [ - { - "type": "ClassImplements", - "id": { - "type": "Identifier", - "name": "Bat", - "range": [ - 39, - 42 - ], + }, + "range": [ + 18, + 45 + ], + "id": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 24, + 27 + ], + "name": "Bar" + }, + "superClass": null, + "implements": [ + { + "type": "ClassImplements", + "start": 39, + "end": 42, "loc": { "start": { "line": 1, @@ -79,72 +127,76 @@ "line": 1, "column": 42 } - } - }, - "typeParameters": null, - "range": [ - 39, - 42 - ], + }, + "range": [ + 39, + 42 + ], + "id": { + "type": "Identifier", + "start": 39, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 39, + 42 + ], + "name": "Bat" + }, + "typeParameters": null + } + ], + "body": { + "type": "ClassBody", + "start": 43, + "end": 45, "loc": { "start": { "line": 1, - "column": 39 + "column": 43 }, "end": { "line": 1, - "column": 42 + "column": 45 } - } + }, + "range": [ + 43, + 45 + ], + "body": [] } - ], - "range": [ - 18, - 45 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 45 - } - } - }, - "body": { - "type": "ClassBody", - "body": [], - "range": [ - 46, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 48 - } - } - }, - "range": [ - 0, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 48 + "body": { + "type": "ClassBody", + "start": 46, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 46, + 48 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/9/expected.json b/test/fixtures/flow/interfaces-module-and-script/9/expected.json index 802a390808..203a063005 100644 --- a/test/fixtures/flow/interfaces-module-and-script/9/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/9/expected.json @@ -1,75 +1,123 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 6, - 9 - ], + "type": "File", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "range": [ + 0, + 63 + ], + "program": { + "type": "Program", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "range": [ + 0, + 63 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 63, "loc": { "start": { "line": 1, - "column": 6 + "column": 0 }, "end": { "line": 1, - "column": 9 + "column": 63 } - } - }, - "superClass": { - "type": "ClassExpression", + }, + "range": [ + 0, + 63 + ], "id": { "type": "Identifier", - "name": "Bar", - "range": [ - 24, - 27 - ], + "start": 6, + "end": 9, "loc": { "start": { "line": 1, - "column": 24 + "column": 6 }, "end": { "line": 1, - "column": 27 + "column": 9 } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [], + }, "range": [ - 43, - 45 + 6, + 9 ], + "name": "Foo" + }, + "superClass": { + "type": "ClassExpression", + "start": 18, + "end": 45, "loc": { "start": { "line": 1, - "column": 43 + "column": 18 }, "end": { "line": 1, "column": 45 } - } - }, - "implements": [ - { - "type": "ClassImplements", - "id": { - "type": "Identifier", - "name": "Bat", - "range": [ - 39, - 42 - ], + }, + "range": [ + 18, + 45 + ], + "id": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 24, + 27 + ], + "name": "Bar" + }, + "superClass": null, + "implements": [ + { + "type": "ClassImplements", + "start": 39, + "end": 42, "loc": { "start": { "line": 1, @@ -79,68 +127,60 @@ "line": 1, "column": 42 } - } - }, - "typeParameters": null, - "range": [ - 39, - 42 - ], + }, + "range": [ + 39, + 42 + ], + "id": { + "type": "Identifier", + "start": 39, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 39, + 42 + ], + "name": "Bat" + }, + "typeParameters": null + } + ], + "body": { + "type": "ClassBody", + "start": 43, + "end": 45, "loc": { "start": { "line": 1, - "column": 39 + "column": 43 }, "end": { "line": 1, - "column": 42 + "column": 45 } - } - } - ], - "range": [ - 18, - 45 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 45 - } - } - }, - "body": { - "type": "ClassBody", - "body": [], - "range": [ - 61, - 63 - ], - "loc": { - "start": { - "line": 1, - "column": 61 - }, - "end": { - "line": 1, - "column": 63 - } - } - }, - "implements": [ - { - "type": "ClassImplements", - "id": { - "type": "Identifier", - "name": "Man", + }, "range": [ - 57, - 60 + 43, + 45 ], + "body": [] + } + }, + "implements": [ + { + "type": "ClassImplements", + "start": 57, + "end": 60, "loc": { "start": { "line": 1, @@ -150,39 +190,55 @@ "line": 1, "column": 60 } - } - }, - "typeParameters": null, - "range": [ - 57, - 60 - ], + }, + "range": [ + 57, + 60 + ], + "id": { + "type": "Identifier", + "start": 57, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 57 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "range": [ + 57, + 60 + ], + "name": "Man" + }, + "typeParameters": null + } + ], + "body": { + "type": "ClassBody", + "start": 61, + "end": 63, "loc": { "start": { "line": 1, - "column": 57 + "column": 61 }, "end": { "line": 1, - "column": 60 + "column": 63 } - } - } - ], - "range": [ - 0, - 63 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 + }, + "range": [ + 61, + 63 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/number-literal-types/1/expected.json b/test/fixtures/flow/number-literal-types/1/expected.json index ffda0c6fe8..30aacf2c94 100644 --- a/test/fixtures/flow/number-literal-types/1/expected.json +++ b/test/fixtures/flow/number-literal-types/1/expected.json @@ -1,83 +1,144 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberLiteralTypeAnnotation", - "value": 123, - "raw": "123", - "range": [ - 7, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - } + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 0, + 10 + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 0, + 10 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 0, + 10 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 }, - "range": [ - 5, - 10 - ], + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 4, + 10 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 10, "loc": { "start": { "line": 1, - "column": 5 + "column": 4 }, "end": { "line": 1, "column": 10 } + }, + "range": [ + 4, + 10 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 5, + 10 + ], + "typeAnnotation": { + "type": "NumberLiteralTypeAnnotation", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 7, + 10 + ], + "value": 123, + "rawValue": 123, + "raw": "123" + } } - } - }, - "init": null, - "range": [ - 4, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 10 - } + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/number-literal-types/2/expected.json b/test/fixtures/flow/number-literal-types/2/expected.json index bc263918cb..c26dce9cb8 100644 --- a/test/fixtures/flow/number-literal-types/2/expected.json +++ b/test/fixtures/flow/number-literal-types/2/expected.json @@ -1,83 +1,144 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberLiteralTypeAnnotation", - "value": 123, - "raw": "123.0", - "range": [ - 7, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 }, - "range": [ - 5, - 12 - ], + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 4, + 12 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 12, "loc": { "start": { "line": 1, - "column": 5 + "column": 4 }, "end": { "line": 1, "column": 12 } + }, + "range": [ + 4, + 12 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 5, + 12 + ], + "typeAnnotation": { + "type": "NumberLiteralTypeAnnotation", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 7, + 12 + ], + "value": 123, + "rawValue": 123, + "raw": "123.0" + } } - } - }, - "init": null, - "range": [ - 4, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 12 - } + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/number-literal-types/3/expected.json b/test/fixtures/flow/number-literal-types/3/expected.json index 1a1af16b90..b23cfb0fe4 100644 --- a/test/fixtures/flow/number-literal-types/3/expected.json +++ b/test/fixtures/flow/number-literal-types/3/expected.json @@ -1,83 +1,144 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberLiteralTypeAnnotation", - "value": 123, - "raw": "0x7B", - "range": [ - 7, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - } + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 }, - "range": [ - 5, - 11 - ], + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 4, + 11 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 11, "loc": { "start": { "line": 1, - "column": 5 + "column": 4 }, "end": { "line": 1, "column": 11 } + }, + "range": [ + 4, + 11 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 5, + 11 + ], + "typeAnnotation": { + "type": "NumberLiteralTypeAnnotation", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 7, + 11 + ], + "value": 123, + "rawValue": 123, + "raw": "0x7B" + } } - } - }, - "init": null, - "range": [ - 4, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 11 - } + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/number-literal-types/4/expected.json b/test/fixtures/flow/number-literal-types/4/expected.json index 6f8bc41fd7..81303eaa96 100644 --- a/test/fixtures/flow/number-literal-types/4/expected.json +++ b/test/fixtures/flow/number-literal-types/4/expected.json @@ -1,83 +1,144 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberLiteralTypeAnnotation", - "value": 123, - "raw": "0b1111011", - "range": [ - 7, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - } + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 }, - "range": [ - 5, - 16 - ], + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 4, + 16 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 16, "loc": { "start": { "line": 1, - "column": 5 + "column": 4 }, "end": { "line": 1, "column": 16 } + }, + "range": [ + 4, + 16 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 5, + 16 + ], + "typeAnnotation": { + "type": "NumberLiteralTypeAnnotation", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 7, + 16 + ], + "value": 123, + "rawValue": 123, + "raw": "0b1111011" + } } - } - }, - "init": null, - "range": [ - 4, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 16 - } + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/number-literal-types/5/expected.json b/test/fixtures/flow/number-literal-types/5/expected.json index 19d5a85ea5..2e2d609b3f 100644 --- a/test/fixtures/flow/number-literal-types/5/expected.json +++ b/test/fixtures/flow/number-literal-types/5/expected.json @@ -1,83 +1,144 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberLiteralTypeAnnotation", - "value": 123, - "raw": "0o173", - "range": [ - 7, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 }, - "range": [ - 5, - 12 - ], + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 4, + 12 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 12, "loc": { "start": { "line": 1, - "column": 5 + "column": 4 }, "end": { "line": 1, "column": 12 } + }, + "range": [ + 4, + 12 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 5, + 12 + ], + "typeAnnotation": { + "type": "NumberLiteralTypeAnnotation", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 7, + 12 + ], + "value": 123, + "rawValue": 123, + "raw": "0o173" + } } - } - }, - "init": null, - "range": [ - 4, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 12 - } + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/qualified-generic-type/1/expected.json b/test/fixtures/flow/qualified-generic-type/1/expected.json index ccbc123730..71e86249f2 100644 --- a/test/fixtures/flow/qualified-generic-type/1/expected.json +++ b/test/fixtures/flow/qualified-generic-type/1/expected.json @@ -1,106 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "QualifiedTypeIdentifier", - "qualification": { - "type": "Identifier", - "name": "A", - "range": [ - 8, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "id": { - "type": "Identifier", - "name": "B", - "range": [ - 10, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "range": [ - 8, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "typeParameters": null, - "range": [ - 8, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "range": [ - 6, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "range": [ - 4, - 11 - ], + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 11, "loc": { "start": { "line": 1, @@ -110,40 +68,134 @@ "line": 1, "column": 11 } - } - }, - "init": null, - "range": [ - 4, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 11 - } + "range": [ + 4, + 11 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 4, + 11 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 6, + 11 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 8, + 11 + ], + "typeParameters": null, + "id": { + "type": "QualifiedTypeIdentifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 8, + 11 + ], + "qualification": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "A" + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "B" + } + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/qualified-generic-type/2/expected.json b/test/fixtures/flow/qualified-generic-type/2/expected.json index ee7a525fef..74e006bb05 100644 --- a/test/fixtures/flow/qualified-generic-type/2/expected.json +++ b/test/fixtures/flow/qualified-generic-type/2/expected.json @@ -1,141 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "QualifiedTypeIdentifier", - "qualification": { - "type": "QualifiedTypeIdentifier", - "qualification": { - "type": "Identifier", - "name": "A", - "range": [ - 8, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "id": { - "type": "Identifier", - "name": "B", - "range": [ - 10, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "range": [ - 8, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "id": { - "type": "Identifier", - "name": "C", - "range": [ - 12, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "range": [ - 8, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "typeParameters": null, - "range": [ - 8, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "range": [ - 6, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "range": [ - 4, - 13 - ], + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 13, "loc": { "start": { "line": 1, @@ -145,40 +68,173 @@ "line": 1, "column": 13 } - } - }, - "init": null, - "range": [ - 4, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 13 - } + "range": [ + 4, + 13 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 4, + 13 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 6, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 6, + 13 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 8, + 13 + ], + "typeParameters": null, + "id": { + "type": "QualifiedTypeIdentifier", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 8, + 13 + ], + "qualification": { + "type": "QualifiedTypeIdentifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 8, + 11 + ], + "qualification": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "A" + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "B" + } + }, + "id": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "C" + } + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/qualified-generic-type/3/expected.json b/test/fixtures/flow/qualified-generic-type/3/expected.json index fb0eabf487..7ffe0ec9fa 100644 --- a/test/fixtures/flow/qualified-generic-type/3/expected.json +++ b/test/fixtures/flow/qualified-generic-type/3/expected.json @@ -1,160 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "QualifiedTypeIdentifier", - "qualification": { - "type": "Identifier", - "name": "A", - "range": [ - 8, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "id": { - "type": "Identifier", - "name": "B", - "range": [ - 10, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "range": [ - 8, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 12, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "typeParameters": null, - "range": [ - 12, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], - "range": [ - 11, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 8, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 6, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 4, - 14 - ], + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, "loc": { "start": { "line": 1, @@ -164,40 +68,194 @@ "line": 1, "column": 14 } - } - }, - "init": null, - "range": [ - 4, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 14 - } + "range": [ + 4, + 14 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 4, + 14 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 6, + 14 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 11, + 14 + ], + "params": [ + { + "type": "GenericTypeAnnotation", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "T" + } + } + ] + }, + "id": { + "type": "QualifiedTypeIdentifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 8, + 11 + ], + "qualification": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "A" + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "B" + } + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/qualified-generic-type/4/expected.json b/test/fixtures/flow/qualified-generic-type/4/expected.json index 16b01aa2af..f1ba7a0b48 100644 --- a/test/fixtures/flow/qualified-generic-type/4/expected.json +++ b/test/fixtures/flow/qualified-generic-type/4/expected.json @@ -1,177 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "TypeofTypeAnnotation", - "argument": { - "type": "GenericTypeAnnotation", - "id": { - "type": "QualifiedTypeIdentifier", - "qualification": { - "type": "Identifier", - "name": "A", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "id": { - "type": "Identifier", - "name": "B", - "range": [ - 17, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "range": [ - 15, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 19, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "typeParameters": null, - "range": [ - 19, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "range": [ - 18, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "range": [ - 15, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "range": [ - 8, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "range": [ - 6, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "range": [ - 4, - 21 - ], + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 21, "loc": { "start": { "line": 1, @@ -181,40 +68,213 @@ "line": 1, "column": 21 } - } - }, - "init": null, - "range": [ - 4, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 21 - } + "range": [ + 4, + 21 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 4, + 21 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 6, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 6, + 21 + ], + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 8, + 21 + ], + "argument": { + "type": "GenericTypeAnnotation", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 15, + 21 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 18, + 21 + ], + "params": [ + { + "type": "GenericTypeAnnotation", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ], + "name": "T" + } + } + ] + }, + "id": { + "type": "QualifiedTypeIdentifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 15, + 18 + ], + "qualification": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "A" + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "name": "B" + } + } + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/string-literal-types/1/expected.json b/test/fixtures/flow/string-literal-types/1/expected.json index 7ad3b1b71a..d3920324d6 100644 --- a/test/fixtures/flow/string-literal-types/1/expected.json +++ b/test/fixtures/flow/string-literal-types/1/expected.json @@ -1,113 +1,167 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "createElement", - "range": [ - 9, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - } + "type": "File", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "range": [ + 0, + 57 + ], + "program": { + "type": "Program", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [ - { - "type": "Identifier", - "name": "tagName", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "StringLiteralTypeAnnotation", - "value": "div", - "raw": "\"div\"", - "range": [ - 32, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "range": [ - 30, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "range": [ - 23, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 37 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 55, - 57 - ], + "end": { + "line": 1, + "column": 57 + } + }, + "range": [ + 0, + 57 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 57, "loc": { "start": { "line": 1, - "column": 55 + "column": 0 }, "end": { "line": 1, "column": 57 } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { + }, + "range": [ + 0, + 57 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 9, + 22 + ], + "name": "createElement" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { "type": "Identifier", - "name": "HTMLDivElement", + "start": 23, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 37 + } + }, "range": [ - 40, - 54 + 23, + 37 ], + "name": "tagName", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 30, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 30, + 37 + ], + "typeAnnotation": { + "type": "StringLiteralTypeAnnotation", + "start": 32, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 32, + 37 + ], + "value": "div", + "rawValue": "div", + "raw": "\"div\"" + } + } + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 38, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 38, + 54 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 40, + "end": 54, "loc": { "start": { "line": 1, @@ -117,53 +171,55 @@ "line": 1, "column": 54 } + }, + "range": [ + 40, + 54 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 40, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 40, + 54 + ], + "name": "HTMLDivElement" } - }, - "typeParameters": null, - "range": [ - 40, - 54 - ], + } + }, + "body": { + "type": "BlockStatement", + "start": 55, + "end": 57, "loc": { "start": { "line": 1, - "column": 40 + "column": 55 }, "end": { "line": 1, - "column": 54 + "column": 57 } - } - }, - "range": [ - 38, - 54 - ], - "loc": { - "start": { - "line": 1, - "column": 38 }, - "end": { - "line": 1, - "column": 54 - } - } - }, - "range": [ - 0, - 57 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 + "range": [ + 55, + 57 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/string-literal-types/2/expected.json b/test/fixtures/flow/string-literal-types/2/expected.json index d3e538c199..eca99e8224 100644 --- a/test/fixtures/flow/string-literal-types/2/expected.json +++ b/test/fixtures/flow/string-literal-types/2/expected.json @@ -1,113 +1,167 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "createElement", - "range": [ - 9, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - } + "type": "File", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "range": [ + 0, + 57 + ], + "program": { + "type": "Program", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [ - { - "type": "Identifier", - "name": "tagName", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "StringLiteralTypeAnnotation", - "value": "div", - "raw": "'div'", - "range": [ - 32, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "range": [ - 30, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "range": [ - 23, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 37 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 55, - 57 - ], + "end": { + "line": 1, + "column": 57 + } + }, + "range": [ + 0, + 57 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 57, "loc": { "start": { "line": 1, - "column": 55 + "column": 0 }, "end": { "line": 1, "column": 57 } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { + }, + "range": [ + 0, + 57 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 9, + 22 + ], + "name": "createElement" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { "type": "Identifier", - "name": "HTMLDivElement", + "start": 23, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 37 + } + }, "range": [ - 40, - 54 + 23, + 37 ], + "name": "tagName", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 30, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 30, + 37 + ], + "typeAnnotation": { + "type": "StringLiteralTypeAnnotation", + "start": 32, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 32, + 37 + ], + "value": "div", + "rawValue": "div", + "raw": "'div'" + } + } + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 38, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 38, + 54 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 40, + "end": 54, "loc": { "start": { "line": 1, @@ -117,53 +171,55 @@ "line": 1, "column": 54 } + }, + "range": [ + 40, + 54 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 40, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 40, + 54 + ], + "name": "HTMLDivElement" } - }, - "typeParameters": null, - "range": [ - 40, - 54 - ], + } + }, + "body": { + "type": "BlockStatement", + "start": 55, + "end": 57, "loc": { "start": { "line": 1, - "column": 40 + "column": 55 }, "end": { "line": 1, - "column": 54 + "column": 57 } - } - }, - "range": [ - 38, - 54 - ], - "loc": { - "start": { - "line": 1, - "column": 38 }, - "end": { - "line": 1, - "column": 54 - } - } - }, - "range": [ - 0, - 57 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 + "range": [ + 55, + 57 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/tuples/1/expected.json b/test/fixtures/flow/tuples/1/expected.json index 4ef542c08b..2a26d4d539 100644 --- a/test/fixtures/flow/tuples/1/expected.json +++ b/test/fixtures/flow/tuples/1/expected.json @@ -1,113 +1,161 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "TupleTypeAnnotation", - "types": [], - "range": [ - 8, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "range": [ - 6, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "range": [ - 4, - 10 - ], + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 15, "loc": { "start": { "line": 1, "column": 4 }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "init": { - "type": "ArrayExpression", - "elements": [], - "range": [ - 13, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, "end": { "line": 1, "column": 15 } - } - }, - "range": [ - 4, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 15 + "range": [ + 4, + 15 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 4, + 10 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 6, + 10 + ], + "typeAnnotation": { + "type": "TupleTypeAnnotation", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 8, + 10 + ], + "types": [] + } + } + }, + "init": { + "type": "ArrayExpression", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 13, + 15 + ], + "elements": [] } } - } - ], - "kind": "var", - "range": [ - 0, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/tuples/2/expected.json b/test/fixtures/flow/tuples/2/expected.json index db8f2c1b90..8229cd8420 100644 --- a/test/fixtures/flow/tuples/2/expected.json +++ b/test/fixtures/flow/tuples/2/expected.json @@ -1,28 +1,138 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 4, + 24 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 4, + 16 + ], + "name": "a", "typeAnnotation": { - "type": "TupleTypeAnnotation", - "types": [ - { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 9, - 12 - ], + "type": "TypeAnnotation", + "start": 6, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 6, + 16 + ], + "typeAnnotation": { + "type": "TupleTypeAnnotation", + "start": 8, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 8, + 16 + ], + "types": [ + { + "type": "GenericTypeAnnotation", + "start": 9, + "end": 15, "loc": { "start": { "line": 1, @@ -30,22 +140,36 @@ }, "end": { "line": 1, - "column": 12 + "column": 15 } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 13, - 14 - ], + }, + "range": [ + 9, + 15 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 12, + 15 + ], + "params": [ + { + "type": "GenericTypeAnnotation", + "start": 13, + "end": 14, "loc": { "start": { "line": 1, @@ -55,169 +179,105 @@ "line": 1, "column": 14 } - } - }, - "typeParameters": null, - "range": [ - 13, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 13 }, - "end": { - "line": 1, - "column": 14 + "range": [ + 13, + 14 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "T" } } - } - ], - "range": [ - 12, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "range": [ - 9, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 9 + ] }, - "end": { - "line": 1, - "column": 15 + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "Foo" } } - } - ], - "range": [ - 8, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } + ] } - }, - "range": [ - 6, - 16 - ], + } + }, + "init": { + "type": "ArrayExpression", + "start": 19, + "end": 24, "loc": { "start": { "line": 1, - "column": 6 + "column": 19 }, "end": { "line": 1, - "column": 16 + "column": 24 } - } - }, - "range": [ - 4, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "init": { - "type": "ArrayExpression", - "elements": [ - { - "type": "Identifier", - "name": "foo", - "range": [ - 20, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 20 + "range": [ + 19, + 24 + ], + "elements": [ + { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } }, - "end": { - "line": 1, - "column": 23 - } + "range": [ + 20, + 23 + ], + "name": "foo" } - } - ], - "range": [ - 19, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "range": [ - 4, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 + ] } } - } - ], - "kind": "var", - "range": [ - 0, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/tuples/3/expected.json b/test/fixtures/flow/tuples/3/expected.json index a44790f780..fe09d42d47 100644 --- a/test/fixtures/flow/tuples/3/expected.json +++ b/test/fixtures/flow/tuples/3/expected.json @@ -1,71 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "TupleTypeAnnotation", - "types": [ - { - "type": "NumberTypeAnnotation", - "range": [ - 9, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "range": [ - 8, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 6, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 4, - 17 - ], + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 26, "loc": { "start": { "line": 1, @@ -73,79 +66,139 @@ }, "end": { "line": 1, - "column": 17 + "column": 26 } - } - }, - "init": { - "type": "ArrayExpression", - "elements": [ - { - "type": "Literal", - "value": 123, - "raw": "123", - "range": [ - 21, - 24 - ], + }, + "range": [ + 4, + 26 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 4, + 17 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 6, + "end": 17, "loc": { "start": { "line": 1, - "column": 21 + "column": 6 }, "end": { "line": 1, - "column": 24 + "column": 17 } + }, + "range": [ + 6, + 17 + ], + "typeAnnotation": { + "type": "TupleTypeAnnotation", + "start": 8, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 8, + 17 + ], + "types": [ + { + "type": "NumberTypeAnnotation", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 9, + 15 + ] + } + ] } } - ], - "range": [ - 20, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "range": [ - 4, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 26 + "init": { + "type": "ArrayExpression", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 20, + 26 + ], + "elements": [ + { + "type": "Literal", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 21, + 24 + ], + "value": 123, + "rawValue": 123, + "raw": "123" + } + ] } } - } - ], - "kind": "var", - "range": [ - 0, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/tuples/4/expected.json b/test/fixtures/flow/tuples/4/expected.json index 34f7108780..160c175e09 100644 --- a/test/fixtures/flow/tuples/4/expected.json +++ b/test/fixtures/flow/tuples/4/expected.json @@ -1,187 +1,245 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "TupleTypeAnnotation", - "types": [ - { - "type": "NumberTypeAnnotation", - "range": [ - 9, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - { - "type": "StringTypeAnnotation", - "range": [ - 17, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], - "range": [ - 8, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "range": [ - 6, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "range": [ - 4, - 24 - ], + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 40, "loc": { "start": { "line": 1, "column": 4 }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "init": { - "type": "ArrayExpression", - "elements": [ - { - "type": "Literal", - "value": 123, - "raw": "123", - "range": [ - 28, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - { - "type": "Literal", - "value": "duck", - "raw": "\"duck\"", - "range": [ - 33, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } - } - ], - "range": [ - 27, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, "end": { "line": 1, "column": 40 } - } - }, - "range": [ - 4, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 40 + "range": [ + 4, + 40 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 4, + 24 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 6, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 6, + 24 + ], + "typeAnnotation": { + "type": "TupleTypeAnnotation", + "start": 8, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 8, + 24 + ], + "types": [ + { + "type": "NumberTypeAnnotation", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 9, + 15 + ] + }, + { + "type": "StringTypeAnnotation", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 17, + 23 + ] + } + ] + } + } + }, + "init": { + "type": "ArrayExpression", + "start": 27, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 27, + 40 + ], + "elements": [ + { + "type": "Literal", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 28, + 31 + ], + "value": 123, + "rawValue": 123, + "raw": "123" + }, + { + "type": "Literal", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 33, + 39 + ], + "value": "duck", + "rawValue": "duck", + "raw": "\"duck\"" + } + ] } } - } - ], - "kind": "var", - "range": [ - 0, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 41 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-alias/1/expected.json b/test/fixtures/flow/type-alias/1/expected.json index 5c3d92a28f..5df8886575 100644 --- a/test/fixtures/flow/type-alias/1/expected.json +++ b/test/fixtures/flow/type-alias/1/expected.json @@ -1,58 +1,100 @@ { - "type": "Program", - "body": [ - { - "type": "TypeAlias", - "id": { - "type": "Identifier", - "name": "FBID", - "range": [ - 5, - 9 - ], + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "sourceType": "module", + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 19, "loc": { "start": { "line": 1, - "column": 5 + "column": 0 }, "end": { "line": 1, - "column": 9 + "column": 19 } - } - }, - "typeParameters": null, - "right": { - "type": "NumberTypeAnnotation", - "range": [ - 12, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "range": [ - 0, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 19 + "range": [ + 0, + 19 + ], + "id": { + "type": "Identifier", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 5, + 9 + ], + "name": "FBID" + }, + "typeParameters": null, + "right": { + "type": "NumberTypeAnnotation", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 12, + 18 + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-alias/2/expected.json b/test/fixtures/flow/type-alias/2/expected.json index 6b5e702134..89deec6726 100644 --- a/test/fixtures/flow/type-alias/2/expected.json +++ b/test/fixtures/flow/type-alias/2/expected.json @@ -1,72 +1,124 @@ { - "type": "Program", - "body": [ - { - "type": "TypeAlias", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 5, - 8 - ], + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "sourceType": "module", + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, - "column": 5 + "column": 0 }, "end": { "line": 1, - "column": 8 + "column": 20 } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 9, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], + }, "range": [ - 8, - 11 + 0, + 20 ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "right": { - "type": "GenericTypeAnnotation", "id": { "type": "Identifier", - "name": "Bar", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, "range": [ - 14, - 17 + 5, + 8 ], + "name": "Foo" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 8, + 11 + ], + "params": [ + { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "T" + } + ] + }, + "right": { + "type": "GenericTypeAnnotation", + "start": 14, + "end": 20, "loc": { "start": { "line": 1, @@ -74,22 +126,36 @@ }, "end": { "line": 1, - "column": 17 + "column": 20 } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 18, - 19 - ], + }, + "range": [ + 14, + 20 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 17, + 20 + ], + "params": [ + { + "type": "GenericTypeAnnotation", + "start": 18, + "end": 19, "loc": { "start": { "line": 1, @@ -99,69 +165,57 @@ "line": 1, "column": 19 } - } - }, - "typeParameters": null, - "range": [ - 18, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 18 }, - "end": { - "line": 1, - "column": 19 + "range": [ + 18, + 19 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "T" } } - } - ], - "range": [ - 17, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "range": [ - 14, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 14 + ] }, - "end": { - "line": 1, - "column": 20 + "id": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 14, + 17 + ], + "name": "Bar" } } - }, - "range": [ - 0, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-alias/3/expected.json b/test/fixtures/flow/type-alias/3/expected.json index 36bb69a6e7..3e19e2bb17 100644 --- a/test/fixtures/flow/type-alias/3/expected.json +++ b/test/fixtures/flow/type-alias/3/expected.json @@ -1,77 +1,121 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "TypeAlias", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 12, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "typeParameters": null, - "right": { - "type": "NumberTypeAnnotation", - "range": [ - 18, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "range": [ - 7, - 25 - ], + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 25, "loc": { "start": { "line": 1, - "column": 7 + "column": 0 }, "end": { "line": 1, "column": 25 } - } - }, - "specifiers": [], - "source": null, - "range": [ - 0, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 25 - } + "range": [ + 0, + 25 + ], + "declaration": { + "type": "TypeAlias", + "start": 7, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 7, + 25 + ], + "id": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 12, + 15 + ], + "name": "Foo" + }, + "typeParameters": null, + "right": { + "type": "NumberTypeAnnotation", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 18, + 24 + ] + } + }, + "specifiers": [], + "source": null } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/1/expected.json b/test/fixtures/flow/type-annotations/1/expected.json index b49228765d..1843928ac2 100644 --- a/test/fixtures/flow/type-annotations/1/expected.json +++ b/test/fixtures/flow/type-annotations/1/expected.json @@ -1,166 +1,221 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "range": [ + 0, + 44 + ], + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [ - { - "type": "Identifier", - "name": "numVal", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "AnyTypeAnnotation", - "range": [ - 21, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "range": [ - 19, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "range": [ - 13, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - { - "type": "Identifier", - "name": "otherVal", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "MixedTypeAnnotation", - "range": [ - 36, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "range": [ - 34, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "range": [ - 26, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 41 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 42, - 44 - ], + "end": { + "line": 1, + "column": 44 + } + }, + "range": [ + 0, + 44 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 44, "loc": { "start": { "line": 1, - "column": 42 + "column": 0 }, "end": { "line": 1, "column": 44 } - } - }, - "generator": false, - "expression": false, - "range": [ - 0, - 44 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 44 + "range": [ + 0, + 44 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 13, + 24 + ], + "name": "numVal", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 19, + 24 + ], + "typeAnnotation": { + "type": "AnyTypeAnnotation", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 21, + 24 + ] + } + } + }, + { + "type": "Identifier", + "start": 26, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 26, + 41 + ], + "name": "otherVal", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 34, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 34, + 41 + ], + "typeAnnotation": { + "type": "MixedTypeAnnotation", + "start": 36, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 36, + 41 + ] + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "range": [ + 42, + 44 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/10/expected.json b/test/fixtures/flow/type-annotations/10/expected.json index 373bd4c56f..d28d3c61f6 100644 --- a/test/fixtures/flow/type-annotations/10/expected.json +++ b/test/fixtures/flow/type-annotations/10/expected.json @@ -1,240 +1,304 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], + "type": "File", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "range": [ + 0, + 56 + ], + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "range": [ + 0, + 56 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 56, "loc": { "start": { "line": 1, - "column": 9 + "column": 0 }, "end": { "line": 1, - "column": 12 + "column": 56 } - } - }, - "params": [ - { + }, + "range": [ + 0, + 56 + ], + "id": { "type": "Identifier", - "name": "callback", - "typeAnnotation": { - "type": "TypeAnnotation", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 13, + 53 + ], + "name": "callback", "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [ - { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "_1", - "range": [ - 24, - 26 - ], + "type": "TypeAnnotation", + "start": 21, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 21, + 53 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 23, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 23, + 53 + ], + "params": [ + { + "type": "FunctionTypeParam", + "start": 24, + "end": 31, "loc": { "start": { "line": 1, "column": 24 }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "typeAnnotation": { - "type": "BooleanTypeAnnotation", - "range": [ - 27, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, "end": { "line": 1, "column": 31 } + }, + "range": [ + 24, + 31 + ], + "name": { + "type": "Identifier", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 24, + 26 + ], + "name": "_1" + }, + "optional": false, + "typeAnnotation": { + "type": "BooleanTypeAnnotation", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 27, + 31 + ] } }, - "optional": false, - "range": [ - 24, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "_2", - "range": [ - 33, - 35 - ], + { + "type": "FunctionTypeParam", + "start": 33, + "end": 42, "loc": { "start": { "line": 1, "column": 33 }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "range": [ - 36, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 36 - }, "end": { "line": 1, "column": 42 } + }, + "range": [ + 33, + 42 + ], + "name": { + "type": "Identifier", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 33, + 35 + ], + "name": "_2" + }, + "optional": false, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 36, + 42 + ] } - }, - "optional": false, - "range": [ - 33, - 42 - ], + } + ], + "rest": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 47, + "end": 53, "loc": { "start": { "line": 1, - "column": 33 + "column": 47 }, "end": { "line": 1, - "column": 42 + "column": 53 } - } - } - ], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 47, - 53 - ], - "loc": { - "start": { - "line": 1, - "column": 47 }, - "end": { - "line": 1, - "column": 53 - } - } - }, - "typeParameters": null, - "range": [ - 23, - 53 - ], - "loc": { - "start": { - "line": 1, - "column": 23 + "range": [ + 47, + 53 + ] }, - "end": { - "line": 1, - "column": 53 - } - } - }, - "range": [ - 21, - 53 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 53 + "typeParameters": null } } - }, - "range": [ - 13, - 53 - ], + } + ], + "body": { + "type": "BlockStatement", + "start": 54, + "end": 56, "loc": { "start": { "line": 1, - "column": 13 + "column": 54 }, "end": { "line": 1, - "column": 53 + "column": 56 } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 54, - 56 - ], - "loc": { - "start": { - "line": 1, - "column": 54 }, - "end": { - "line": 1, - "column": 56 - } - } - }, - "generator": false, - "expression": false, - "range": [ - 0, - 56 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 + "range": [ + 54, + 56 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/11/expected.json b/test/fixtures/flow/type-annotations/11/expected.json index 4d1a301510..7dcaa4dc58 100644 --- a/test/fixtures/flow/type-annotations/11/expected.json +++ b/test/fixtures/flow/type-annotations/11/expected.json @@ -1,115 +1,203 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], + "type": "File", + "start": 0, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 67 + } + }, + "range": [ + 0, + 67 + ], + "program": { + "type": "Program", + "start": 0, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 67 + } + }, + "range": [ + 0, + 67 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 67, "loc": { "start": { "line": 1, - "column": 9 + "column": 0 }, "end": { "line": 1, - "column": 12 + "column": 67 } - } - }, - "params": [ - { + }, + "range": [ + 0, + 67 + ], + "id": { "type": "Identifier", - "name": "callback", - "typeAnnotation": { - "type": "TypeAnnotation", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "range": [ + 13, + 64 + ], + "name": "callback", "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [ - { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "_1", - "range": [ - 24, - 26 - ], + "type": "TypeAnnotation", + "start": 21, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "range": [ + 21, + 64 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 23, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "range": [ + 23, + 64 + ], + "params": [ + { + "type": "FunctionTypeParam", + "start": 24, + "end": 31, "loc": { "start": { "line": 1, "column": 24 }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "typeAnnotation": { - "type": "BooleanTypeAnnotation", - "range": [ - 27, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, "end": { "line": 1, "column": 31 } - } - }, - "optional": false, - "range": [ - 24, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 24 }, - "end": { - "line": 1, - "column": 31 + "range": [ + 24, + 31 + ], + "name": { + "type": "Identifier", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 24, + 26 + ], + "name": "_1" + }, + "optional": false, + "typeAnnotation": { + "type": "BooleanTypeAnnotation", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 27, + 31 + ] } } - } - ], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 58, - 64 ], - "loc": { - "start": { - "line": 1, - "column": 58 - }, - "end": { - "line": 1, - "column": 64 - } - } - }, - "rest": { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "foo", - "range": [ - 36, - 39 - ], + "rest": { + "type": "FunctionTypeParam", + "start": 36, + "end": 53, "loc": { "start": { "line": 1, @@ -117,178 +205,159 @@ }, "end": { "line": 1, - "column": 39 + "column": 53 } - } - }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { + }, + "range": [ + 36, + 53 + ], + "name": { "type": "Identifier", - "name": "Array", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 39 + } + }, "range": [ - 40, - 45 + 36, + 39 ], + "name": "foo" + }, + "optional": false, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 40, + "end": 53, "loc": { "start": { "line": 1, "column": 40 }, - "end": { - "line": 1, - "column": 45 - } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "NumberTypeAnnotation", - "range": [ - 46, - 52 - ], - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 52 - } - } - } - ], - "range": [ - 45, - 53 - ], - "loc": { - "start": { - "line": 1, - "column": 45 - }, "end": { "line": 1, "column": 53 } + }, + "range": [ + 40, + 53 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 45, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 45, + 53 + ], + "params": [ + { + "type": "NumberTypeAnnotation", + "start": 46, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 46, + 52 + ] + } + ] + }, + "id": { + "type": "Identifier", + "start": 40, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 40, + 45 + ], + "name": "Array" } - }, - "range": [ - 40, - 53 - ], + } + }, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 58, + "end": 64, "loc": { "start": { "line": 1, - "column": 40 + "column": 58 }, "end": { "line": 1, - "column": 53 + "column": 64 } - } - }, - "optional": false, - "range": [ - 36, - 53 - ], - "loc": { - "start": { - "line": 1, - "column": 36 }, - "end": { - "line": 1, - "column": 53 - } - } - }, - "typeParameters": null, - "range": [ - 23, - 64 - ], - "loc": { - "start": { - "line": 1, - "column": 23 + "range": [ + 58, + 64 + ] }, - "end": { - "line": 1, - "column": 64 - } - } - }, - "range": [ - 21, - 64 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 64 + "typeParameters": null } } - }, - "range": [ - 13, - 64 - ], + } + ], + "body": { + "type": "BlockStatement", + "start": 65, + "end": 67, "loc": { "start": { "line": 1, - "column": 13 + "column": 65 }, "end": { "line": 1, - "column": 64 + "column": 67 } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 65, - 67 - ], - "loc": { - "start": { - "line": 1, - "column": 65 }, - "end": { - "line": 1, - "column": 67 - } - } - }, - "generator": false, - "expression": false, - "range": [ - 0, - 67 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 67 + "range": [ + 65, + 67 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/12/expected.json b/test/fixtures/flow/type-annotations/12/expected.json index ebe0823184..72c0af0dfb 100644 --- a/test/fixtures/flow/type-annotations/12/expected.json +++ b/test/fixtures/flow/type-annotations/12/expected.json @@ -1,95 +1,142 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 21, - 23 - ], + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 23, "loc": { "start": { "line": 1, - "column": 21 + "column": 0 }, "end": { "line": 1, "column": 23 } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 15, - 21 - ], + }, + "range": [ + 0, + 23 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, "loc": { "start": { "line": 1, - "column": 15 + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 14, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 14 }, "end": { "line": 1, "column": 21 } - } - }, - "range": [ - 14, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 14 }, - "end": { - "line": 1, - "column": 21 + "range": [ + 14, + 21 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 15, + 21 + ] } - } - }, - "range": [ - 0, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 23 + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 21, + 23 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/13/expected.json b/test/fixtures/flow/type-annotations/13/expected.json index 726e12ed1e..647eedc6fd 100644 --- a/test/fixtures/flow/type-annotations/13/expected.json +++ b/test/fixtures/flow/type-annotations/13/expected.json @@ -1,114 +1,164 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 25, - 27 - ], + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, - "column": 25 + "column": 0 }, "end": { "line": 1, "column": 27 } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "VoidTypeAnnotation", - "range": [ - 21, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "typeParameters": null, - "range": [ - 15, - 25 - ], + }, + "range": [ + 0, + 27 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, "loc": { "start": { "line": 1, - "column": 15 + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 14 }, "end": { "line": 1, "column": 25 } - } - }, - "range": [ - 14, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 14 }, - "end": { - "line": 1, - "column": 25 + "range": [ + 14, + 25 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 15, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 15, + 25 + ], + "params": [], + "rest": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 21, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 21, + 25 + ] + }, + "typeParameters": null } - } - }, - "range": [ - 0, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 27 + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 25, + 27 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/14/expected.json b/test/fixtures/flow/type-annotations/14/expected.json index 29b2321776..67be62c43f 100644 --- a/test/fixtures/flow/type-annotations/14/expected.json +++ b/test/fixtures/flow/type-annotations/14/expected.json @@ -1,168 +1,224 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 33, - 35 - ], + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 35, "loc": { "start": { "line": 1, - "column": 33 + "column": 0 }, "end": { "line": 1, "column": 35 } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [ - { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "_", - "range": [ - 16, - 17 - ], + }, + "range": [ + 0, + 35 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 14, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 14, + 33 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 15, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 15, + 33 + ], + "params": [ + { + "type": "FunctionTypeParam", + "start": 16, + "end": 22, "loc": { "start": { "line": 1, "column": 16 }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "typeAnnotation": { - "type": "BooleanTypeAnnotation", - "range": [ - 18, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, "end": { "line": 1, "column": 22 } + }, + "range": [ + 16, + 22 + ], + "name": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "_" + }, + "optional": false, + "typeAnnotation": { + "type": "BooleanTypeAnnotation", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 18, + 22 + ] } - }, - "optional": false, - "range": [ - 16, - 22 - ], + } + ], + "rest": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 27, + "end": 33, "loc": { "start": { "line": 1, - "column": 16 + "column": 27 }, "end": { "line": 1, - "column": 22 + "column": 33 } - } - } - ], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 27, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 27 }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "typeParameters": null, - "range": [ - 15, - 33 - ], + "range": [ + 27, + 33 + ] + }, + "typeParameters": null + } + }, + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, "loc": { "start": { "line": 1, - "column": 15 + "column": 33 }, "end": { "line": 1, - "column": 33 + "column": 35 } - } - }, - "range": [ - 14, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 14 }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "range": [ - 0, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 35 + "range": [ + 33, + 35 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/15/expected.json b/test/fixtures/flow/type-annotations/15/expected.json index c92f4f59ad..fd690efc18 100644 --- a/test/fixtures/flow/type-annotations/15/expected.json +++ b/test/fixtures/flow/type-annotations/15/expected.json @@ -1,168 +1,224 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 34, - 36 - ], + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, - "column": 34 + "column": 0 }, "end": { "line": 1, "column": 36 } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [ - { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "_", - "range": [ - 16, - 17 - ], + }, + "range": [ + 0, + 36 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 14, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 14, + 34 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 15, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 15, + 34 + ], + "params": [ + { + "type": "FunctionTypeParam", + "start": 16, + "end": 23, "loc": { "start": { "line": 1, "column": 16 }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "typeAnnotation": { - "type": "BooleanTypeAnnotation", - "range": [ - 19, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, "end": { "line": 1, "column": 23 } + }, + "range": [ + 16, + 23 + ], + "name": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "_" + }, + "optional": true, + "typeAnnotation": { + "type": "BooleanTypeAnnotation", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 19, + 23 + ] } - }, - "optional": true, - "range": [ - 16, - 23 - ], + } + ], + "rest": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 28, + "end": 34, "loc": { "start": { "line": 1, - "column": 16 + "column": 28 }, "end": { "line": 1, - "column": 23 + "column": 34 } - } - } - ], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 28, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 28 }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "typeParameters": null, - "range": [ - 15, - 34 - ], + "range": [ + 28, + 34 + ] + }, + "typeParameters": null + } + }, + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, "loc": { "start": { "line": 1, - "column": 15 + "column": 34 }, "end": { "line": 1, - "column": 34 + "column": 36 } - } - }, - "range": [ - 14, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 14 }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "range": [ - 0, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 + "range": [ + 34, + 36 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/16/expected.json b/test/fixtures/flow/type-annotations/16/expected.json index 507e15d5fe..742a14626e 100644 --- a/test/fixtures/flow/type-annotations/16/expected.json +++ b/test/fixtures/flow/type-annotations/16/expected.json @@ -1,98 +1,145 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 19, - 21 - ], + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 21, "loc": { "start": { "line": 1, - "column": 19 + "column": 0 }, "end": { "line": 1, "column": 21 } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [], - "indexers": [], - "callProperties": [], - "range": [ - 16, - 18 - ], + }, + "range": [ + 0, + 21 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, "loc": { "start": { "line": 1, - "column": 16 + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 }, "end": { "line": 1, "column": 18 } - } - }, - "range": [ - 14, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 14 }, - "end": { - "line": 1, - "column": 18 + "range": [ + 14, + 18 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 16, + 18 + ], + "callProperties": [], + "properties": [], + "indexers": [] } - } - }, - "range": [ - 0, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 21 + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 19, + 21 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/17/expected.json b/test/fixtures/flow/type-annotations/17/expected.json index 55b3aa33c4..e0ec22b51e 100644 --- a/test/fixtures/flow/type-annotations/17/expected.json +++ b/test/fixtures/flow/type-annotations/17/expected.json @@ -1,98 +1,145 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 18, - 20 - ], + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, - "column": 18 + "column": 0 }, "end": { "line": 1, "column": 20 } - } - }, - "generator": false, - "expression": false, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 13, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "range": [ - 12, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "range": [ - 0, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 20 + "range": [ + 0, + 20 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 12, + 15 + ], + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "T" + } + ] + }, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 18, + 20 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/18/expected.json b/test/fixtures/flow/type-annotations/18/expected.json index 4febea86af..358b368923 100644 --- a/test/fixtures/flow/type-annotations/18/expected.json +++ b/test/fixtures/flow/type-annotations/18/expected.json @@ -1,116 +1,165 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 20, - 22 - ], + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, - "column": 20 + "column": 0 }, "end": { "line": 1, "column": 22 } - } - }, - "generator": false, - "expression": false, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 13, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "Identifier", - "name": "S", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "range": [ - 12, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 0, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 22 + "range": [ + 0, + 22 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 12, + 17 + ], + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "T" + }, + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "S" + } + ] + }, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 20, + 22 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/19/expected.json b/test/fixtures/flow/type-annotations/19/expected.json index 0f855e88a9..515ddeffb6 100644 --- a/test/fixtures/flow/type-annotations/19/expected.json +++ b/test/fixtures/flow/type-annotations/19/expected.json @@ -1,127 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "a", - "range": [ - 0, - 1 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 18, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "generator": false, - "expression": false, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 11, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - { - "type": "Identifier", - "name": "S", - "range": [ - 13, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "range": [ - 10, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "range": [ - 2, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "range": [ - 0, - 20 - ], + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, @@ -131,22 +49,157 @@ "line": 1, "column": 20 } - } - }, - "range": [ - 0, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 20 + "range": [ + 0, + 20 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "a" + }, + "right": { + "type": "FunctionExpression", + "start": 2, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 2, + 20 + ], + "id": null, + "generator": false, + "expression": false, + "async": false, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 10, + 15 + ], + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "T" + }, + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "S" + } + ] + }, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 18, + 20 + ], + "body": [] + } + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/2/expected.json b/test/fixtures/flow/type-annotations/2/expected.json index 33efadd4c5..b7c05f26a9 100644 --- a/test/fixtures/flow/type-annotations/2/expected.json +++ b/test/fixtures/flow/type-annotations/2/expected.json @@ -1,114 +1,163 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [ - { - "type": "Identifier", - "name": "numVal", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 21, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "range": [ - 19, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "range": [ - 13, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 28, - 30 - ], + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 30, "loc": { "start": { "line": 1, - "column": 28 + "column": 0 }, "end": { "line": 1, "column": 30 } - } - }, - "generator": false, - "expression": false, - "range": [ - 0, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 30 + "range": [ + 0, + 30 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 13, + 27 + ], + "name": "numVal", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 19, + 27 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 21, + 27 + ] + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 28, + 30 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/20/expected.json b/test/fixtures/flow/type-annotations/20/expected.json index 550557ebcd..e64aa9f1ec 100644 --- a/test/fixtures/flow/type-annotations/20/expected.json +++ b/test/fixtures/flow/type-annotations/20/expected.json @@ -1,169 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "a", - "range": [ - 0, - 1 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "fooProp", - "range": [ - 7, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "value", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 21, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "range": [ - 20, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "range": [ - 15, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 28, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "generator": false, - "expression": false - }, - "kind": "set", - "method": false, - "shorthand": false, - "computed": false, - "range": [ - 3, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], - "range": [ - 2, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "range": [ - 0, - 31 - ], + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 31, "loc": { "start": { "line": 1, @@ -173,22 +49,219 @@ "line": 1, "column": 31 } - } - }, - "range": [ - 0, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 31 + "range": [ + 0, + 31 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "a" + }, + "right": { + "type": "ObjectExpression", + "start": 2, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 2, + 31 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 3, + 30 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 7, + 14 + ], + "name": "fooProp" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 14, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 14, + 30 + ], + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 15, + 27 + ], + "name": "value", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 20, + 27 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 21, + 27 + ] + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 28, + 30 + ], + "body": [] + } + } + } + ] + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/21/expected.json b/test/fixtures/flow/type-annotations/21/expected.json index af6c6900b2..4903b1c7f5 100644 --- a/test/fixtures/flow/type-annotations/21/expected.json +++ b/test/fixtures/flow/type-annotations/21/expected.json @@ -1,203 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "a", - "range": [ - 0, - 1 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "fooProp", - "range": [ - 7, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "value", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 21, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "range": [ - 20, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "range": [ - 15, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 33, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "VoidTypeAnnotation", - "range": [ - 29, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "range": [ - 28, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - }, - "kind": "set", - "method": false, - "shorthand": false, - "computed": false, - "range": [ - 3, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "range": [ - 2, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "range": [ - 0, - 36 - ], + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, @@ -207,22 +49,257 @@ "line": 1, "column": 36 } - } - }, - "range": [ - 0, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 36 + "range": [ + 0, + 36 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "a" + }, + "right": { + "type": "ObjectExpression", + "start": 2, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 2, + 36 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 3, + 35 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 7, + 14 + ], + "name": "fooProp" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 14, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 14, + 35 + ], + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 15, + 27 + ], + "name": "value", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 20, + 27 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 21, + 27 + ] + } + } + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 28, + 33 + ], + "typeAnnotation": { + "type": "VoidTypeAnnotation", + "start": 29, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 29, + 33 + ] + } + }, + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 33, + 35 + ], + "body": [] + } + } + } + ] + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/22/expected.json b/test/fixtures/flow/type-annotations/22/expected.json index 56fb4cde25..4e9e12dbb8 100644 --- a/test/fixtures/flow/type-annotations/22/expected.json +++ b/test/fixtures/flow/type-annotations/22/expected.json @@ -1,150 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "a", - "range": [ - 0, - 1 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "fooProp", - "range": [ - 7, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 23, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 17, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 16, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - }, - "kind": "get", - "method": false, - "shorthand": false, - "computed": false, - "range": [ - 3, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], - "range": [ - 2, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "range": [ - 0, - 26 - ], + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 26, "loc": { "start": { "line": 1, @@ -154,22 +49,198 @@ "line": 1, "column": 26 } - } - }, - "range": [ - 0, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 26 + "range": [ + 0, + 26 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "a" + }, + "right": { + "type": "ObjectExpression", + "start": 2, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 2, + 26 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 3, + 25 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 7, + 14 + ], + "name": "fooProp" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 14, + 25 + ], + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 16, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 16, + 23 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 17, + 23 + ] + } + }, + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 23, + 25 + ], + "body": [] + } + } + } + ] + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/23/expected.json b/test/fixtures/flow/type-annotations/23/expected.json index d8f179e173..26483d8cd8 100644 --- a/test/fixtures/flow/type-annotations/23/expected.json +++ b/test/fixtures/flow/type-annotations/23/expected.json @@ -1,277 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "a", - "range": [ - 0, - 1 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "id", - "range": [ - 3, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "value": { - "type": "FunctionExpression", - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 12, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "typeParameters": null, - "range": [ - 12, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "range": [ - 10, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "range": [ - 9, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 18, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 16, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "typeParameters": null, - "range": [ - 16, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 14, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 6, - 7 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], - "range": [ - 5, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "range": [ - 3, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "range": [ - 2, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "range": [ - 0, - 21 - ], + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, "loc": { "start": { "line": 1, @@ -281,22 +49,340 @@ "line": 1, "column": 21 } - } - }, - "range": [ - 0, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 21 + "range": [ + 0, + 21 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "a" + }, + "right": { + "type": "ObjectExpression", + "start": 2, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 2, + 21 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 3, + 20 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 3, + 5 + ], + "name": "id" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 8, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 8, + 20 + ], + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 9, + 13 + ], + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 10, + 13 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "T" + } + } + } + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 14, + 17 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "T" + } + } + }, + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 18, + 20 + ], + "body": [] + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 5, + 8 + ], + "params": [ + { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "T" + } + ] + } + } + } + ] + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/24/expected.json b/test/fixtures/flow/type-annotations/24/expected.json index 929d196fef..943e92a222 100644 --- a/test/fixtures/flow/type-annotations/24/expected.json +++ b/test/fixtures/flow/type-annotations/24/expected.json @@ -1,264 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "a", - "range": [ - 0, - 1 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "id", - "range": [ - 4, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 13, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "typeParameters": null, - "range": [ - 13, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 11, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 10, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 19, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "generator": true, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 17, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "typeParameters": null, - "range": [ - 17, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "range": [ - 15, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 7, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "range": [ - 6, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false - } - ], - "range": [ - 2, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "range": [ - 0, - 22 - ], + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -268,22 +49,340 @@ "line": 1, "column": 22 } - } - }, - "range": [ - 0, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 22 + "range": [ + 0, + 22 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "a" + }, + "right": { + "type": "ObjectExpression", + "start": 2, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 2, + 22 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 3, + 21 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 4, + 6 + ], + "name": "id" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 9, + 21 + ], + "id": null, + "generator": true, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 10, + 14 + ], + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 11, + 14 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "T" + } + } + } + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 15, + 18 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "name": "T" + } + } + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 19, + 21 + ], + "body": [] + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "params": [ + { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "T" + } + ] + } + } + } + ] + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/25/expected.json b/test/fixtures/flow/type-annotations/25/expected.json index e216367a5d..d72c7bbcb4 100644 --- a/test/fixtures/flow/type-annotations/25/expected.json +++ b/test/fixtures/flow/type-annotations/25/expected.json @@ -1,279 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "a", - "range": [ - 0, - 1 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "id", - "range": [ - 9, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 18, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "typeParameters": null, - "range": [ - 18, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "range": [ - 16, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "range": [ - 15, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 24, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 22, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "typeParameters": null, - "range": [ - 22, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 20, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 12, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], - "range": [ - 11, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "async": true - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "range": [ - 3, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], - "range": [ - 2, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "range": [ - 0, - 27 - ], + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -283,22 +49,340 @@ "line": 1, "column": 27 } - } - }, - "range": [ - 0, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 27 + "range": [ + 0, + 27 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "a" + }, + "right": { + "type": "ObjectExpression", + "start": 2, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 2, + 27 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 3, + 26 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 9, + 11 + ], + "name": "id" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 14, + 26 + ], + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 15, + 19 + ], + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 16, + 19 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "T" + } + } + } + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 20, + 23 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ], + "name": "T" + } + } + }, + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 24, + 26 + ], + "body": [] + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 11, + 14 + ], + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "T" + } + ] + } + } + } + ] + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/26/expected.json b/test/fixtures/flow/type-annotations/26/expected.json index 5a480c955c..a9f151fd19 100644 --- a/test/fixtures/flow/type-annotations/26/expected.json +++ b/test/fixtures/flow/type-annotations/26/expected.json @@ -1,279 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "a", - "range": [ - 0, - 1 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Literal", - "value": 123, - "raw": "123", - "range": [ - 3, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 13, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "typeParameters": null, - "range": [ - 13, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 11, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 10, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 19, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 17, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "typeParameters": null, - "range": [ - 17, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "range": [ - 15, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 7, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "range": [ - 6, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "range": [ - 3, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], - "range": [ - 2, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "range": [ - 0, - 22 - ], + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -283,22 +49,342 @@ "line": 1, "column": 22 } - } - }, - "range": [ - 0, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 22 + "range": [ + 0, + 22 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "a" + }, + "right": { + "type": "ObjectExpression", + "start": 2, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 2, + 22 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 3, + 21 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Literal", + "start": 3, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 3, + 6 + ], + "value": 123, + "rawValue": 123, + "raw": "123" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 9, + 21 + ], + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 10, + 14 + ], + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 11, + 14 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "T" + } + } + } + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 15, + 18 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "name": "T" + } + } + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 19, + 21 + ], + "body": [] + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "params": [ + { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "T" + } + ] + } + } + } + ] + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/27/expected.json b/test/fixtures/flow/type-annotations/27/expected.json index d284d0505c..c3a4b43897 100644 --- a/test/fixtures/flow/type-annotations/27/expected.json +++ b/test/fixtures/flow/type-annotations/27/expected.json @@ -1,176 +1,247 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 6, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "fooProp", - "range": [ - 15, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "value", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 29, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "range": [ - 28, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "range": [ - 23, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 36, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "generator": false, - "expression": false - }, - "kind": "set", - "static": false, - "computed": false, - "range": [ - 11, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 38 - } - } - } - ], - "range": [ - 10, - 39 - ], + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 39, "loc": { "start": { "line": 1, - "column": 10 + "column": 0 }, "end": { "line": 1, "column": 39 } - } - }, - "range": [ - 0, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 39 + "range": [ + 0, + 39 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 10, + 39 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 11, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 11, + 38 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 15, + 22 + ], + "name": "fooProp" + }, + "static": false, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 22, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 22, + 38 + ], + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 23, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 23, + 35 + ], + "name": "value", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 28, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 28, + 35 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 29, + 35 + ] + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 36, + 38 + ], + "body": [] + } + } + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/28/expected.json b/test/fixtures/flow/type-annotations/28/expected.json index bb1ccadd33..022d46b7f3 100644 --- a/test/fixtures/flow/type-annotations/28/expected.json +++ b/test/fixtures/flow/type-annotations/28/expected.json @@ -1,210 +1,285 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 6, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "range": [ + 0, + 44 + ], + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "fooProp", - "range": [ - 15, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "value", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 29, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "range": [ - 28, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "range": [ - 23, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 41, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 43 - } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "VoidTypeAnnotation", - "range": [ - 37, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "range": [ - 36, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 41 - } - } - } - }, - "kind": "set", - "static": false, - "computed": false, - "range": [ - 11, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 43 - } - } - } - ], - "range": [ - 10, - 44 - ], + "end": { + "line": 1, + "column": 44 + } + }, + "range": [ + 0, + 44 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 44, "loc": { "start": { "line": 1, - "column": 10 + "column": 0 }, "end": { "line": 1, "column": 44 } - } - }, - "range": [ - 0, - 44 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 44 + "range": [ + 0, + 44 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "range": [ + 10, + 44 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 11, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 11, + 43 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 15, + 22 + ], + "name": "fooProp" + }, + "static": false, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 22, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 22, + 43 + ], + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 23, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 23, + 35 + ], + "name": "value", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 28, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 28, + 35 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 29, + 35 + ] + } + } + } + ], + "returnType": { + "type": "TypeAnnotation", + "start": 36, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 36, + 41 + ], + "typeAnnotation": { + "type": "VoidTypeAnnotation", + "start": 37, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 37, + 41 + ] + } + }, + "body": { + "type": "BlockStatement", + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 41, + 43 + ], + "body": [] + } + } + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/29/expected.json b/test/fixtures/flow/type-annotations/29/expected.json index a3bb3095e6..f26fac79ac 100644 --- a/test/fixtures/flow/type-annotations/29/expected.json +++ b/test/fixtures/flow/type-annotations/29/expected.json @@ -1,157 +1,226 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 6, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "fooProp", - "range": [ - 15, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 31, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 25, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "range": [ - 24, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - }, - "kind": "get", - "static": false, - "computed": false, - "range": [ - 11, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], - "range": [ - 10, - 34 - ], + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 34, "loc": { "start": { "line": 1, - "column": 10 + "column": 0 }, "end": { "line": 1, "column": 34 } - } - }, - "range": [ - 0, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 34 + "range": [ + 0, + 34 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 10, + 34 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 11, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 11, + 33 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 15, + 22 + ], + "name": "fooProp" + }, + "static": false, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 22, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 22, + 33 + ], + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 24, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 24, + 31 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 25, + 31 + ] + } + }, + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 31, + 33 + ], + "body": [] + } + } + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/3/expected.json b/test/fixtures/flow/type-annotations/3/expected.json index 83dee7a1a3..0bdd543bab 100644 --- a/test/fixtures/flow/type-annotations/3/expected.json +++ b/test/fixtures/flow/type-annotations/3/expected.json @@ -1,166 +1,221 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "range": [ + 0, + 46 + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [ - { - "type": "Identifier", - "name": "numVal", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 21, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "range": [ - 19, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "range": [ - 13, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - { - "type": "Identifier", - "name": "strVal", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "StringTypeAnnotation", - "range": [ - 37, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - } - }, - "range": [ - 35, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 43 - } - } - }, - "range": [ - 29, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 43 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 44, - 46 - ], + "end": { + "line": 1, + "column": 46 + } + }, + "range": [ + 0, + 46 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, "loc": { "start": { "line": 1, - "column": 44 + "column": 0 }, "end": { "line": 1, "column": 46 } - } - }, - "generator": false, - "expression": false, - "range": [ - 0, - 46 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 46 + "range": [ + 0, + 46 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 13, + 27 + ], + "name": "numVal", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 19, + 27 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 21, + 27 + ] + } + } + }, + { + "type": "Identifier", + "start": 29, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 29, + 43 + ], + "name": "strVal", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 35, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 35, + 43 + ], + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 37, + 43 + ] + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 44, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "range": [ + 44, + 46 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/30/expected.json b/test/fixtures/flow/type-annotations/30/expected.json index 89443eb7be..dca8ca420e 100644 --- a/test/fixtures/flow/type-annotations/30/expected.json +++ b/test/fixtures/flow/type-annotations/30/expected.json @@ -1,52 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "numVal", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 11, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 10, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 4, - 17 - ], + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 17, "loc": { "start": { "line": 1, @@ -56,40 +68,74 @@ "line": 1, "column": 17 } - } - }, - "init": null, - "range": [ - 4, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 17 - } + "range": [ + 4, + 17 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 4, + 17 + ], + "name": "numVal", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 10, + 17 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 11, + 17 + ] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/31/expected.json b/test/fixtures/flow/type-annotations/31/expected.json index 39c7ddfc74..2309396519 100644 --- a/test/fixtures/flow/type-annotations/31/expected.json +++ b/test/fixtures/flow/type-annotations/31/expected.json @@ -1,112 +1,160 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "numVal", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 11, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 10, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 4, - 17 - ], + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 0, + 32 + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 0, + 32 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 0, + 32 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 31, "loc": { "start": { "line": 1, "column": 4 }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "init": { - "type": "Identifier", - "name": "otherNumVal", - "range": [ - 20, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, "end": { "line": 1, "column": 31 } - } - }, - "range": [ - 4, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 31 + "range": [ + 4, + 31 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 4, + 17 + ], + "name": "numVal", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 10, + 17 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 11, + 17 + ] + } + } + }, + "init": { + "type": "Identifier", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 20, + 31 + ], + "name": "otherNumVal" } } - } - ], - "kind": "var", - "range": [ - 0, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/32/expected.json b/test/fixtures/flow/type-annotations/32/expected.json index 4b63d491a9..d00a84a079 100644 --- a/test/fixtures/flow/type-annotations/32/expected.json +++ b/test/fixtures/flow/type-annotations/32/expected.json @@ -1,109 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "numVal", - "range": [ - 8, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "NumberTypeAnnotation", - "range": [ - 16, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "optional": false, - "range": [ - 8, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 7, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 5, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 4, - 23 - ], + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 23, "loc": { "start": { "line": 1, @@ -113,40 +68,137 @@ "line": 1, "column": 23 } - } - }, - "init": null, - "range": [ - 4, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 23 - } + "range": [ + 4, + 23 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 4, + 23 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 5, + 23 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 7, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 7, + 23 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 8, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 8, + 22 + ], + "key": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ], + "name": "numVal" + }, + "value": { + "type": "NumberTypeAnnotation", + "start": 16, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 16, + 22 + ] + }, + "optional": false + } + ], + "indexers": [] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/33/expected.json b/test/fixtures/flow/type-annotations/33/expected.json index 4b101d2348..acdc41cb63 100644 --- a/test/fixtures/flow/type-annotations/33/expected.json +++ b/test/fixtures/flow/type-annotations/33/expected.json @@ -1,109 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "numVal", - "range": [ - 8, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "NumberTypeAnnotation", - "range": [ - 16, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "optional": false, - "range": [ - 8, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 7, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "range": [ - 5, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "range": [ - 4, - 24 - ], + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 24, "loc": { "start": { "line": 1, @@ -113,40 +68,137 @@ "line": 1, "column": 24 } - } - }, - "init": null, - "range": [ - 4, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 24 - } + "range": [ + 4, + 24 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 4, + 24 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 5, + 24 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 7, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 7, + 24 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 8, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 8, + 23 + ], + "key": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ], + "name": "numVal" + }, + "value": { + "type": "NumberTypeAnnotation", + "start": 16, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 16, + 22 + ] + }, + "optional": false + } + ], + "indexers": [] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/34/expected.json b/test/fixtures/flow/type-annotations/34/expected.json index 26293cff32..0cd0e5330a 100644 --- a/test/fixtures/flow/type-annotations/34/expected.json +++ b/test/fixtures/flow/type-annotations/34/expected.json @@ -1,179 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "numVal", - "range": [ - 8, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "NumberTypeAnnotation", - "range": [ - 16, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "optional": false, - "range": [ - 8, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], - "indexers": [ - { - "type": "ObjectTypeIndexer", - "id": { - "type": "Identifier", - "name": "indexer", - "range": [ - 25, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "key": { - "type": "StringTypeAnnotation", - "range": [ - 34, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "value": { - "type": "NumberTypeAnnotation", - "range": [ - 43, - 49 - ], - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, - "range": [ - 24, - 49 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 49 - } - } - } - ], - "callProperties": [], - "range": [ - 7, - 50 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - "range": [ - 5, - 50 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - "range": [ - 4, - 50 - ], + "type": "File", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 0, + 51 + ], + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 0, + 51 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 0, + 51 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 50, "loc": { "start": { "line": 1, @@ -183,40 +68,215 @@ "line": 1, "column": 50 } - } - }, - "init": null, - "range": [ - 4, - 50 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 50 - } + "range": [ + 4, + 50 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 4, + 50 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 5, + 50 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 7, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 7, + 50 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 8, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 8, + 23 + ], + "key": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ], + "name": "numVal" + }, + "value": { + "type": "NumberTypeAnnotation", + "start": 16, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 16, + 22 + ] + }, + "optional": false + } + ], + "indexers": [ + { + "type": "ObjectTypeIndexer", + "start": 24, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 24, + 49 + ], + "id": { + "type": "Identifier", + "start": 25, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 25, + 32 + ], + "name": "indexer" + }, + "key": { + "type": "StringTypeAnnotation", + "start": 34, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 34, + 40 + ] + }, + "value": { + "type": "NumberTypeAnnotation", + "start": 43, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 43, + 49 + ] + } + } + ] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 51 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/35/expected.json b/test/fixtures/flow/type-annotations/35/expected.json index 06959ace4b..2b9de38f4e 100644 --- a/test/fixtures/flow/type-annotations/35/expected.json +++ b/test/fixtures/flow/type-annotations/35/expected.json @@ -1,126 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "numVal", - "range": [ - 9, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "value": { - "type": "NumberTypeAnnotation", - "range": [ - 17, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "optional": false, - "range": [ - 9, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 8, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "range": [ - 7, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "range": [ - 5, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "range": [ - 4, - 24 - ], + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 24, "loc": { "start": { "line": 1, @@ -130,40 +68,156 @@ "line": 1, "column": 24 } - } - }, - "init": null, - "range": [ - 4, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 24 - } + "range": [ + 4, + 24 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 4, + 24 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 5, + 24 + ], + "typeAnnotation": { + "type": "NullableTypeAnnotation", + "start": 7, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 7, + 24 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 8, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 8, + 24 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 9, + 23 + ], + "key": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 9, + 15 + ], + "name": "numVal" + }, + "value": { + "type": "NumberTypeAnnotation", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 17, + 23 + ] + }, + "optional": false + } + ], + "indexers": [] + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/36/expected.json b/test/fixtures/flow/type-annotations/36/expected.json index 331c7a3889..9093975008 100644 --- a/test/fixtures/flow/type-annotations/36/expected.json +++ b/test/fixtures/flow/type-annotations/36/expected.json @@ -1,162 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "numVal", - "range": [ - 8, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "NumberTypeAnnotation", - "range": [ - 16, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "optional": false, - "range": [ - 8, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "strVal", - "range": [ - 24, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 32, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "optional": false, - "range": [ - 24, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 38 - } - } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 7, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "range": [ - 5, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "range": [ - 4, - 39 - ], + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 39, "loc": { "start": { "line": 1, @@ -166,40 +68,196 @@ "line": 1, "column": 39 } - } - }, - "init": null, - "range": [ - 4, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 39 - } + "range": [ + 4, + 39 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 4, + 39 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 5, + 39 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 7, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 7, + 39 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 8, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 8, + 23 + ], + "key": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ], + "name": "numVal" + }, + "value": { + "type": "NumberTypeAnnotation", + "start": 16, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 16, + 22 + ] + }, + "optional": false + }, + { + "type": "ObjectTypeProperty", + "start": 24, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 24, + 38 + ], + "key": { + "type": "Identifier", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 24, + 30 + ], + "name": "strVal" + }, + "value": { + "type": "StringTypeAnnotation", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 32, + 38 + ] + }, + "optional": false + } + ], + "indexers": [] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 39 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/37/expected.json b/test/fixtures/flow/type-annotations/37/expected.json index 8f00bfca16..5aa79b3015 100644 --- a/test/fixtures/flow/type-annotations/37/expected.json +++ b/test/fixtures/flow/type-annotations/37/expected.json @@ -1,166 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "subObj", - "range": [ - 8, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "strVal", - "range": [ - 17, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 25, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "optional": false, - "range": [ - 17, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 16, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "optional": false, - "range": [ - 8, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 7, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "range": [ - 5, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "range": [ - 4, - 33 - ], + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 33, "loc": { "start": { "line": 1, @@ -170,40 +68,200 @@ "line": 1, "column": 33 } - } - }, - "init": null, - "range": [ - 4, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 33 - } + "range": [ + 4, + 33 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 4, + 33 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 5, + 33 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 7, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 7, + 33 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 8, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 8, + 32 + ], + "key": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ], + "name": "subObj" + }, + "value": { + "type": "ObjectTypeAnnotation", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 16, + 32 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 17, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 17, + 31 + ], + "key": { + "type": "Identifier", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 17, + 23 + ], + "name": "strVal" + }, + "value": { + "type": "StringTypeAnnotation", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 25, + 31 + ] + }, + "optional": false + } + ], + "indexers": [] + }, + "optional": false + } + ], + "indexers": [] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/38/expected.json b/test/fixtures/flow/type-annotations/38/expected.json index dae72bffc4..3a78c154cd 100644 --- a/test/fixtures/flow/type-annotations/38/expected.json +++ b/test/fixtures/flow/type-annotations/38/expected.json @@ -1,183 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "subObj", - "range": [ - 8, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "NullableTypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "strVal", - "range": [ - 18, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 26, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "optional": false, - "range": [ - 18, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 17, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "range": [ - 16, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "optional": false, - "range": [ - 8, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 7, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "range": [ - 5, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "range": [ - 4, - 34 - ], + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 34, "loc": { "start": { "line": 1, @@ -187,40 +68,219 @@ "line": 1, "column": 34 } - } - }, - "init": null, - "range": [ - 4, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 34 - } + "range": [ + 4, + 34 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 4, + 34 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 5, + 34 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 7, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 7, + 34 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 8, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 8, + 33 + ], + "key": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ], + "name": "subObj" + }, + "value": { + "type": "NullableTypeAnnotation", + "start": 16, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 16, + 33 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 17, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 17, + 33 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 18, + 32 + ], + "key": { + "type": "Identifier", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 18, + 24 + ], + "name": "strVal" + }, + "value": { + "type": "StringTypeAnnotation", + "start": 26, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 26, + 32 + ] + }, + "optional": false + } + ], + "indexers": [] + } + }, + "optional": false + } + ], + "indexers": [] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/39/expected.json b/test/fixtures/flow/type-annotations/39/expected.json index 0e9cb84498..40ec767918 100644 --- a/test/fixtures/flow/type-annotations/39/expected.json +++ b/test/fixtures/flow/type-annotations/39/expected.json @@ -1,162 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "param1", - "range": [ - 8, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "NumberTypeAnnotation", - "range": [ - 16, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "optional": false, - "range": [ - 8, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "param2", - "range": [ - 24, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 32, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "optional": false, - "range": [ - 24, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 38 - } - } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 7, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "range": [ - 5, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "range": [ - 4, - 39 - ], + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 39, "loc": { "start": { "line": 1, @@ -166,40 +68,196 @@ "line": 1, "column": 39 } - } - }, - "init": null, - "range": [ - 4, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 39 - } + "range": [ + 4, + 39 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 4, + 39 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 5, + 39 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 7, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 7, + 39 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 8, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 8, + 23 + ], + "key": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ], + "name": "param1" + }, + "value": { + "type": "NumberTypeAnnotation", + "start": 16, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 16, + 22 + ] + }, + "optional": false + }, + { + "type": "ObjectTypeProperty", + "start": 24, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 24, + 38 + ], + "key": { + "type": "Identifier", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 24, + 30 + ], + "name": "param2" + }, + "value": { + "type": "StringTypeAnnotation", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 32, + 38 + ] + }, + "optional": false + } + ], + "indexers": [] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 39 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/4/expected.json b/test/fixtures/flow/type-annotations/4/expected.json index a4222967d1..7ce85f36ab 100644 --- a/test/fixtures/flow/type-annotations/4/expected.json +++ b/test/fixtures/flow/type-annotations/4/expected.json @@ -1,132 +1,183 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 0, + 42 + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [ - { - "type": "Identifier", - "name": "numVal", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 21, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "range": [ - 19, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "range": [ - 13, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - { - "type": "Identifier", - "name": "untypedVal", - "range": [ - 29, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 39 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 40, - 42 - ], + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 0, + 42 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 42, "loc": { "start": { "line": 1, - "column": 40 + "column": 0 }, "end": { "line": 1, "column": 42 } - } - }, - "generator": false, - "expression": false, - "range": [ - 0, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 42 + "range": [ + 0, + 42 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 13, + 27 + ], + "name": "numVal", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 19, + 27 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 21, + 27 + ] + } + } + }, + { + "type": "Identifier", + "start": 29, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 29, + 39 + ], + "name": "untypedVal" + } + ], + "body": { + "type": "BlockStatement", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 40, + 42 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/40/expected.json b/test/fixtures/flow/type-annotations/40/expected.json index 5ff662c905..c5ecc72929 100644 --- a/test/fixtures/flow/type-annotations/40/expected.json +++ b/test/fixtures/flow/type-annotations/40/expected.json @@ -1,162 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "param1", - "range": [ - 8, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "NumberTypeAnnotation", - "range": [ - 16, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "optional": false, - "range": [ - 8, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "param2", - "range": [ - 24, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 33, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "optional": true, - "range": [ - 24, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 39 - } - } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 7, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "range": [ - 5, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "range": [ - 4, - 40 - ], + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 40, "loc": { "start": { "line": 1, @@ -166,40 +68,196 @@ "line": 1, "column": 40 } - } - }, - "init": null, - "range": [ - 4, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 40 - } + "range": [ + 4, + 40 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 4, + 40 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 5, + 40 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 7, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 7, + 40 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 8, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 8, + 23 + ], + "key": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ], + "name": "param1" + }, + "value": { + "type": "NumberTypeAnnotation", + "start": 16, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 16, + 22 + ] + }, + "optional": false + }, + { + "type": "ObjectTypeProperty", + "start": 24, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 24, + 39 + ], + "key": { + "type": "Identifier", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 24, + 30 + ], + "name": "param2" + }, + "value": { + "type": "StringTypeAnnotation", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 33, + 39 + ] + }, + "optional": true + } + ], + "indexers": [] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/41/expected.json b/test/fixtures/flow/type-annotations/41/expected.json index 18360aa724..96398e457e 100644 --- a/test/fixtures/flow/type-annotations/41/expected.json +++ b/test/fixtures/flow/type-annotations/41/expected.json @@ -1,194 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [], - "indexers": [ - { - "type": "ObjectTypeIndexer", - "id": { - "type": "Identifier", - "name": "a", - "range": [ - 10, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "key": { - "type": "NumberTypeAnnotation", - "range": [ - 13, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 22, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "range": [ - 9, - 29 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - { - "type": "ObjectTypeIndexer", - "id": { - "type": "Identifier", - "name": "b", - "range": [ - 31, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "key": { - "type": "NumberTypeAnnotation", - "range": [ - 34, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 43, - 49 - ], - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, - "range": [ - 30, - 50 - ], - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 50 - } - } - } - ], - "callProperties": [], - "range": [ - 7, - 52 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 52 - } - } - }, - "range": [ - 5, - 52 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 52 - } - } - }, - "range": [ - 4, - 52 - ], + "type": "File", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 0, + 53 + ], + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 0, + 53 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 0, + 53 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 52, "loc": { "start": { "line": 1, @@ -198,40 +68,232 @@ "line": 1, "column": 52 } - } - }, - "init": null, - "range": [ - 4, - 52 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 52 - } + "range": [ + 4, + 52 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 4, + 52 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 5, + 52 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 7, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 7, + 52 + ], + "callProperties": [], + "properties": [], + "indexers": [ + { + "type": "ObjectTypeIndexer", + "start": 9, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 9, + 29 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "a" + }, + "key": { + "type": "NumberTypeAnnotation", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 13, + 19 + ] + }, + "value": { + "type": "StringTypeAnnotation", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 22, + 28 + ] + } + }, + { + "type": "ObjectTypeIndexer", + "start": 30, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 30, + 50 + ], + "id": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 31, + 32 + ], + "name": "b" + }, + "key": { + "type": "NumberTypeAnnotation", + "start": 34, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 34, + 40 + ] + }, + "value": { + "type": "StringTypeAnnotation", + "start": 43, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 43, + 49 + ] + } + } + ] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 53 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/42/expected.json b/test/fixtures/flow/type-annotations/42/expected.json index 824cb65c30..9c2be00f41 100644 --- a/test/fixtures/flow/type-annotations/42/expected.json +++ b/test/fixtures/flow/type-annotations/42/expected.json @@ -1,289 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "add", - "range": [ - 8, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "value": { - "type": "FunctionTypeAnnotation", - "params": [ - { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "x", - "range": [ - 12, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 14, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "optional": false, - "range": [ - 12, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "returnType": { - "type": "VoidTypeAnnotation", - "range": [ - 43, - 47 - ], - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 47 - } - } - }, - "rest": { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "y", - "range": [ - 25, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "Array", - "range": [ - 27, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "StringTypeAnnotation", - "range": [ - 33, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } - } - ], - "range": [ - 32, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "range": [ - 27, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "optional": false, - "range": [ - 25, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "typeParameters": null, - "range": [ - 8, - 47 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 47 - } - } - }, - "optional": false, - "range": [ - 8, - 47 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 47 - } - } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 7, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 48 - } - } - }, - "range": [ - 5, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 48 - } - } - }, - "range": [ - 4, - 48 - ], + "type": "File", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 0, + 48 + ], + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 0, + 48 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 0, + 48 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 48, "loc": { "start": { "line": 1, @@ -293,40 +68,337 @@ "line": 1, "column": 48 } - } - }, - "init": null, - "range": [ - 4, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 48 - } + "range": [ + 4, + 48 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 4, + 48 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 5, + 48 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 7, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 7, + 48 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 8, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 8, + 47 + ], + "value": { + "type": "FunctionTypeAnnotation", + "start": 8, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 8, + 47 + ], + "params": [ + { + "type": "FunctionTypeParam", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 12, + 20 + ], + "name": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "x" + }, + "optional": false, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 14, + 20 + ] + } + } + ], + "rest": { + "type": "FunctionTypeParam", + "start": 25, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 25, + 40 + ], + "name": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 25, + 26 + ], + "name": "y" + }, + "optional": false, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 27, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 27, + 40 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 32, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 32, + 40 + ], + "params": [ + { + "type": "StringTypeAnnotation", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 33, + 39 + ] + } + ] + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 27, + 32 + ], + "name": "Array" + } + } + }, + "typeParameters": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 43, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 43, + 47 + ] + } + }, + "key": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 8, + 11 + ], + "name": "add" + }, + "optional": false + } + ], + "indexers": [] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/43/expected.json b/test/fixtures/flow/type-annotations/43/expected.json index 3885457e32..e42a7d9b4d 100644 --- a/test/fixtures/flow/type-annotations/43/expected.json +++ b/test/fixtures/flow/type-annotations/43/expected.json @@ -1,256 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "id", - "range": [ - 9, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "value": { - "type": "FunctionTypeAnnotation", - "params": [ - { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "x", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 18, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "typeParameters": null, - "range": [ - 18, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "optional": false, - "range": [ - 15, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "returnType": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 22, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "typeParameters": null, - "range": [ - 22, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 12, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], - "range": [ - 11, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 9, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "optional": false, - "range": [ - 9, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 7, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "range": [ - 5, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "range": [ - 4, - 26 - ], + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 26, "loc": { "start": { "line": 1, @@ -260,40 +68,301 @@ "line": 1, "column": 26 } - } - }, - "init": null, - "range": [ - 4, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 26 - } + "range": [ + 4, + 26 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 4, + 26 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 5, + 26 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 7, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 7, + 26 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 9, + 24 + ], + "value": { + "type": "FunctionTypeAnnotation", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 9, + 23 + ], + "params": [ + { + "type": "FunctionTypeParam", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 15, + 19 + ], + "name": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "x" + }, + "optional": false, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "T" + } + } + } + ], + "rest": null, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 11, + 14 + ], + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "T" + } + ] + }, + "returnType": { + "type": "GenericTypeAnnotation", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ], + "name": "T" + } + } + }, + "key": { + "type": "Identifier", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 9, + 11 + ], + "name": "id" + }, + "optional": false + } + ], + "indexers": [] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/44/expected.json b/test/fixtures/flow/type-annotations/44/expected.json index 308559f8a1..b027843b97 100644 --- a/test/fixtures/flow/type-annotations/44/expected.json +++ b/test/fixtures/flow/type-annotations/44/expected.json @@ -1,224 +1,287 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "Array", - "range": [ - 6, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "NumberTypeAnnotation", - "range": [ - 12, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "range": [ - 11, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "range": [ - 6, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "range": [ - 5, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "range": [ - 4, - 19 - ], + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 31, "loc": { "start": { "line": 1, "column": 4 }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "init": { - "type": "ArrayExpression", - "elements": [ - { - "type": "Literal", - "value": 1, - "raw": "1", - "range": [ - 23, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - { - "type": "Literal", - "value": 2, - "raw": "2", - "range": [ - 26, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - { - "type": "Literal", - "value": 3, - "raw": "3", - "range": [ - 29, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], - "range": [ - 22, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, "end": { "line": 1, "column": 31 } - } - }, - "range": [ - 4, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 31 + "range": [ + 4, + 31 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 4, + 19 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 5, + 19 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 6, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 6, + 19 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 11, + 19 + ], + "params": [ + { + "type": "NumberTypeAnnotation", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 12, + 18 + ] + } + ] + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 6, + 11 + ], + "name": "Array" + } + } + } + }, + "init": { + "type": "ArrayExpression", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 22, + 31 + ], + "elements": [ + { + "type": "Literal", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 23, + 24 + ], + "value": 1, + "rawValue": 1, + "raw": "1" + }, + { + "type": "Literal", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 26, + 27 + ], + "value": 2, + "rawValue": 2, + "raw": "2" + }, + { + "type": "Literal", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 29, + 30 + ], + "value": 3, + "rawValue": 3, + "raw": "3" + } + ] } } - } - ], - "kind": "var", - "range": [ - 0, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/45/expected.json b/test/fixtures/flow/type-annotations/45/expected.json index 0688e7bd4d..eb5d7b33da 100644 --- a/test/fixtures/flow/type-annotations/45/expected.json +++ b/test/fixtures/flow/type-annotations/45/expected.json @@ -1,124 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "a", - "range": [ - 0, - 1 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ClassExpression", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 10, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [], - "range": [ - 17, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "range": [ - 13, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "range": [ - 4, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "range": [ - 0, - 20 - ], + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, @@ -128,22 +49,153 @@ "line": 1, "column": 20 } - } - }, - "range": [ - 0, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 20 + "range": [ + 0, + 20 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "a" + }, + "right": { + "type": "ClassExpression", + "start": 4, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 4, + 20 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 10, + 13 + ], + "name": "Foo" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 13, + 16 + ], + "params": [ + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "T" + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 17, + 20 + ], + "body": [] + } + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/46/expected.json b/test/fixtures/flow/type-annotations/46/expected.json index e7120f70bd..2ea6469bc6 100644 --- a/test/fixtures/flow/type-annotations/46/expected.json +++ b/test/fixtures/flow/type-annotations/46/expected.json @@ -1,196 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "a", - "range": [ - 0, - 1 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ClassExpression", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 10, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "Bar", - "range": [ - 25, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "body": { - "type": "ClassBody", - "body": [], - "range": [ - 32, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "range": [ - 13, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "superTypeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 29, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "typeParameters": null, - "range": [ - 29, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], - "range": [ - 28, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "range": [ - 4, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "range": [ - 0, - 35 - ], + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 35, "loc": { "start": { "line": 1, @@ -200,22 +49,233 @@ "line": 1, "column": 35 } - } - }, - "range": [ - 0, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 35 + "range": [ + 0, + 35 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "a" + }, + "right": { + "type": "ClassExpression", + "start": 4, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 4, + 35 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 10, + 13 + ], + "name": "Foo" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 13, + 16 + ], + "params": [ + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "T" + } + ] + }, + "superClass": { + "type": "Identifier", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 25, + 28 + ], + "name": "Bar" + }, + "superTypeParameters": { + "type": "TypeParameterInstantiation", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 28, + 31 + ], + "params": [ + { + "type": "GenericTypeAnnotation", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 29, + 30 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 29, + 30 + ], + "name": "T" + } + } + ] + }, + "body": { + "type": "ClassBody", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 32, + 35 + ], + "body": [] + } + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/47/expected.json b/test/fixtures/flow/type-annotations/47/expected.json index 522c5a77ac..0444ffe366 100644 --- a/test/fixtures/flow/type-annotations/47/expected.json +++ b/test/fixtures/flow/type-annotations/47/expected.json @@ -1,96 +1,142 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 6, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [], - "range": [ - 13, - 15 - ], + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, - "column": 13 + "column": 0 }, "end": { "line": 1, "column": 15 } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 10, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "range": [ - 0, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 15 + "range": [ + 0, + 15 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "name": "Foo" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "params": [ + { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "T" + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 13, + 15 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/48/expected.json b/test/fixtures/flow/type-annotations/48/expected.json index e7c2e898f3..785b8f31d3 100644 --- a/test/fixtures/flow/type-annotations/48/expected.json +++ b/test/fixtures/flow/type-annotations/48/expected.json @@ -1,111 +1,163 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 6, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "superClass": { - "type": "Identifier", - "name": "Bar", - "range": [ - 21, - 24 - ], + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 31, "loc": { "start": { "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "body": { - "type": "ClassBody", - "body": [], - "range": [ - 28, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 28 + "column": 0 }, "end": { "line": 1, "column": 31 } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 10, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + }, "range": [ - 9, - 12 + 0, + 31 ], - "loc": { - "start": { - "line": 1, - "column": 9 + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "superTypeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "GenericTypeAnnotation", - "id": { + "range": [ + 6, + 9 + ], + "name": "Foo" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "params": [ + { "type": "Identifier", - "name": "T", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, "range": [ - 25, - 26 + 10, + 11 ], + "name": "T" + } + ] + }, + "superClass": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 21, + 24 + ], + "name": "Bar" + }, + "superTypeParameters": { + "type": "TypeParameterInstantiation", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 24, + 27 + ], + "params": [ + { + "type": "GenericTypeAnnotation", + "start": 25, + "end": 26, "loc": { "start": { "line": 1, @@ -115,54 +167,56 @@ "line": 1, "column": 26 } - } - }, - "typeParameters": null, - "range": [ - 25, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 25 }, - "end": { - "line": 1, - "column": 26 + "range": [ + 25, + 26 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 25, + 26 + ], + "name": "T" } } - } - ], - "range": [ - 24, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "range": [ - 0, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 0 + ] }, - "end": { - "line": 1, - "column": 31 + "body": { + "type": "ClassBody", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 28, + 31 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/49/expected.json b/test/fixtures/flow/type-annotations/49/expected.json index 14dc011b9f..ee26a61f91 100644 --- a/test/fixtures/flow/type-annotations/49/expected.json +++ b/test/fixtures/flow/type-annotations/49/expected.json @@ -1,35 +1,124 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 6, - 9 - ], + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 35, "loc": { "start": { "line": 1, - "column": 6 + "column": 0 }, "end": { "line": 1, - "column": 9 + "column": 35 } - } - }, - "superClass": { - "type": "CallExpression", - "callee": { + }, + "range": [ + 0, + 35 + ], + "id": { "type": "Identifier", - "name": "mixin", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, "range": [ - 21, - 26 + 6, + 9 ], + "name": "Foo" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "params": [ + { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "T" + } + ] + }, + "superClass": { + "type": "CallExpression", + "start": 21, + "end": 31, "loc": { "start": { "line": 1, @@ -37,114 +126,77 @@ }, "end": { "line": 1, - "column": 26 + "column": 31 } - } - }, - "arguments": [ - { + }, + "range": [ + 21, + 31 + ], + "callee": { "type": "Identifier", - "name": "Bar", - "range": [ - 27, - 30 - ], + "start": 21, + "end": 26, "loc": { "start": { "line": 1, - "column": 27 + "column": 21 }, "end": { "line": 1, - "column": 30 + "column": 26 } - } - } - ], - "range": [ - 21, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "body": { - "type": "ClassBody", - "body": [], - "range": [ - 32, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", + }, "range": [ - 10, - 11 + 21, + 26 ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 + "name": "mixin" }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "range": [ - 0, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 0 + "arguments": [ + { + "type": "Identifier", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 27, + 30 + ], + "name": "Bar" + } + ] }, - "end": { - "line": 1, - "column": 35 + "body": { + "type": "ClassBody", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 32, + 35 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/5/expected.json b/test/fixtures/flow/type-annotations/5/expected.json index c80fea8476..f1a8bb2032 100644 --- a/test/fixtures/flow/type-annotations/5/expected.json +++ b/test/fixtures/flow/type-annotations/5/expected.json @@ -1,132 +1,183 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 0, + 42 + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [ - { - "type": "Identifier", - "name": "untypedVal", - "range": [ - 13, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - { - "type": "Identifier", - "name": "numVal", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 33, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "range": [ - 31, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "range": [ - 25, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 39 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 40, - 42 - ], + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 0, + 42 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 42, "loc": { "start": { "line": 1, - "column": 40 + "column": 0 }, "end": { "line": 1, "column": 42 } - } - }, - "generator": false, - "expression": false, - "range": [ - 0, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 42 + "range": [ + 0, + 42 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 13, + 23 + ], + "name": "untypedVal" + }, + { + "type": "Identifier", + "start": 25, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 25, + 39 + ], + "name": "numVal", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 31, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 31, + 39 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 33, + 39 + ] + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 40, + 42 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/50/expected.json b/test/fixtures/flow/type-annotations/50/expected.json index 7f08b387b1..9b3fd7ae85 100644 --- a/test/fixtures/flow/type-annotations/50/expected.json +++ b/test/fixtures/flow/type-annotations/50/expected.json @@ -1,39 +1,144 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 6, - 9 - ], + "type": "File", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "range": [ + 0, + 46 + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "range": [ + 0, + 46 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 46, "loc": { "start": { "line": 1, - "column": 6 + "column": 0 }, "end": { "line": 1, - "column": 9 + "column": 46 } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "key": { + }, + "range": [ + 0, + 46 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "name": "Foo" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "params": [ + { "type": "Identifier", - "name": "bar", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, "range": [ - 15, - 18 + 10, + 11 ], + "name": "T" + } + ] + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 13, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "range": [ + 13, + 46 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 15, + "end": 45, "loc": { "start": { "line": 1, @@ -41,228 +146,205 @@ }, "end": { "line": 1, - "column": 18 + "column": 45 } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": { - "type": "Literal", - "value": 42, - "raw": "42", - "range": [ - 40, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - } - }, - "range": [ - 33, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 43 - } - } - } - ], - "range": [ - 31, - 45 - ], + }, + "range": [ + 15, + 45 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 18, "loc": { "start": { "line": 1, - "column": 31 + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 15, + 18 + ], + "name": "bar" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 21, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 21 }, "end": { "line": 1, "column": 45 } - } - }, - "generator": false, - "expression": false, - "returnType": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 24, - 30 - ], + }, + "range": [ + 21, + 45 + ], + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 23, + "end": 30, "loc": { "start": { "line": 1, - "column": 24 + "column": 23 }, "end": { "line": 1, "column": 30 } - } - }, - "range": [ - 23, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 23 }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "U", - "range": [ - 19, - 20 - ], + "range": [ + 23, + 30 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 24, + "end": 30, "loc": { "start": { "line": 1, - "column": 19 + "column": 24 }, "end": { "line": 1, - "column": 20 + "column": 30 + } + }, + "range": [ + 24, + 30 + ] + } + }, + "body": { + "type": "BlockStatement", + "start": 31, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 31, + 45 + ], + "body": [ + { + "type": "ReturnStatement", + "start": 33, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 33, + 43 + ], + "argument": { + "type": "Literal", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 40, + 42 + ], + "value": 42, + "rawValue": 42, + "raw": "42" } } - } - ], - "range": [ - 18, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 18 + ] + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } }, - "end": { - "line": 1, - "column": 21 - } + "range": [ + 18, + 21 + ], + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ], + "name": "U" + } + ] } } - }, - "kind": "method", - "static": false, - "computed": false, - "range": [ - 15, - 45 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 45 - } } - } - ], - "range": [ - 13, - 46 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 46 - } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 10, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "range": [ - 0, - 46 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 46 + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/51/expected.json b/test/fixtures/flow/type-annotations/51/expected.json index a88372288b..6ca5e497b4 100644 --- a/test/fixtures/flow/type-annotations/51/expected.json +++ b/test/fixtures/flow/type-annotations/51/expected.json @@ -1,40 +1,103 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 6, - 9 - ], + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 28, "loc": { "start": { "line": 1, - "column": 6 + "column": 0 }, "end": { "line": 1, - "column": 9 + "column": 28 } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Literal", - "value": "bar", - "raw": "\"bar\"", - "range": [ - 12, - 17 - ], + }, + "range": [ + 0, + 28 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 10, + 28 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 12, + "end": 26, "loc": { "start": { "line": 1, @@ -42,120 +105,127 @@ }, "end": { "line": 1, - "column": 17 + "column": 26 } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 23, - 26 - ], + }, + "range": [ + 12, + 26 + ], + "computed": false, + "key": { + "type": "Literal", + "start": 12, + "end": 17, "loc": { "start": { "line": 1, - "column": 23 + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 12, + 17 + ], + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 }, "end": { "line": 1, "column": 26 } - } - }, - "generator": false, - "expression": false, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 18, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], + }, "range": [ - 17, - 20 + 20, + 26 ], - "loc": { - "start": { - "line": 1, - "column": 17 + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 26 + } }, - "end": { - "line": 1, - "column": 20 - } + "range": [ + 23, + 26 + ], + "body": [] + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 17, + 20 + ], + "params": [ + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "T" + } + ] } } - }, - "kind": "method", - "static": false, - "computed": false, - "range": [ - 12, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 26 - } } - } - ], - "range": [ - 10, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "range": [ - 0, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/52/expected.json b/test/fixtures/flow/type-annotations/52/expected.json index a4cdabe917..c24c6aa556 100644 --- a/test/fixtures/flow/type-annotations/52/expected.json +++ b/test/fixtures/flow/type-annotations/52/expected.json @@ -1,99 +1,146 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [ - { - "type": "Identifier", - "name": "requiredParam", - "range": [ - 13, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - { - "type": "Identifier", - "name": "optParam", - "optional": true, - "range": [ - 28, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 37 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 39, - 41 - ], + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, "loc": { "start": { "line": 1, - "column": 39 + "column": 0 }, "end": { "line": 1, "column": 41 } - } - }, - "generator": false, - "expression": false, - "range": [ - 0, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 41 + "range": [ + 0, + 41 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 13, + 26 + ], + "name": "requiredParam" + }, + { + "type": "Identifier", + "start": 28, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 28, + 37 + ], + "name": "optParam", + "optional": true + } + ], + "body": { + "type": "BlockStatement", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 39, + 41 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/53/expected.json b/test/fixtures/flow/type-annotations/53/expected.json index 6a00e4557a..10e10ec8dc 100644 --- a/test/fixtures/flow/type-annotations/53/expected.json +++ b/test/fixtures/flow/type-annotations/53/expected.json @@ -1,39 +1,103 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 6, - 9 - ], + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 41, "loc": { "start": { "line": 1, - "column": 6 + "column": 0 }, "end": { "line": 1, - "column": 9 + "column": 41 } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "prop1", - "range": [ - 12, - 17 - ], + }, + "range": [ + 0, + 41 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 10, + 41 + ], + "body": [ + { + "type": "ClassProperty", + "start": 12, + "end": 25, "loc": { "start": { "line": 1, @@ -41,70 +105,79 @@ }, "end": { "line": 1, - "column": 17 + "column": 25 } - } - }, - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "StringTypeAnnotation", - "range": [ - 18, - 24 - ], + }, + "range": [ + 12, + 25 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 17, "loc": { "start": { "line": 1, - "column": 18 + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 12, + 17 + ], + "name": "prop1" + }, + "static": false, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 17, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 17 }, "end": { "line": 1, "column": 24 } - } - }, - "range": [ - 17, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 17 }, - "end": { - "line": 1, - "column": 24 + "range": [ + 17, + 24 + ], + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 18, + 24 + ] } - } - }, - "computed": false, - "static": false, - "range": [ - 12, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 12 }, - "end": { - "line": 1, - "column": 25 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "prop2", - "range": [ - 26, - 31 - ], + "value": null + }, + { + "type": "ClassProperty", + "start": 26, + "end": 39, "loc": { "start": { "line": 1, @@ -112,91 +185,78 @@ }, "end": { "line": 1, - "column": 31 + "column": 39 } - } - }, - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 32, - 38 - ], + }, + "range": [ + 26, + 39 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 26, + "end": 31, "loc": { "start": { "line": 1, - "column": 32 + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 26, + 31 + ], + "name": "prop2" + }, + "static": false, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 31, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 31 }, "end": { "line": 1, "column": 38 } - } - }, - "range": [ - 31, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 31 }, - "end": { - "line": 1, - "column": 38 + "range": [ + 31, + 38 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 32, + 38 + ] } - } - }, - "computed": false, - "static": false, - "range": [ - 26, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 26 }, - "end": { - "line": 1, - "column": 39 - } + "value": null } - } - ], - "range": [ - 10, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "range": [ - 0, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 41 + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/54/expected.json b/test/fixtures/flow/type-annotations/54/expected.json index 489510017a..487ebc6e3a 100644 --- a/test/fixtures/flow/type-annotations/54/expected.json +++ b/test/fixtures/flow/type-annotations/54/expected.json @@ -1,110 +1,183 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "range": [ - 6, - 9 - ], + "type": "File", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 0, + 48 + ], + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 0, + 48 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 48, "loc": { "start": { "line": 1, - "column": 6 + "column": 0 }, "end": { "line": 1, - "column": 9 + "column": 48 } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "prop1", - "range": [ - 19, - 24 - ], + }, + "range": [ + 0, + 48 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 10, + 48 + ], + "body": [ + { + "type": "ClassProperty", + "start": 12, + "end": 32, "loc": { "start": { "line": 1, - "column": 19 + "column": 12 }, "end": { "line": 1, - "column": 24 + "column": 32 } - } - }, - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "StringTypeAnnotation", - "range": [ - 25, - 31 - ], + }, + "range": [ + 12, + 32 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 19, + "end": 24, "loc": { "start": { "line": 1, - "column": 25 + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 19, + 24 + ], + "name": "prop1" + }, + "static": true, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 24, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 24 }, "end": { "line": 1, "column": 31 } - } - }, - "range": [ - 24, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 24 }, - "end": { - "line": 1, - "column": 31 + "range": [ + 24, + 31 + ], + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 25, + 31 + ] } - } - }, - "computed": false, - "static": true, - "range": [ - 12, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 12 }, - "end": { - "line": 1, - "column": 32 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "prop2", - "range": [ - 33, - 38 - ], + "value": null + }, + { + "type": "ClassProperty", + "start": 33, + "end": 46, "loc": { "start": { "line": 1, @@ -112,91 +185,78 @@ }, "end": { "line": 1, - "column": 38 + "column": 46 } - } - }, - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 39, - 45 - ], + }, + "range": [ + 33, + 46 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 33, + "end": 38, "loc": { "start": { "line": 1, - "column": 39 + "column": 33 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 33, + 38 + ], + "name": "prop2" + }, + "static": false, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 38, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 38 }, "end": { "line": 1, "column": 45 } - } - }, - "range": [ - 38, - 45 - ], - "loc": { - "start": { - "line": 1, - "column": 38 }, - "end": { - "line": 1, - "column": 45 + "range": [ + 38, + 45 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 39, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 39, + 45 + ] } - } - }, - "computed": false, - "static": false, - "range": [ - 33, - 46 - ], - "loc": { - "start": { - "line": 1, - "column": 33 }, - "end": { - "line": 1, - "column": 46 - } + "value": null } - } - ], - "range": [ - 10, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 48 - } - } - }, - "range": [ - 0, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/55/expected.json b/test/fixtures/flow/type-annotations/55/expected.json index cfeddf4483..5bde7c6c61 100644 --- a/test/fixtures/flow/type-annotations/55/expected.json +++ b/test/fixtures/flow/type-annotations/55/expected.json @@ -1,149 +1,202 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "UnionTypeAnnotation", - "types": [ - { - "type": "NumberTypeAnnotation", - "range": [ - 8, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "StringTypeAnnotation", - "range": [ - 17, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], - "range": [ - 8, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 6, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 4, - 23 - ], + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 27, "loc": { "start": { "line": 1, "column": 4 }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "init": { - "type": "Literal", - "value": 4, - "raw": "4", - "range": [ - 26, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, "end": { "line": 1, "column": 27 } - } - }, - "range": [ - 4, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 27 + "range": [ + 4, + 27 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 4, + 23 + ], + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 6, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 6, + 23 + ], + "typeAnnotation": { + "type": "UnionTypeAnnotation", + "start": 8, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 8, + 23 + ], + "types": [ + { + "type": "NumberTypeAnnotation", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ] + }, + { + "type": "StringTypeAnnotation", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 17, + 23 + ] + } + ] + } + } + }, + "init": { + "type": "Literal", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 26, + 27 + ], + "value": 4, + "rawValue": 4, + "raw": "4" } } - } - ], - "kind": "var", - "range": [ - 0, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/56/expected.json b/test/fixtures/flow/type-annotations/56/expected.json index 08f65c48ef..eb2a0581e7 100644 --- a/test/fixtures/flow/type-annotations/56/expected.json +++ b/test/fixtures/flow/type-annotations/56/expected.json @@ -1,39 +1,103 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Array", - "range": [ - 6, - 11 - ], + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 0, + 49 + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 0, + 49 + ], + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 49, "loc": { "start": { "line": 1, - "column": 6 + "column": 0 }, "end": { "line": 1, - "column": 11 + "column": 49 } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "concat", - "range": [ - 14, - 20 - ], + }, + "range": [ + 0, + 49 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 6, + 11 + ], + "name": "Array" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 12, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 12, + 49 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 14, + "end": 46, "loc": { "start": { "line": 1, @@ -41,172 +105,183 @@ }, "end": { "line": 1, - "column": 20 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "items", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "UnionTypeAnnotation", - "types": [ - { - "type": "NumberTypeAnnotation", - "range": [ - 27, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - { - "type": "StringTypeAnnotation", - "range": [ - 36, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - } - } - ], - "range": [ - 27, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 42 - } - } - }, - "range": [ - 26, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 42 - } - } - }, - "range": [ - 21, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 42 - } - } + "column": 46 } + }, + "range": [ + 14, + 46 ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 44, - 46 - ], + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 20, "loc": { "start": { "line": 1, - "column": 44 + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 14, + 20 + ], + "name": "concat" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 20, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 20 }, "end": { "line": 1, "column": 46 } + }, + "range": [ + 20, + 46 + ], + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 21, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 21, + 42 + ], + "name": "items", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 26, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 26, + 42 + ], + "typeAnnotation": { + "type": "UnionTypeAnnotation", + "start": 27, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 27, + 42 + ], + "types": [ + { + "type": "NumberTypeAnnotation", + "start": 27, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 27, + 33 + ] + }, + { + "type": "StringTypeAnnotation", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 36, + 42 + ] + } + ] + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 44, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "range": [ + 44, + 46 + ], + "body": [] } - }, - "generator": false, - "expression": false - }, - "kind": "method", - "static": false, - "computed": false, - "range": [ - 14, - 46 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 46 } } - } - ], - "range": [ - 12, - 49 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, - "range": [ - 0, - 49 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/57/expected.json b/test/fixtures/flow/type-annotations/57/expected.json index 919e16ca50..3904b06a9e 100644 --- a/test/fixtures/flow/type-annotations/57/expected.json +++ b/test/fixtures/flow/type-annotations/57/expected.json @@ -1,186 +1,244 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "UnionTypeAnnotation", - "types": [ - { - "type": "NumberTypeAnnotation", - "range": [ - 14, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "StringTypeAnnotation", - "range": [ - 29, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "typeParameters": null, - "range": [ - 23, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "range": [ - 14, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "typeParameters": null, - "range": [ - 8, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "range": [ - 6, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "range": [ - 4, - 35 - ], + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 40, "loc": { "start": { "line": 1, "column": 4 }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "init": { - "type": "Identifier", - "name": "fn", - "range": [ - 38, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 38 - }, "end": { "line": 1, "column": 40 } - } - }, - "range": [ - 4, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 40 + "range": [ + 4, + 40 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 4, + 35 + ], + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 6, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 6, + 35 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 8, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 8, + 35 + ], + "params": [], + "rest": null, + "returnType": { + "type": "UnionTypeAnnotation", + "start": 14, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 14, + 35 + ], + "types": [ + { + "type": "NumberTypeAnnotation", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "FunctionTypeAnnotation", + "start": 23, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 23, + 35 + ], + "params": [], + "rest": null, + "returnType": { + "type": "StringTypeAnnotation", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 29, + 35 + ] + }, + "typeParameters": null + } + ] + }, + "typeParameters": null + } + } + }, + "init": { + "type": "Identifier", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 38, + 40 + ], + "name": "fn" } } - } - ], - "kind": "var", - "range": [ - 0, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 41 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/58/expected.json b/test/fixtures/flow/type-annotations/58/expected.json index aef3e76530..ded3488526 100644 --- a/test/fixtures/flow/type-annotations/58/expected.json +++ b/test/fixtures/flow/type-annotations/58/expected.json @@ -1,27 +1,137 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TypeAnnotation", + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 4, + 19 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 4, + 15 + ], + "name": "x", "typeAnnotation": { - "type": "TypeofTypeAnnotation", - "argument": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "Y", - "range": [ - 14, - 15 - ], + "type": "TypeAnnotation", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 5, + 15 + ], + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 7, + 15 + ], + "argument": { + "type": "GenericTypeAnnotation", + "start": 14, + "end": 15, "loc": { "start": { "line": 1, @@ -31,118 +141,60 @@ "line": 1, "column": 15 } - } - }, - "typeParameters": null, - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 }, - "end": { - "line": 1, - "column": 15 + "range": [ + 14, + 15 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "Y" } } - }, - "range": [ - 7, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } } - }, - "range": [ - 5, - 15 - ], + } + }, + "init": { + "type": "Identifier", + "start": 18, + "end": 19, "loc": { "start": { "line": 1, - "column": 5 + "column": 18 }, "end": { "line": 1, - "column": 15 + "column": 19 } - } - }, - "range": [ - 4, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "init": { - "type": "Identifier", - "name": "Y", - "range": [ - 18, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "range": [ - 4, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 + "range": [ + 18, + 19 + ], + "name": "Y" } } - } - ], - "kind": "var", - "range": [ - 0, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/59/expected.json b/test/fixtures/flow/type-annotations/59/expected.json index 7eb38bc643..6055cc7b7c 100644 --- a/test/fixtures/flow/type-annotations/59/expected.json +++ b/test/fixtures/flow/type-annotations/59/expected.json @@ -1,30 +1,156 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TypeAnnotation", + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 4, + 28 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 4, + 24 + ], + "name": "x", "typeAnnotation": { - "type": "UnionTypeAnnotation", - "types": [ - { - "type": "TypeofTypeAnnotation", - "argument": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "Y", - "range": [ - 14, - 15 - ], + "type": "TypeAnnotation", + "start": 5, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 5, + 24 + ], + "typeAnnotation": { + "type": "UnionTypeAnnotation", + "start": 7, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 7, + 24 + ], + "types": [ + { + "type": "TypeofTypeAnnotation", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 7, + 15 + ], + "argument": { + "type": "GenericTypeAnnotation", + "start": 14, + "end": 15, "loc": { "start": { "line": 1, @@ -34,151 +160,81 @@ "line": 1, "column": 15 } - } - }, - "typeParameters": null, - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 }, - "end": { - "line": 1, - "column": 15 + "range": [ + 14, + 15 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "Y" } } }, - "range": [ - 7, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 7 + { + "type": "NumberTypeAnnotation", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } }, - "end": { - "line": 1, - "column": 15 - } + "range": [ + 18, + 24 + ] } - }, - { - "type": "NumberTypeAnnotation", - "range": [ - 18, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "range": [ - 7, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 24 - } + ] } - }, - "range": [ - 5, - 24 - ], + } + }, + "init": { + "type": "Identifier", + "start": 27, + "end": 28, "loc": { "start": { "line": 1, - "column": 5 + "column": 27 }, "end": { "line": 1, - "column": 24 + "column": 28 } - } - }, - "range": [ - 4, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "init": { - "type": "Identifier", - "name": "Y", - "range": [ - 27, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "range": [ - 4, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 28 + "range": [ + 27, + 28 + ], + "name": "Y" } } - } - ], - "kind": "var", - "range": [ - 0, - 29 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/6/expected.json b/test/fixtures/flow/type-annotations/6/expected.json index f1bfa0d6e0..c20a9dcae3 100644 --- a/test/fixtures/flow/type-annotations/6/expected.json +++ b/test/fixtures/flow/type-annotations/6/expected.json @@ -1,131 +1,182 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [ - { - "type": "Identifier", - "name": "nullableNum", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 27, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "range": [ - 26, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "range": [ - 24, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "range": [ - 13, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 34, - 36 - ], + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, - "column": 34 + "column": 0 }, "end": { "line": 1, "column": 36 } - } - }, - "generator": false, - "expression": false, - "range": [ - 0, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 36 + "range": [ + 0, + 36 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 13, + 33 + ], + "name": "nullableNum", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 24, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 24, + 33 + ], + "typeAnnotation": { + "type": "NullableTypeAnnotation", + "start": 26, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 26, + 33 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 27, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 27, + 33 + ] + } + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 34, + 36 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/60/expected.json b/test/fixtures/flow/type-annotations/60/expected.json index 6cc8e45f06..5a92728d0d 100644 --- a/test/fixtures/flow/type-annotations/60/expected.json +++ b/test/fixtures/flow/type-annotations/60/expected.json @@ -1,76 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "range": [ - 5, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "value": { - "type": "Identifier", - "name": "x", - "range": [ - 5, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "range": [ - 5, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], - "range": [ - 4, - 22 - ], + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 39, "loc": { "start": { "line": 1, @@ -78,23 +66,138 @@ }, "end": { "line": 1, - "column": 22 + "column": 39 } }, - "typeAnnotation": { - "type": "TypeAnnotation", + "range": [ + 4, + 39 + ], + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 4, + 22 + ], + "properties": [ + { + "type": "Property", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "x" + } + } + ], "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "x", - "range": [ - 10, - 11 - ], + "type": "TypeAnnotation", + "start": 7, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 7, + 22 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 9, + 22 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 10, + "end": 20, "loc": { "start": { "line": 1, @@ -102,185 +205,149 @@ }, "end": { "line": 1, - "column": 11 + "column": 20 } - } - }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 13, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "optional": false, - "range": [ - 10, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 10 }, - "end": { - "line": 1, - "column": 20 - } + "range": [ + 10, + 20 + ], + "key": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "x" + }, + "value": { + "type": "StringTypeAnnotation", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 13, + 19 + ] + }, + "optional": false } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 9, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } + ], + "indexers": [] } - }, - "range": [ - 7, - 22 - ], + } + }, + "init": { + "type": "ObjectExpression", + "start": 25, + "end": 39, "loc": { "start": { "line": 1, - "column": 7 + "column": 25 }, "end": { "line": 1, - "column": 22 + "column": 39 } - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "range": [ - 27, - 28 - ], + }, + "range": [ + 25, + 39 + ], + "properties": [ + { + "type": "Property", + "start": 27, + "end": 37, "loc": { "start": { "line": 1, "column": 27 }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "value": { - "type": "Literal", - "value": "hello", - "raw": "\"hello\"", - "range": [ - 30, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 30 - }, "end": { "line": 1, "column": 37 } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "range": [ - 27, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 27 }, - "end": { - "line": 1, - "column": 37 - } + "range": [ + 27, + 37 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 27, + 28 + ], + "name": "x" + }, + "value": { + "type": "Literal", + "start": 30, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 30, + 37 + ], + "value": "hello", + "rawValue": "hello", + "raw": "\"hello\"" + }, + "kind": "init" } - } - ], - "range": [ - 25, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "range": [ - 4, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 39 + ] } } - } - ], - "kind": "var", - "range": [ - 0, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/61/expected.json b/test/fixtures/flow/type-annotations/61/expected.json index 3b02e2c8ea..85fe9a4800 100644 --- a/test/fixtures/flow/type-annotations/61/expected.json +++ b/test/fixtures/flow/type-annotations/61/expected.json @@ -1,76 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "range": [ - 5, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "value": { - "type": "Identifier", - "name": "x", - "range": [ - 5, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "range": [ - 5, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], - "range": [ - 4, - 21 - ], + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 38, "loc": { "start": { "line": 1, @@ -78,209 +66,288 @@ }, "end": { "line": 1, - "column": 21 + "column": 38 } }, - "typeAnnotation": { - "type": "TypeAnnotation", + "range": [ + 4, + 38 + ], + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 4, + 21 + ], + "properties": [ + { + "type": "Property", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "x" + } + } + ], "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "x", - "range": [ - 10, - 11 - ], + "type": "TypeAnnotation", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 7, + 21 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 9, + 21 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 10, + "end": 19, "loc": { "start": { "line": 1, "column": 10 }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 13, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, "end": { "line": 1, "column": 19 } - } - }, - "optional": false, - "range": [ - 10, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 10 }, - "end": { - "line": 1, - "column": 19 - } + "range": [ + 10, + 19 + ], + "key": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "x" + }, + "value": { + "type": "StringTypeAnnotation", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 13, + 19 + ] + }, + "optional": false } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 9, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 21 - } + ], + "indexers": [] } - }, - "range": [ - 7, - 21 - ], + } + }, + "init": { + "type": "ObjectExpression", + "start": 24, + "end": 38, "loc": { "start": { "line": 1, - "column": 7 + "column": 24 }, "end": { "line": 1, - "column": 21 + "column": 38 } - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "range": [ - 26, - 27 - ], + }, + "range": [ + 24, + 38 + ], + "properties": [ + { + "type": "Property", + "start": 26, + "end": 36, "loc": { "start": { "line": 1, "column": 26 }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "value": { - "type": "Literal", - "value": "hello", - "raw": "\"hello\"", - "range": [ - 29, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, "end": { "line": 1, "column": 36 } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "range": [ - 26, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 26 }, - "end": { - "line": 1, - "column": 36 - } + "range": [ + 26, + 36 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 26, + 27 + ], + "name": "x" + }, + "value": { + "type": "Literal", + "start": 29, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 29, + 36 + ], + "value": "hello", + "rawValue": "hello", + "raw": "\"hello\"" + }, + "kind": "init" } - } - ], - "range": [ - 24, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "range": [ - 4, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 38 + ] } } - } - ], - "kind": "var", - "range": [ - 0, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 39 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/62/expected.json b/test/fixtures/flow/type-annotations/62/expected.json index ffa1c6a85f..9c58a7f624 100644 --- a/test/fixtures/flow/type-annotations/62/expected.json +++ b/test/fixtures/flow/type-annotations/62/expected.json @@ -1,37 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "x", - "range": [ - 5, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], - "range": [ - 4, - 22 - ], + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 0, + 37 + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 0, + 37 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 0, + 37 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 36, "loc": { "start": { "line": 1, @@ -39,167 +66,199 @@ }, "end": { "line": 1, - "column": 22 + "column": 36 } }, - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { + "range": [ + 4, + 36 + ], + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 4, + 22 + ], + "elements": [ + { "type": "Identifier", - "name": "Array", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, "range": [ - 9, - 14 + 5, + 6 ], + "name": "x" + } + ], + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 7, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 7, + 22 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 9, + "end": 22, "loc": { "start": { "line": 1, "column": 9 }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "StringTypeAnnotation", - "range": [ - 15, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], - "range": [ - 14, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, "end": { "line": 1, "column": 22 } - } - }, - "range": [ - 9, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 9 }, - "end": { - "line": 1, - "column": 22 + "range": [ + 9, + 22 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 14, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 14, + 22 + ], + "params": [ + { + "type": "StringTypeAnnotation", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 15, + 21 + ] + } + ] + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 9, + 14 + ], + "name": "Array" } } - }, - "range": [ - 7, - 22 - ], + } + }, + "init": { + "type": "ArrayExpression", + "start": 25, + "end": 36, "loc": { "start": { "line": 1, - "column": 7 + "column": 25 }, "end": { "line": 1, - "column": 22 + "column": 36 } - } - } - }, - "init": { - "type": "ArrayExpression", - "elements": [ - { - "type": "Literal", - "value": "hello", - "raw": "\"hello\"", - "range": [ - 27, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], - "range": [ - 25, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 25 }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "range": [ - 4, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 + "range": [ + 25, + 36 + ], + "elements": [ + { + "type": "Literal", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 27, + 34 + ], + "value": "hello", + "rawValue": "hello", + "raw": "\"hello\"" + } + ] } } - } - ], - "kind": "var", - "range": [ - 0, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/63/expected.json b/test/fixtures/flow/type-annotations/63/expected.json index 3c50b528a0..4511e4e0aa 100644 --- a/test/fixtures/flow/type-annotations/63/expected.json +++ b/test/fixtures/flow/type-annotations/63/expected.json @@ -1,116 +1,208 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, - "column": 9 + "column": 0 }, "end": { "line": 1, - "column": 12 + "column": 36 } - } - }, - "params": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "value": { - "type": "Identifier", - "name": "x", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "range": [ - 13, - 32 - ], + }, + "range": [ + 0, + 36 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, "loc": { "start": { "line": 1, - "column": 13 + "column": 9 }, "end": { "line": 1, - "column": 32 + "column": 12 } }, - "typeAnnotation": { - "type": "TypeAnnotation", + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 13, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 13, + 32 + ], + "properties": [ + { + "type": "Property", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "x" + } + } + ], "typeAnnotation": { - "type": "ObjectTypeAnnotation", - "properties": [ - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "x", - "range": [ - 20, - 21 - ], + "type": "TypeAnnotation", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 16, + 32 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 18, + 32 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 20, + "end": 30, "loc": { "start": { "line": 1, @@ -118,112 +210,81 @@ }, "end": { "line": 1, - "column": 21 + "column": 30 } - } - }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 23, - 29 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "optional": false, - "range": [ - 20, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 20 }, - "end": { - "line": 1, - "column": 30 - } + "range": [ + 20, + 30 + ], + "key": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 20, + 21 + ], + "name": "x" + }, + "value": { + "type": "StringTypeAnnotation", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 23, + 29 + ] + }, + "optional": false } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 18, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "range": [ - 16, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 + ], + "indexers": [] } } } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 34, - 36 ], - "loc": { - "start": { - "line": 1, - "column": 34 + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "generator": false, - "expression": false, - "range": [ - 0, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 + "range": [ + 34, + 36 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/64/expected.json b/test/fixtures/flow/type-annotations/64/expected.json index 4381acf4c3..27ea1417d2 100644 --- a/test/fixtures/flow/type-annotations/64/expected.json +++ b/test/fixtures/flow/type-annotations/64/expected.json @@ -1,187 +1,244 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 35, "loc": { "start": { "line": 1, - "column": 9 + "column": 0 }, "end": { "line": 1, - "column": 12 + "column": 35 } - } - }, - "params": [ - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "x", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "range": [ - 13, - 31 - ], + }, + "range": [ + 0, + 35 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, "loc": { "start": { "line": 1, - "column": 13 + "column": 9 }, "end": { "line": 1, - "column": 31 + "column": 12 } }, - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "ArrayPattern", + "start": 13, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 13, + 31 + ], + "elements": [ + { "type": "Identifier", - "name": "Array", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, "range": [ - 18, - 23 + 14, + 15 ], + "name": "x" + } + ], + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 16, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 16, + 31 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 18, + "end": 31, "loc": { "start": { "line": 1, "column": 18 }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "StringTypeAnnotation", - "range": [ - 24, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], - "range": [ - 23, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, "end": { "line": 1, "column": 31 } - } - }, - "range": [ - 18, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 18 }, - "end": { - "line": 1, - "column": 31 + "range": [ + 18, + 31 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 23, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 23, + 31 + ], + "params": [ + { + "type": "StringTypeAnnotation", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 24, + 30 + ] + } + ] + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 18, + 23 + ], + "name": "Array" } } - }, - "range": [ - 16, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 31 - } } } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 33, - 35 ], - "loc": { - "start": { - "line": 1, - "column": 33 + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "generator": false, - "expression": false, - "range": [ - 0, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 35 + "range": [ + 33, + 35 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/65/expected.json b/test/fixtures/flow/type-annotations/65/expected.json index eb914c09bd..50f58d138d 100644 --- a/test/fixtures/flow/type-annotations/65/expected.json +++ b/test/fixtures/flow/type-annotations/65/expected.json @@ -1,65 +1,242 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 39, - "id": { - "type": "Identifier", - "start": 9, - "end": 12, - "name": "foo" + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "generator": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "start": 13, - "end": 35, - "argument": { - "type": "Identifier", - "start": 16, - "end": 20, - "name": "rest" + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "typeAnnotation": { - "type": "TypeAnnotation", - "start": 20, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 13, "end": 35, - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "start": 22, - "end": 35, - "typeParameters": { - "type": "TypeParameterInstantiation", - "start": 27, - "end": 35, - "params": [ - { - "type": "NumberTypeAnnotation", - "start": 28, - "end": 34 - } - ] + "loc": { + "start": { + "line": 1, + "column": 13 }, - "id": { - "type": "Identifier", + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 13, + 35 + ], + "argument": { + "type": "Identifier", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 16, + 20 + ], + "name": "rest" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 20, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 20, + 35 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", "start": 22, - "end": 27, - "name": "Array" + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 22, + 35 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 27, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 27, + 35 + ], + "params": [ + { + "type": "NumberTypeAnnotation", + "start": 28, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 28, + 34 + ] + } + ] + }, + "id": { + "type": "Identifier", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 22, + 27 + ], + "name": "Array" + } } } } + ], + "body": { + "type": "BlockStatement", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 37, + 39 + ], + "body": [] } - ], - "body": { - "type": "BlockStatement", - "start": 37, - "end": 39, - "body": [] } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/66/expected.json b/test/fixtures/flow/type-annotations/66/expected.json index 71d278f1ce..ee5f6ebdcf 100644 --- a/test/fixtures/flow/type-annotations/66/expected.json +++ b/test/fixtures/flow/type-annotations/66/expected.json @@ -1,65 +1,243 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 38, - "expression": { - "type": "FunctionExpression", - "start": 1, - "end": 37, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "start": 11, - "end": 33, - "argument": { - "type": "Identifier", - "start": 14, - "end": 18, - "name": "rest" + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 1 }, - "typeAnnotation": { - "type": "TypeAnnotation", - "start": 18, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 1, + 37 + ], + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 11, "end": 33, - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "start": 20, - "end": 33, - "typeParameters": { - "type": "TypeParameterInstantiation", - "start": 25, - "end": 33, - "params": [ - { - "type": "NumberTypeAnnotation", - "start": 26, - "end": 32 - } - ] + "loc": { + "start": { + "line": 1, + "column": 11 }, - "id": { - "type": "Identifier", + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 11, + 33 + ], + "argument": { + "type": "Identifier", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 14, + 18 + ], + "name": "rest" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 18, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 18, + 33 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", "start": 20, - "end": 25, - "name": "Array" + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 20, + 33 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 25, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 25, + 33 + ], + "params": [ + { + "type": "NumberTypeAnnotation", + "start": 26, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 26, + 32 + ] + } + ] + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 20, + 25 + ], + "name": "Array" + } } } } - } - ], - "body": { - "type": "BlockStatement", - "start": 35, - "end": 37, - "body": [] + ], + "body": { + "type": "BlockStatement", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 35, + 37 + ], + "body": [] + }, + "parenthesizedExpression": true } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/67/expected.json b/test/fixtures/flow/type-annotations/67/expected.json index d50f13755f..96fccc36d5 100644 --- a/test/fixtures/flow/type-annotations/67/expected.json +++ b/test/fixtures/flow/type-annotations/67/expected.json @@ -1,49 +1,184 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "kind": "var", - "start": 0, - "end": 28, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 27, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "foo" + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "init": { - "type": "ArrowFunctionExpression", - "start": 10, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, "end": 27, - "returnType": { - "type": "TypeAnnotation", - "start": 12, - "end": 20, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 14, - "end": 20 + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 27 } }, - "id": null, - "generator": false, - "expression": true, - "params": [], - "body": { + "range": [ + 4, + 27 + ], + "id": { "type": "Identifier", - "start": 24, + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "name": "foo" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 10, "end": 27, - "name": "bar" + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 10, + 27 + ], + "returnType": { + "type": "TypeAnnotation", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 12, + 20 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 14, + 20 + ] + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "body": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 24, + 27 + ], + "name": "bar" + } } } - } - ] - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/68/expected.json b/test/fixtures/flow/type-annotations/68/expected.json index ea81ade86b..54b242fd2f 100644 --- a/test/fixtures/flow/type-annotations/68/expected.json +++ b/test/fixtures/flow/type-annotations/68/expected.json @@ -1,57 +1,206 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "kind": "var", - "start": 0, - "end": 31, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 30, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "foo" + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "init": { - "type": "ArrowFunctionExpression", - "start": 10, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, "end": 30, - "id": null, - "generator": false, - "expression": true, - "params": [ - { - "type": "Identifier", - "start": 11, - "end": 14, - "name": "bar", - "parenthesizedExpression": true + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 30 } - ], - "body": { - "type": "Identifier", - "start": 27, - "end": 30, - "name": "bar" }, - "returnType": { - "type": "TypeAnnotation", - "start": 15, - "end": 23, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 17, - "end": 23 + "range": [ + 4, + 30 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "name": "foo" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 10, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 10, + 30 + ], + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 11, + 14 + ], + "name": "bar", + "parenthesizedExpression": true + } + ], + "body": { + "type": "Identifier", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 27, + 30 + ], + "name": "bar" + }, + "returnType": { + "type": "TypeAnnotation", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 15, + 23 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 17, + 23 + ] + } } } } - } - ] - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/69/expected.json b/test/fixtures/flow/type-annotations/69/expected.json index 6bb2a2943c..2c3bf20e14 100644 --- a/test/fixtures/flow/type-annotations/69/expected.json +++ b/test/fixtures/flow/type-annotations/69/expected.json @@ -1,87 +1,305 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "kind": "var", - "start": 0, - "end": 42, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 42, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "foo" + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 0, + 42 + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 0, + 42 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "init": { - "type": "ArrowFunctionExpression", - "start": 10, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 0, + 42 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, "end": 42, - "id": null, - "generator": false, - "expression": false, - "async": true, - "params": [ - { - "type": "Identifier", - "start": 17, - "end": 20, - "name": "foo", - "typeAnnotation": { - "type": "TypeAnnotation", - "start": 20, - "end": 25, - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "start": 22, - "end": 25, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 22, - "end": 25, - "name": "bar" - } - } + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 4, + 42 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 } }, - { - "type": "Identifier", - "start": 27, - "end": 30, - "name": "bar", - "typeAnnotation": { - "type": "TypeAnnotation", - "start": 30, - "end": 35, + "range": [ + 4, + 7 + ], + "name": "foo" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 10, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 10, + 42 + ], + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 17, + 20 + ], + "name": "foo", "typeAnnotation": { - "type": "GenericTypeAnnotation", - "start": 32, + "type": "TypeAnnotation", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 20, + 25 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 22, + 25 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 22, + 25 + ], + "name": "bar" + } + } + } + }, + { + "type": "Identifier", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 27, + 30 + ], + "name": "bar", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 30, "end": 35, - "typeParameters": null, - "id": { - "type": "Identifier", + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 30, + 35 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", "start": 32, "end": 35, - "name": "foo" + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 32, + 35 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 32, + 35 + ], + "name": "foo" + } } } } + ], + "body": { + "type": "BlockStatement", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 40, + 42 + ], + "body": [] } - ], - "body": { - "type": "BlockStatement", - "start": 40, - "end": 42, - "body": [] } } - } - ] - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/7/expected.json b/test/fixtures/flow/type-annotations/7/expected.json index b3e97bde0f..d4d77c2f60 100644 --- a/test/fixtures/flow/type-annotations/7/expected.json +++ b/test/fixtures/flow/type-annotations/7/expected.json @@ -1,133 +1,185 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [ - { - "type": "Identifier", - "name": "callback", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "VoidTypeAnnotation", - "range": [ - 29, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "typeParameters": null, - "range": [ - 23, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "range": [ - 21, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "range": [ - 13, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 34, - 36 - ], + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, - "column": 34 + "column": 0 }, "end": { "line": 1, "column": 36 } - } - }, - "generator": false, - "expression": false, - "range": [ - 0, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 36 + "range": [ + 0, + 36 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 13, + 33 + ], + "name": "callback", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 21, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 21, + 33 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 23, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 23, + 33 + ], + "params": [], + "rest": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 29, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 29, + 33 + ] + }, + "typeParameters": null + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 34, + 36 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/70/expected.json b/test/fixtures/flow/type-annotations/70/expected.json index 0d46838c78..c25617e414 100644 --- a/test/fixtures/flow/type-annotations/70/expected.json +++ b/test/fixtures/flow/type-annotations/70/expected.json @@ -1,50 +1,184 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "kind": "var", - "start": 0, - "end": 34, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 33, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "foo" + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "init": { - "type": "ArrowFunctionExpression", - "start": 10, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, "end": 33, - "returnType": { - "type": "TypeAnnotation", - "start": 18, - "end": 26, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 20, - "end": 26 + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 33 } }, - "id": null, - "generator": false, - "expression": true, - "async": true, - "params": [], - "body": { + "range": [ + 4, + 33 + ], + "id": { "type": "Identifier", - "start": 30, + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "name": "foo" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 10, "end": 33, - "name": "bar" + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 10, + 33 + ], + "returnType": { + "type": "TypeAnnotation", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 18, + 26 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 20, + 26 + ] + } + }, + "id": null, + "generator": false, + "expression": true, + "async": true, + "params": [], + "body": { + "type": "Identifier", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 30, + 33 + ], + "name": "bar" + } } } - } - ] - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/71/expected.json b/test/fixtures/flow/type-annotations/71/expected.json index 12707fa344..a2f8d7cc7c 100644 --- a/test/fixtures/flow/type-annotations/71/expected.json +++ b/test/fixtures/flow/type-annotations/71/expected.json @@ -1,57 +1,205 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "kind": "var", - "start": 0, - "end": 37, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 36, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "foo" + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 0, + 37 + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 0, + 37 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "init": { - "type": "ArrowFunctionExpression", - "start": 10, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 0, + 37 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, "end": 36, - "returnType": { - "type": "TypeAnnotation", - "start": 21, - "end": 29, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 23, - "end": 29 + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 } }, - "id": null, - "generator": false, - "expression": true, - "async": true, - "params": [ - { + "range": [ + 4, + 36 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "name": "foo" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 10, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 10, + 36 + ], + "returnType": { + "type": "TypeAnnotation", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 21, + 29 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 23, + 29 + ] + } + }, + "id": null, + "generator": false, + "expression": true, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 17, + 20 + ], + "name": "bar" + } + ], + "body": { "type": "Identifier", - "start": 17, - "end": 20, + "start": 33, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 33, + 36 + ], "name": "bar" } - ], - "body": { - "type": "Identifier", - "start": 33, - "end": 36, - "name": "bar" } } - } - ] - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/72/expected.json b/test/fixtures/flow/type-annotations/72/expected.json index 6a86b43dce..2c8b31667c 100644 --- a/test/fixtures/flow/type-annotations/72/expected.json +++ b/test/fixtures/flow/type-annotations/72/expected.json @@ -1,50 +1,185 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "kind": "var", - "start": 0, - "end": 30, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 29, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "foo" + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "init": { - "type": "ArrowFunctionExpression", - "start": 11, - "end": 28, - "returnType": { - "type": "TypeAnnotation", - "start": 13, - "end": 21, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 15, - "end": 21 + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 29 } }, - "id": null, - "generator": false, - "expression": true, - "params": [], - "body": { + "range": [ + 4, + 29 + ], + "id": { "type": "Identifier", - "start": 25, - "end": 28, - "name": "bar" + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "name": "foo" }, - "parenthesizedExpression": true + "init": { + "type": "ArrowFunctionExpression", + "start": 11, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 11, + 28 + ], + "returnType": { + "type": "TypeAnnotation", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 13, + 21 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 15, + 21 + ] + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "body": { + "type": "Identifier", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 25, + 28 + ], + "name": "bar" + }, + "parenthesizedExpression": true + } } - } - ] - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/73/expected.json b/test/fixtures/flow/type-annotations/73/expected.json index 8c8c39ae56..eb554e1ce4 100644 --- a/test/fixtures/flow/type-annotations/73/expected.json +++ b/test/fixtures/flow/type-annotations/73/expected.json @@ -1,58 +1,207 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "kind": "var", - "start": 0, - "end": 33, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 32, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "foo" - }, - "init": { - "type": "ArrowFunctionExpression", - "start": 11, - "end": 31, - "id": null, - "generator": false, - "expression": true, - "params": [ - { - "type": "Identifier", - "start": 12, - "end": 15, - "name": "bar", - "parenthesizedExpression": true - } - ], - "body": { - "type": "Identifier", - "start": 28, - "end": 31, - "name": "bar" - }, - "returnType": { - "type": "TypeAnnotation", - "start": 16, - "end": 24, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 18, - "end": 24 - } - }, - "parenthesizedExpression": true - } - } - ] + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 } - ] + }, + "range": [ + 0, + 33 + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 4, + 32 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "name": "foo" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 11, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 11, + 31 + ], + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 12, + 15 + ], + "name": "bar", + "parenthesizedExpression": true + } + ], + "body": { + "type": "Identifier", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 28, + 31 + ], + "name": "bar" + }, + "returnType": { + "type": "TypeAnnotation", + "start": 16, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 16, + 24 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 18, + 24 + ] + } + }, + "parenthesizedExpression": true + } + } + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/74/expected.json b/test/fixtures/flow/type-annotations/74/expected.json index a2aed8b15b..d8018a734e 100644 --- a/test/fixtures/flow/type-annotations/74/expected.json +++ b/test/fixtures/flow/type-annotations/74/expected.json @@ -1,74 +1,265 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "kind": "var", - "start": 0, - "end": 43, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 42, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "foo" + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 0, + 43 + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 0, + 43 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "init": { - "type": "TypeCastExpression", - "start": 11, - "end": 41, - "expression": { - "type": "ArrowFunctionExpression", - "start": 12, - "end": 32, - "id": null, - "generator": false, - "expression": true, - "params": [ - { - "type": "Identifier", - "start": 13, - "end": 16, - "name": "bar", - "parenthesizedExpression": true - } - ], - "body": { - "type": "Identifier", - "start": 29, - "end": 32, - "name": "bar" + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 0, + 43 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 4 }, - "returnType": { + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 4, + 42 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "name": "foo" + }, + "init": { + "type": "TypeCastExpression", + "start": 11, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 11, + 41 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 12, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 12, + 32 + ], + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 13, + 16 + ], + "name": "bar", + "parenthesizedExpression": true + } + ], + "body": { + "type": "Identifier", + "start": 29, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 29, + 32 + ], + "name": "bar" + }, + "returnType": { + "type": "TypeAnnotation", + "start": 17, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 17, + 25 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 19, + 25 + ] + } + }, + "parenthesizedExpression": true + }, + "typeAnnotation": { "type": "TypeAnnotation", - "start": 17, - "end": 25, + "start": 33, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 33, + 41 + ], "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 19, - "end": 25 + "start": 35, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 35, + 41 + ] } }, "parenthesizedExpression": true - }, - "typeAnnotation": { - "type": "TypeAnnotation", - "start": 33, - "end": 41, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 35, - "end": 41 - } - }, - "parenthesizedExpression": true + } } - } - ] - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/75/expected.json b/test/fixtures/flow/type-annotations/75/expected.json index 692825b35c..ba70a16d69 100644 --- a/test/fixtures/flow/type-annotations/75/expected.json +++ b/test/fixtures/flow/type-annotations/75/expected.json @@ -1,51 +1,185 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "kind": "var", - "start": 0, - "end": 36, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 35, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "foo" + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "init": { - "type": "ArrowFunctionExpression", - "start": 11, - "end": 34, - "returnType": { - "type": "TypeAnnotation", - "start": 19, - "end": 27, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 21, - "end": 27 + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 35 } }, - "id": null, - "generator": false, - "expression": true, - "async": true, - "params": [], - "body": { + "range": [ + 4, + 35 + ], + "id": { "type": "Identifier", - "start": 31, - "end": 34, - "name": "bar" + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "name": "foo" }, - "parenthesizedExpression": true + "init": { + "type": "ArrowFunctionExpression", + "start": 11, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 11, + 34 + ], + "returnType": { + "type": "TypeAnnotation", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 19, + 27 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 21, + 27 + ] + } + }, + "id": null, + "generator": false, + "expression": true, + "async": true, + "params": [], + "body": { + "type": "Identifier", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 31, + 34 + ], + "name": "bar" + }, + "parenthesizedExpression": true + } } - } - ] - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/76/expected.json b/test/fixtures/flow/type-annotations/76/expected.json index ce36650c9d..886eacd2fa 100644 --- a/test/fixtures/flow/type-annotations/76/expected.json +++ b/test/fixtures/flow/type-annotations/76/expected.json @@ -1,58 +1,206 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "kind": "var", - "start": 0, - "end": 39, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 38, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "foo" - }, - "init": { - "type": "ArrowFunctionExpression", - "start": 11, - "end": 37, - "returnType": { - "type": "TypeAnnotation", - "start": 22, - "end": 30, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 24, - "end": 30 - } - }, - "id": null, - "generator": false, - "expression": true, - "async": true, - "params": [ - { - "type": "Identifier", - "start": 18, - "end": 21, - "name": "bar" - } - ], - "body": { - "type": "Identifier", - "start": 34, - "end": 37, - "name": "bar" - }, - "parenthesizedExpression": true - } - } - ] + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 } - ] + }, + "range": [ + 0, + 39 + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 4, + 38 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "name": "foo" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 11, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 11, + 37 + ], + "returnType": { + "type": "TypeAnnotation", + "start": 22, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 22, + 30 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 24, + 30 + ] + } + }, + "id": null, + "generator": false, + "expression": true, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 18, + 21 + ], + "name": "bar" + } + ], + "body": { + "type": "Identifier", + "start": 34, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 34, + 37 + ], + "name": "bar" + }, + "parenthesizedExpression": true + } + } + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/77/expected.json b/test/fixtures/flow/type-annotations/77/expected.json index 55741180c9..2a6bb89d5b 100644 --- a/test/fixtures/flow/type-annotations/77/expected.json +++ b/test/fixtures/flow/type-annotations/77/expected.json @@ -1,74 +1,264 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "kind": "var", - "start": 0, - "end": 49, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 48, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "foo" + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 0, + 49 + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 0, + 49 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "init": { - "type": "TypeCastExpression", - "start": 11, - "end": 47, - "expression": { - "type": "ArrowFunctionExpression", - "start": 12, - "end": 38, - "returnType": { - "type": "TypeAnnotation", - "start": 23, - "end": 31, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 25, - "end": 31 - } + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 0, + 49 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 4 }, - "id": null, - "generator": false, - "expression": true, - "async": true, - "params": [ - { - "type": "Identifier", - "start": 19, - "end": 22, - "name": "bar" - } - ], - "body": { - "type": "Identifier", - "start": 35, - "end": 38, - "name": "bar" - }, - "parenthesizedExpression": true - }, - "typeAnnotation": { - "type": "TypeAnnotation", - "start": 39, - "end": 47, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 41, - "end": 47 + "end": { + "line": 1, + "column": 48 } }, - "parenthesizedExpression": true + "range": [ + 4, + 48 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "name": "foo" + }, + "init": { + "type": "TypeCastExpression", + "start": 11, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 11, + 47 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 12, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 12, + 38 + ], + "returnType": { + "type": "TypeAnnotation", + "start": 23, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 23, + 31 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 25, + 31 + ] + } + }, + "id": null, + "generator": false, + "expression": true, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 19, + 22 + ], + "name": "bar" + } + ], + "body": { + "type": "Identifier", + "start": 35, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 35, + 38 + ], + "name": "bar" + }, + "parenthesizedExpression": true + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 39, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 39, + 47 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 41, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 41, + 47 + ] + } + }, + "parenthesizedExpression": true + } } - } - ] - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/78/expected.json b/test/fixtures/flow/type-annotations/78/expected.json index 54cd57229f..445b8e19a4 100644 --- a/test/fixtures/flow/type-annotations/78/expected.json +++ b/test/fixtures/flow/type-annotations/78/expected.json @@ -1,48 +1,182 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "kind": "var", - "start": 0, - "end": 31, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 30, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "foo" + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "init": { - "type": "ConditionalExpression", - "start": 10, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, "end": 30, - "test": { + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 4, + 30 + ], + "id": { "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "name": "foo" + }, + "init": { + "type": "ConditionalExpression", "start": 10, - "end": 13, - "name": "bar" - }, - "consequent": { - "type": "Identifier", - "start": 17, - "end": 20, - "name": "foo", - "parenthesizedExpression": true - }, - "alternate": { - "type": "Identifier", - "start": 24, "end": 30, - "name": "number" + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 10, + 30 + ], + "test": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 10, + 13 + ], + "name": "bar" + }, + "consequent": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 17, + 20 + ], + "name": "foo", + "parenthesizedExpression": true + }, + "alternate": { + "type": "Identifier", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 24, + 30 + ], + "name": "number" + } } } - } - ] - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/79/expected.json b/test/fixtures/flow/type-annotations/79/expected.json index 5688eb3023..76363ac712 100644 --- a/test/fixtures/flow/type-annotations/79/expected.json +++ b/test/fixtures/flow/type-annotations/79/expected.json @@ -1,74 +1,265 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "kind": "var", - "start": 0, - "end": 43, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 42, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "foo" + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 0, + 43 + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 0, + 43 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "init": { - "type": "ConditionalExpression", - "start": 10, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 0, + 43 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, "end": 42, - "test": { - "type": "Identifier", - "start": 10, - "end": 13, - "name": "bar" - }, - "consequent": { - "type": "ArrowFunctionExpression", - "start": 16, - "end": 36, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 17, - "end": 20, - "name": "foo", - "parenthesizedExpression": true - } - ], - "body": { - "type": "BlockStatement", - "start": 34, - "end": 36, - "body": [] + "loc": { + "start": { + "line": 1, + "column": 4 }, - "returnType": { - "type": "TypeAnnotation", - "start": 22, - "end": 30, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 24, - "end": 30 - } + "end": { + "line": 1, + "column": 42 } }, - "alternate": { + "range": [ + 4, + 42 + ], + "id": { "type": "Identifier", - "start": 39, + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "name": "foo" + }, + "init": { + "type": "ConditionalExpression", + "start": 10, "end": 42, - "name": "baz" + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 10, + 42 + ], + "test": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 10, + 13 + ], + "name": "bar" + }, + "consequent": { + "type": "ArrowFunctionExpression", + "start": 16, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 16, + 36 + ], + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 17, + 20 + ], + "name": "foo", + "parenthesizedExpression": true + } + ], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 34, + 36 + ], + "body": [] + }, + "returnType": { + "type": "TypeAnnotation", + "start": 22, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 22, + 30 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 24, + 30 + ] + } + } + }, + "alternate": { + "type": "Identifier", + "start": 39, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 39, + 42 + ], + "name": "baz" + } } } - } - ] - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/8/expected.json b/test/fixtures/flow/type-annotations/8/expected.json index c76227ec14..8f0cd2c669 100644 --- a/test/fixtures/flow/type-annotations/8/expected.json +++ b/test/fixtures/flow/type-annotations/8/expected.json @@ -1,133 +1,185 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "params": [ - { - "type": "Identifier", - "name": "callback", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 29, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "typeParameters": null, - "range": [ - 23, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "range": [ - 21, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "range": [ - 13, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 36, - 38 - ], + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 38, "loc": { "start": { "line": 1, - "column": 36 + "column": 0 }, "end": { "line": 1, "column": 38 } - } - }, - "generator": false, - "expression": false, - "range": [ - 0, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 38 + "range": [ + 0, + 38 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 13, + 35 + ], + "name": "callback", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 21, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 21, + 35 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 23, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 23, + 35 + ], + "params": [], + "rest": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 29, + 35 + ] + }, + "typeParameters": null + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 36, + 38 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/80/expected.json b/test/fixtures/flow/type-annotations/80/expected.json index 5d4d8bc99c..ee3a8316b7 100644 --- a/test/fixtures/flow/type-annotations/80/expected.json +++ b/test/fixtures/flow/type-annotations/80/expected.json @@ -1,65 +1,243 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 34, - "expression": { - "type": "ArrowFunctionExpression", - "start": 1, - "end": 33, - "id": null, - "generator": false, - "expression": true, - "params": [ - { - "type": "RestElement", - "start": 2, - "end": 9, - "argument": { - "type": "Identifier", - "start": 5, - "end": 9, - "name": "rest" + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 1, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 1 }, - "typeAnnotation": { - "type": "TypeAnnotation", - "start": 9, - "end": 24, - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "start": 11, - "end": 24, - "typeParameters": { - "type": "TypeParameterInstantiation", - "start": 16, - "end": 24, - "params": [ - { - "type": "NumberTypeAnnotation", - "start": 17, - "end": 23 - } - ] + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 1, + 33 + ], + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 2, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 2 }, - "id": { - "type": "Identifier", + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 2, + 9 + ], + "argument": { + "type": "Identifier", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 5, + 9 + ], + "name": "rest" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 9, + 24 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", "start": 11, - "end": 16, - "name": "Array" + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 11, + 24 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 16, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 16, + 24 + ], + "params": [ + { + "type": "NumberTypeAnnotation", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 17, + 23 + ] + } + ] + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 11, + 16 + ], + "name": "Array" + } } } } - } - ], - "body": { - "type": "Identifier", - "start": 29, - "end": 33, - "name": "rest" + ], + "body": { + "type": "Identifier", + "start": 29, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 29, + 33 + ], + "name": "rest" + }, + "parenthesizedExpression": true } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/81/expected.json b/test/fixtures/flow/type-annotations/81/expected.json index 86958655cc..d2a2b04ced 100644 --- a/test/fixtures/flow/type-annotations/81/expected.json +++ b/test/fixtures/flow/type-annotations/81/expected.json @@ -1,177 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "Map", - "range": [ - 7, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "StringTypeAnnotation", - "range": [ - 11, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "Array", - "range": [ - 19, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "StringTypeAnnotation", - "range": [ - 25, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], - "range": [ - 24, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "range": [ - 19, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "range": [ - 10, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "range": [ - 7, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "range": [ - 5, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "range": [ - 4, - 34 - ], + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 34, "loc": { "start": { "line": 1, @@ -181,40 +68,213 @@ "line": 1, "column": 34 } - } - }, - "init": null, - "range": [ - 4, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 34 - } + "range": [ + 4, + 34 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 4, + 34 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 5, + 34 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 7, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 7, + 34 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 10, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 10, + 34 + ], + "params": [ + { + "type": "StringTypeAnnotation", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 11, + 17 + ] + }, + { + "type": "GenericTypeAnnotation", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 19, + 32 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 24, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 24, + 32 + ], + "params": [ + { + "type": "StringTypeAnnotation", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 25, + 31 + ] + } + ] + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 19, + 24 + ], + "name": "Array" + } + } + ] + }, + "id": { + "type": "Identifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 7, + 10 + ], + "name": "Map" + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/82/expected.json b/test/fixtures/flow/type-annotations/82/expected.json index cd6594e120..4c1d10ed3d 100644 --- a/test/fixtures/flow/type-annotations/82/expected.json +++ b/test/fixtures/flow/type-annotations/82/expected.json @@ -1,177 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "Map", - "range": [ - 7, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "StringTypeAnnotation", - "range": [ - 11, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "Array", - "range": [ - 19, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "StringTypeAnnotation", - "range": [ - 25, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], - "range": [ - 24, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "range": [ - 19, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "range": [ - 10, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "range": [ - 7, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "range": [ - 5, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "range": [ - 4, - 33 - ], + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 33, "loc": { "start": { "line": 1, @@ -181,40 +68,213 @@ "line": 1, "column": 33 } - } - }, - "init": null, - "range": [ - 4, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 33 - } + "range": [ + 4, + 33 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 4, + 33 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 5, + 33 + ], + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 7, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 7, + 33 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 10, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 10, + 33 + ], + "params": [ + { + "type": "StringTypeAnnotation", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 11, + 17 + ] + }, + { + "type": "GenericTypeAnnotation", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 19, + 32 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 24, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 24, + 32 + ], + "params": [ + { + "type": "StringTypeAnnotation", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 25, + 31 + ] + } + ] + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 19, + 24 + ], + "name": "Array" + } + } + ] + }, + "id": { + "type": "Identifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 7, + 10 + ], + "name": "Map" + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 33 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/83/expected.json b/test/fixtures/flow/type-annotations/83/expected.json index 3b4e1569a4..4e440eea85 100644 --- a/test/fixtures/flow/type-annotations/83/expected.json +++ b/test/fixtures/flow/type-annotations/83/expected.json @@ -1,69 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ArrayTypeAnnotation", - "elementType": { - "type": "NumberTypeAnnotation", - "range": [ - 7, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "range": [ - 7, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "range": [ - 5, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "range": [ - 4, - 15 - ], + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 15, "loc": { "start": { "line": 1, @@ -73,40 +68,93 @@ "line": 1, "column": 15 } - } - }, - "init": null, - "range": [ - 4, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 15 - } + "range": [ + 4, + 15 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 4, + 15 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 5, + 15 + ], + "typeAnnotation": { + "type": "ArrayTypeAnnotation", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 7, + 15 + ], + "elementType": { + "type": "NumberTypeAnnotation", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 7, + 13 + ] + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/84/expected.json b/test/fixtures/flow/type-annotations/84/expected.json index 72c8d74481..6eb3373171 100644 --- a/test/fixtures/flow/type-annotations/84/expected.json +++ b/test/fixtures/flow/type-annotations/84/expected.json @@ -1,86 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "typeAnnotation": { - "type": "ArrayTypeAnnotation", - "elementType": { - "type": "StringTypeAnnotation", - "range": [ - 8, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 8, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "range": [ - 7, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "range": [ - 5, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "range": [ - 4, - 16 - ], + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 16, "loc": { "start": { "line": 1, @@ -90,40 +68,112 @@ "line": 1, "column": 16 } - } - }, - "init": null, - "range": [ - 4, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 16 - } + "range": [ + 4, + 16 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 4, + 16 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 5, + 16 + ], + "typeAnnotation": { + "type": "NullableTypeAnnotation", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 7, + 16 + ], + "typeAnnotation": { + "type": "ArrayTypeAnnotation", + "start": 8, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 8, + 16 + ], + "elementType": { + "type": "StringTypeAnnotation", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ] + } + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/85/expected.json b/test/fixtures/flow/type-annotations/85/expected.json index b055b4ad6d..89ead7f3d5 100644 --- a/test/fixtures/flow/type-annotations/85/expected.json +++ b/test/fixtures/flow/type-annotations/85/expected.json @@ -1,123 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ArrayTypeAnnotation", - "elementType": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "Promise", - "range": [ - 7, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "BooleanTypeAnnotation", - "range": [ - 15, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "range": [ - 14, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "range": [ - 7, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "range": [ - 7, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "range": [ - 5, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "range": [ - 4, - 22 - ], + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, "loc": { "start": { "line": 1, @@ -127,40 +68,153 @@ "line": 1, "column": 22 } - } - }, - "init": null, - "range": [ - 4, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 22 - } + "range": [ + 4, + 22 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 4, + 22 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 5, + 22 + ], + "typeAnnotation": { + "type": "ArrayTypeAnnotation", + "start": 7, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 7, + 22 + ], + "elementType": { + "type": "GenericTypeAnnotation", + "start": 7, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 7, + 20 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 14, + 20 + ], + "params": [ + { + "type": "BooleanTypeAnnotation", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 15, + 19 + ] + } + ] + }, + "id": { + "type": "Identifier", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 7, + 14 + ], + "name": "Promise" + } + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/86/expected.json b/test/fixtures/flow/type-annotations/86/expected.json index 41aa2469e5..5f9dd591cf 100644 --- a/test/fixtures/flow/type-annotations/86/expected.json +++ b/test/fixtures/flow/type-annotations/86/expected.json @@ -1,178 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 33, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "rest": { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "rest", - "range": [ - 10, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "Array", - "range": [ - 15, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "typeParameters": { - "type": "TypeParameterInstantiation", - "params": [ - { - "type": "NumberTypeAnnotation", - "range": [ - 21, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], - "range": [ - 20, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "range": [ - 15, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "optional": false, - "range": [ - 10, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "typeParameters": null, - "range": [ - 6, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "range": [ - 5, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "range": [ - 4, - 39 - ], + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 39, "loc": { "start": { "line": 1, @@ -182,40 +68,214 @@ "line": 1, "column": 39 } - } - }, - "init": null, - "range": [ - 4, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 39 - } + "range": [ + 4, + 39 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 4, + 39 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 5, + 39 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 6, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 6, + 39 + ], + "params": [], + "rest": { + "type": "FunctionTypeParam", + "start": 10, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 10, + 28 + ], + "name": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 10, + 14 + ], + "name": "rest" + }, + "optional": false, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 15, + 28 + ], + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 20, + 28 + ], + "params": [ + { + "type": "NumberTypeAnnotation", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 21, + 27 + ] + } + ] + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 15, + 20 + ], + "name": "Array" + } + } + }, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 33, + 39 + ] + }, + "typeParameters": null + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 39 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/87/expected.json b/test/fixtures/flow/type-annotations/87/expected.json index 49b092a614..d87ee24178 100644 --- a/test/fixtures/flow/type-annotations/87/expected.json +++ b/test/fixtures/flow/type-annotations/87/expected.json @@ -1,199 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "identity", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [ - { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "x", - "range": [ - 18, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 21, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "typeParameters": null, - "range": [ - 21, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "optional": false, - "range": [ - 18, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], - "returnType": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 27, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "typeParameters": null, - "range": [ - 27, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "range": [ - 14, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 14, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "range": [ - 12, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "range": [ - 4, - 28 - ], + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 28, "loc": { "start": { "line": 1, @@ -203,40 +68,238 @@ "line": 1, "column": 28 } - } - }, - "init": null, - "range": [ - 4, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 28 - } + "range": [ + 4, + 28 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 4, + 28 + ], + "name": "identity", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 12, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 12, + 28 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 14, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 14, + 28 + ], + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 14, + 17 + ], + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "T" + } + ] + }, + "params": [ + { + "type": "FunctionTypeParam", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 18, + 22 + ], + "name": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "x" + }, + "optional": false, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "name": "T" + } + } + } + ], + "rest": null, + "returnType": { + "type": "GenericTypeAnnotation", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 27, + 28 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 27, + 28 + ], + "name": "T" + } + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/88/expected.json b/test/fixtures/flow/type-annotations/88/expected.json index 90aed87026..4e03f0ee83 100644 --- a/test/fixtures/flow/type-annotations/88/expected.json +++ b/test/fixtures/flow/type-annotations/88/expected.json @@ -1,288 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "identity", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [ - { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "x", - "range": [ - 18, - 19 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 21, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "typeParameters": null, - "range": [ - 21, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "optional": false, - "range": [ - 18, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], - "returnType": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 37, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "typeParameters": null, - "range": [ - 37, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "rest": { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "y", - "range": [ - 27, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "typeAnnotation": { - "type": "ArrayTypeAnnotation", - "elementType": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "T", - "range": [ - 29, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "typeParameters": null, - "range": [ - 29, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "range": [ - 29, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "optional": false, - "range": [ - 27, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "params": [ - { - "type": "Identifier", - "name": "T", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "range": [ - 14, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 14, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "range": [ - 12, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "range": [ - 4, - 38 - ], + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 38, "loc": { "start": { "line": 1, @@ -292,40 +68,336 @@ "line": 1, "column": 38 } - } - }, - "init": null, - "range": [ - 4, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 38 - } + "range": [ + 4, + 38 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 4, + 38 + ], + "name": "identity", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 12, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 12, + 38 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 14, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 14, + 38 + ], + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 14, + 17 + ], + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "T" + } + ] + }, + "params": [ + { + "type": "FunctionTypeParam", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 18, + 22 + ], + "name": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "x" + }, + "optional": false, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "name": "T" + } + } + } + ], + "rest": { + "type": "FunctionTypeParam", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 27, + 32 + ], + "name": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 27, + 28 + ], + "name": "y" + }, + "optional": false, + "typeAnnotation": { + "type": "ArrayTypeAnnotation", + "start": 29, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 29, + 32 + ], + "elementType": { + "type": "GenericTypeAnnotation", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 29, + 30 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 29, + 30 + ], + "name": "T" + } + } + } + }, + "returnType": { + "type": "GenericTypeAnnotation", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 37, + 38 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 37, + 38 + ], + "name": "T" + } + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/89/expected.json b/test/fixtures/flow/type-annotations/89/expected.json index b87c1d79d1..f2a682f5f6 100644 --- a/test/fixtures/flow/type-annotations/89/expected.json +++ b/test/fixtures/flow/type-annotations/89/expected.json @@ -1,18 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "foo", - "range": [ - 12, - 15 - ], + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 12, + "end": 15, "loc": { "start": { "line": 1, @@ -22,58 +68,57 @@ "line": 1, "column": 15 } + }, + "range": [ + 12, + 15 + ], + "local": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 12, + 15 + ], + "name": "foo" } - }, - "range": [ - 12, - 15 - ], + } + ], + "importKind": "type", + "source": { + "type": "Literal", + "start": 21, + "end": 26, "loc": { "start": { "line": 1, - "column": 12 + "column": 21 }, "end": { "line": 1, - "column": 15 + "column": 26 } - } - } - ], - "source": { - "type": "Literal", - "value": "bar", - "raw": "\"bar\"", - "range": [ - 21, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 21 }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "importKind": "type", - "range": [ - 0, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 + "range": [ + 21, + 26 + ], + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/9/expected.json b/test/fixtures/flow/type-annotations/9/expected.json index 98b67dd9f1..25314ba131 100644 --- a/test/fixtures/flow/type-annotations/9/expected.json +++ b/test/fixtures/flow/type-annotations/9/expected.json @@ -1,187 +1,245 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "range": [ - 9, - 12 - ], + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "range": [ + 0, + 44 + ], + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "range": [ + 0, + 44 + ], + "sourceType": "module", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 44, "loc": { "start": { "line": 1, - "column": 9 + "column": 0 }, "end": { "line": 1, - "column": 12 + "column": 44 } - } - }, - "params": [ - { + }, + "range": [ + 0, + 44 + ], + "id": { "type": "Identifier", - "name": "callback", - "typeAnnotation": { - "type": "TypeAnnotation", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 13, + 41 + ], + "name": "callback", "typeAnnotation": { - "type": "FunctionTypeAnnotation", - "params": [ - { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "_", - "range": [ - 24, - 25 - ], + "type": "TypeAnnotation", + "start": 21, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 21, + 41 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 23, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 23, + 41 + ], + "params": [ + { + "type": "FunctionTypeParam", + "start": 24, + "end": 30, "loc": { "start": { "line": 1, "column": 24 }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "typeAnnotation": { - "type": "BooleanTypeAnnotation", - "range": [ - 26, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, "end": { "line": 1, "column": 30 } + }, + "range": [ + 24, + 30 + ], + "name": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 24, + 25 + ], + "name": "_" + }, + "optional": false, + "typeAnnotation": { + "type": "BooleanTypeAnnotation", + "start": 26, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 26, + 30 + ] } - }, - "optional": false, - "range": [ - 24, - 30 - ], + } + ], + "rest": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 35, + "end": 41, "loc": { "start": { "line": 1, - "column": 24 + "column": 35 }, "end": { "line": 1, - "column": 30 + "column": 41 } - } - } - ], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 35, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 35 }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "typeParameters": null, - "range": [ - 23, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 23 + "range": [ + 35, + 41 + ] }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "range": [ - 21, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 41 + "typeParameters": null } } - }, - "range": [ - 13, - 41 - ], + } + ], + "body": { + "type": "BlockStatement", + "start": 42, + "end": 44, "loc": { "start": { "line": 1, - "column": 13 + "column": 42 }, "end": { "line": 1, - "column": 41 + "column": 44 } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "range": [ - 42, - 44 - ], - "loc": { - "start": { - "line": 1, - "column": 42 }, - "end": { - "line": 1, - "column": 44 - } - } - }, - "generator": false, - "expression": false, - "range": [ - 0, - 44 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 + "range": [ + 42, + 44 + ], + "body": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/90/expected.json b/test/fixtures/flow/type-annotations/90/expected.json index b4c91f2e72..b3ec5ff963 100644 --- a/test/fixtures/flow/type-annotations/90/expected.json +++ b/test/fixtures/flow/type-annotations/90/expected.json @@ -1,18 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "foo", - "range": [ - 14, - 17 - ], + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 14, + "end": 17, "loc": { "start": { "line": 1, @@ -22,58 +68,57 @@ "line": 1, "column": 17 } + }, + "range": [ + 14, + 17 + ], + "local": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 14, + 17 + ], + "name": "foo" } - }, - "range": [ - 14, - 17 - ], + } + ], + "importKind": "typeof", + "source": { + "type": "Literal", + "start": 23, + "end": 28, "loc": { "start": { "line": 1, - "column": 14 + "column": 23 }, "end": { "line": 1, - "column": 17 + "column": 28 } - } - } - ], - "source": { - "type": "Literal", - "value": "bar", - "raw": "\"bar\"", - "range": [ - 23, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 23 }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "importKind": "typeof", - "range": [ - 0, - 29 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 + "range": [ + 23, + 28 + ], + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/91/expected.json b/test/fixtures/flow/type-annotations/91/expected.json index 35f5169832..5820f79d18 100644 --- a/test/fixtures/flow/type-annotations/91/expected.json +++ b/test/fixtures/flow/type-annotations/91/expected.json @@ -1,150 +1,203 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [ - { - "type": "ImportSpecifier", - "local": { - "type": "Identifier", - "name": "foo", - "range": [ - 13, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "imported": { - "type": "Identifier", - "name": "foo", - "range": [ - 13, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "range": [ - 13, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "ImportSpecifier", - "local": { - "type": "Identifier", - "name": "bar", - "range": [ - 18, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "imported": { - "type": "Identifier", - "name": "bar", - "range": [ - 18, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "range": [ - 18, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], - "source": { - "type": "Literal", - "value": "baz", - "raw": "\"baz\"", - "range": [ - 28, - 33 - ], + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 34, "loc": { "start": { "line": 1, - "column": 28 + "column": 0 }, "end": { "line": 1, - "column": 33 + "column": 34 } - } - }, - "importKind": "type", - "range": [ - 0, - 34 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 34 + "range": [ + 0, + 34 + ], + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 13, + 16 + ], + "imported": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 13, + 16 + ], + "name": "foo" + }, + "local": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 13, + 16 + ], + "name": "foo" + } + }, + { + "type": "ImportSpecifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 18, + 21 + ], + "imported": { + "type": "Identifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 18, + 21 + ], + "name": "bar" + }, + "local": { + "type": "Identifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 18, + 21 + ], + "name": "bar" + } + } + ], + "importKind": "type", + "source": { + "type": "Literal", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 28, + 33 + ], + "value": "baz", + "rawValue": "baz", + "raw": "\"baz\"" } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/92/expected.json b/test/fixtures/flow/type-annotations/92/expected.json index 8c4e89fb66..9e80c53c8d 100644 --- a/test/fixtures/flow/type-annotations/92/expected.json +++ b/test/fixtures/flow/type-annotations/92/expected.json @@ -1,97 +1,144 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [ - { - "type": "ImportSpecifier", - "imported": { - "type": "Identifier", - "name": "foo", - "range": [ - 15, - 18 - ], + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 15, + "end": 25, "loc": { "start": { "line": 1, "column": 15 }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "local": { - "type": "Identifier", - "name": "bar", - "range": [ - 22, - 25 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, "end": { "line": 1, "column": 25 } + }, + "range": [ + 15, + 25 + ], + "imported": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 15, + 18 + ], + "name": "foo" + }, + "local": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 22, + 25 + ], + "name": "bar" } - }, - "range": [ - 15, - 25 - ], + } + ], + "importKind": "typeof", + "source": { + "type": "Literal", + "start": 32, + "end": 37, "loc": { "start": { "line": 1, - "column": 15 + "column": 32 }, "end": { "line": 1, - "column": 25 + "column": 37 } - } - } - ], - "source": { - "type": "Literal", - "value": "baz", - "raw": "\"baz\"", - "range": [ - 32, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 32 }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "importKind": "typeof", - "range": [ - 0, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 + "range": [ + 32, + 37 + ], + "value": "baz", + "rawValue": "baz", + "raw": "\"baz\"" } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/93/expected.json b/test/fixtures/flow/type-annotations/93/expected.json index 62ed796254..eede45e979 100644 --- a/test/fixtures/flow/type-annotations/93/expected.json +++ b/test/fixtures/flow/type-annotations/93/expected.json @@ -1,18 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "type", - "range": [ - 7, - 11 - ], + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 7, + "end": 11, "loc": { "start": { "line": 1, @@ -22,58 +68,57 @@ "line": 1, "column": 11 } + }, + "range": [ + 7, + 11 + ], + "local": { + "type": "Identifier", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 7, + 11 + ], + "name": "type" } - }, - "range": [ - 7, - 11 - ], + } + ], + "importKind": "value", + "source": { + "type": "Literal", + "start": 17, + "end": 22, "loc": { "start": { "line": 1, - "column": 7 + "column": 17 }, "end": { "line": 1, - "column": 11 + "column": 22 } - } - } - ], - "source": { - "type": "Literal", - "value": "foo", - "raw": "\"foo\"", - "range": [ - 17, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 17 }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "importKind": "value", - "range": [ - 0, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 + "range": [ + 17, + 22 + ], + "value": "foo", + "rawValue": "foo", + "raw": "\"foo\"" } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/94/expected.json b/test/fixtures/flow/type-annotations/94/expected.json index 1ed55d1fb3..8eb55e497d 100644 --- a/test/fixtures/flow/type-annotations/94/expected.json +++ b/test/fixtures/flow/type-annotations/94/expected.json @@ -1,18 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "type", - "range": [ - 7, - 11 - ], + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 7, + "end": 11, "loc": { "start": { "line": 1, @@ -22,32 +68,36 @@ "line": 1, "column": 11 } + }, + "range": [ + 7, + 11 + ], + "local": { + "type": "Identifier", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 7, + 11 + ], + "name": "type" } }, - "range": [ - 7, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - { - "type": "ImportSpecifier", - "local": { - "type": "Identifier", - "name": "foo", - "range": [ - 14, - 17 - ], + { + "type": "ImportSpecifier", + "start": 14, + "end": 17, "loc": { "start": { "line": 1, @@ -57,76 +107,77 @@ "line": 1, "column": 17 } - } - }, - "imported": { - "type": "Identifier", - "name": "foo", + }, "range": [ 14, 17 ], - "loc": { - "start": { - "line": 1, - "column": 14 + "imported": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 14, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 14 + "range": [ + 14, + 17 + ], + "name": "foo" }, - "end": { - "line": 1, - "column": 17 + "local": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 14, + 17 + ], + "name": "foo" } } - } - ], - "source": { - "type": "Literal", - "value": "bar", - "raw": "\"bar\"", - "range": [ - 24, - 29 ], - "loc": { - "start": { - "line": 1, - "column": 24 + "importKind": "value", + "source": { + "type": "Literal", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "importKind": "value", - "range": [ - 0, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 + "range": [ + 24, + 29 + ], + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/95/expected.json b/test/fixtures/flow/type-annotations/95/expected.json index 512f3c1cba..7fe928d5a9 100644 --- a/test/fixtures/flow/type-annotations/95/expected.json +++ b/test/fixtures/flow/type-annotations/95/expected.json @@ -1,79 +1,124 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "local": { - "type": "Identifier", - "name": "namespace", - "range": [ - 17, - 26 - ], + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "start": 12, + "end": 26, "loc": { "start": { "line": 1, - "column": 17 + "column": 12 }, "end": { "line": 1, "column": 26 } + }, + "range": [ + 12, + 26 + ], + "local": { + "type": "Identifier", + "start": 17, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 17, + 26 + ], + "name": "namespace" } - }, - "range": [ - 12, - 26 - ], + } + ], + "importKind": "type", + "source": { + "type": "Literal", + "start": 32, + "end": 37, "loc": { "start": { "line": 1, - "column": 12 + "column": 32 }, "end": { "line": 1, - "column": 26 + "column": 37 } - } - } - ], - "source": { - "type": "Literal", - "value": "bar", - "raw": "\"bar\"", - "range": [ - 32, - 37 - ], - "loc": { - "start": { - "line": 1, - "column": 32 }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "importKind": "type", - "range": [ - 0, - 38 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 + "range": [ + 32, + 37 + ], + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/96/expected.json b/test/fixtures/flow/type-annotations/96/expected.json index a1c6172e40..46e060d85a 100644 --- a/test/fixtures/flow/type-annotations/96/expected.json +++ b/test/fixtures/flow/type-annotations/96/expected.json @@ -1,79 +1,124 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "local": { - "type": "Identifier", - "name": "namespace", - "range": [ - 19, - 28 - ], + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "start": 14, + "end": 28, "loc": { "start": { "line": 1, - "column": 19 + "column": 14 }, "end": { "line": 1, "column": 28 } + }, + "range": [ + 14, + 28 + ], + "local": { + "type": "Identifier", + "start": 19, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 19, + 28 + ], + "name": "namespace" } - }, - "range": [ - 14, - 28 - ], + } + ], + "importKind": "typeof", + "source": { + "type": "Literal", + "start": 34, + "end": 39, "loc": { "start": { "line": 1, - "column": 14 + "column": 34 }, "end": { "line": 1, - "column": 28 + "column": 39 } - } - } - ], - "source": { - "type": "Literal", - "value": "bar", - "raw": "\"bar\"", - "range": [ - 34, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 34 }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "importKind": "typeof", - "range": [ - 0, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 + "range": [ + 34, + 39 + ], + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-grouping/1/expected.json b/test/fixtures/flow/type-grouping/1/expected.json index 185349edc4..2d535484a7 100644 --- a/test/fixtures/flow/type-grouping/1/expected.json +++ b/test/fixtures/flow/type-grouping/1/expected.json @@ -1,52 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 8, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 5, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "range": [ - 4, - 15 - ], + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 15, "loc": { "start": { "line": 1, @@ -56,40 +68,74 @@ "line": 1, "column": 15 } - } - }, - "init": null, - "range": [ - 4, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 15 - } + "range": [ + 4, + 15 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 4, + 15 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 5, + 15 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-grouping/2/expected.json b/test/fixtures/flow/type-grouping/2/expected.json index a0c9bc4ffd..5b2a8fe732 100644 --- a/test/fixtures/flow/type-grouping/2/expected.json +++ b/test/fixtures/flow/type-grouping/2/expected.json @@ -1,126 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "UnionTypeAnnotation", - "types": [ - { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 14, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "typeParameters": null, - "range": [ - 8, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - { - "type": "FunctionTypeAnnotation", - "params": [], - "returnType": { - "type": "StringTypeAnnotation", - "range": [ - 30, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "typeParameters": null, - "range": [ - 24, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], - "range": [ - 7, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "range": [ - 5, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "range": [ - 4, - 36 - ], + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 36, "loc": { "start": { "line": 1, @@ -130,40 +68,158 @@ "line": 1, "column": 36 } - } - }, - "init": null, - "range": [ - 4, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 36 - } + "range": [ + 4, + 36 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 4, + 36 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 5, + 36 + ], + "typeAnnotation": { + "type": "UnionTypeAnnotation", + "start": 7, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 7, + 36 + ], + "types": [ + { + "type": "FunctionTypeAnnotation", + "start": 8, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 8, + 20 + ], + "params": [], + "rest": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 14, + 20 + ] + }, + "typeParameters": null + }, + { + "type": "FunctionTypeAnnotation", + "start": 24, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 24, + 36 + ], + "params": [], + "rest": null, + "returnType": { + "type": "StringTypeAnnotation", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 30, + 36 + ] + }, + "typeParameters": null + } + ] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-grouping/3/expected.json b/test/fixtures/flow/type-grouping/3/expected.json index 201671108e..1c08f05d96 100644 --- a/test/fixtures/flow/type-grouping/3/expected.json +++ b/test/fixtures/flow/type-grouping/3/expected.json @@ -1,124 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "IntersectionTypeAnnotation", - "types": [ - { - "type": "NumberTypeAnnotation", - "range": [ - 7, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "UnionTypeAnnotation", - "types": [ - { - "type": "StringTypeAnnotation", - "range": [ - 17, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - { - "type": "BooleanTypeAnnotation", - "range": [ - 26, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], - "range": [ - 17, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], - "range": [ - 7, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "range": [ - 5, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "range": [ - 4, - 31 - ], + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 31, "loc": { "start": { "line": 1, @@ -128,40 +68,154 @@ "line": 1, "column": 31 } - } - }, - "init": null, - "range": [ - 4, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 31 - } + "range": [ + 4, + 31 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 4, + 31 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 5, + 31 + ], + "typeAnnotation": { + "type": "IntersectionTypeAnnotation", + "start": 7, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 7, + 31 + ], + "types": [ + { + "type": "NumberTypeAnnotation", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 7, + 13 + ] + }, + { + "type": "UnionTypeAnnotation", + "start": 17, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 17, + 30 + ], + "types": [ + { + "type": "StringTypeAnnotation", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 17, + 23 + ] + }, + { + "type": "BooleanTypeAnnotation", + "start": 26, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 26, + 30 + ] + } + ] + } + ] + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-grouping/4/expected.json b/test/fixtures/flow/type-grouping/4/expected.json index c18d9049c7..7689b316c2 100644 --- a/test/fixtures/flow/type-grouping/4/expected.json +++ b/test/fixtures/flow/type-grouping/4/expected.json @@ -1,88 +1,64 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "TypeofTypeAnnotation", - "argument": { - "type": "GenericTypeAnnotation", - "id": { - "type": "Identifier", - "name": "A", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "typeParameters": null, - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "range": [ - 8, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "range": [ - 5, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 4, - 17 - ], + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 17, "loc": { "start": { "line": 1, @@ -92,40 +68,114 @@ "line": 1, "column": 17 } - } - }, - "init": null, - "range": [ - 4, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 17 - } + "range": [ + 4, + 17 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 4, + 17 + ], + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 5, + 17 + ], + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 8, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 8, + 16 + ], + "argument": { + "type": "GenericTypeAnnotation", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "A" + } + } + } + } + }, + "init": null } - } - ], - "kind": "var", - "range": [ - 0, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } + ], + "kind": "var" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/typecasts/1/expected.json b/test/fixtures/flow/typecasts/1/expected.json index f418efc438..26dc93af10 100644 --- a/test/fixtures/flow/typecasts/1/expected.json +++ b/test/fixtures/flow/typecasts/1/expected.json @@ -1,17 +1,63 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "TypeCastExpression", + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], "expression": { - "type": "Identifier", - "name": "xxx", - "range": [ - 1, - 4 - ], + "type": "TypeCastExpression", + "start": 1, + "end": 12, "loc": { "start": { "line": 1, @@ -19,73 +65,74 @@ }, "end": { "line": 1, - "column": 4 + "column": 12 } - } - }, - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 6, - 12 - ], + }, + "range": [ + 1, + 12 + ], + "expression": { + "type": "Identifier", + "start": 1, + "end": 4, "loc": { "start": { "line": 1, - "column": 6 + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "name": "xxx" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 }, "end": { "line": 1, "column": 12 } - } - }, - "range": [ - 4, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 4 }, - "end": { - "line": 1, - "column": 12 + "range": [ + 4, + 12 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 6, + 12 + ] } - } - }, - "range": [ - 1, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 1 }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "range": [ - 0, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 + "parenthesizedExpression": true } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/typecasts/2/expected.json b/test/fixtures/flow/typecasts/2/expected.json index 2ed6e2670d..0fff048e38 100644 --- a/test/fixtures/flow/typecasts/2/expected.json +++ b/test/fixtures/flow/typecasts/2/expected.json @@ -1,134 +1,63 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "TypeCastExpression", + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 0, + 50 + ], + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 0, + 50 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 0, + 50 + ], "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "xxx", - "range": [ - 2, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "value": { - "type": "Literal", - "value": 0, - "raw": "0", - "range": [ - 7, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "range": [ - 2, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "yyy", - "range": [ - 10, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "value": { - "type": "Literal", - "value": "hey", - "raw": "\"hey\"", - "range": [ - 15, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "range": [ - 10, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "range": [ - 1, - 21 - ], + "type": "TypeCastExpression", + "start": 1, + "end": 49, "loc": { "start": { "line": 1, @@ -136,24 +65,206 @@ }, "end": { "line": 1, - "column": 21 + "column": 49 } - } - }, - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "ObjectTypeAnnotation", + }, + "range": [ + 1, + 49 + ], + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 1, + 21 + ], "properties": [ { - "type": "ObjectTypeProperty", + "type": "Property", + "start": 2, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 2, + 8 + ], + "method": false, + "shorthand": false, + "computed": false, "key": { "type": "Identifier", - "name": "xxx", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, "range": [ - 24, - 27 + 2, + 5 ], + "name": "xxx" + }, + "value": { + "type": "Literal", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "value": 0, + "rawValue": 0, + "raw": "0" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 10, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 10, + 20 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 10, + 13 + ], + "name": "yyy" + }, + "value": { + "type": "Literal", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 15, + 20 + ], + "value": "hey", + "rawValue": "hey", + "raw": "\"hey\"" + }, + "kind": "init" + } + ] + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 21, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 21, + 49 + ], + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 23, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 23, + 49 + ], + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 24, + "end": 36, "loc": { "start": { "line": 1, @@ -161,158 +272,120 @@ }, "end": { "line": 1, - "column": 27 + "column": 36 } - } - }, - "value": { - "type": "NumberTypeAnnotation", - "range": [ - 29, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "optional": false, - "range": [ - 24, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 24 }, - "end": { - "line": 1, - "column": 36 - } - } - }, - { - "type": "ObjectTypeProperty", - "key": { - "type": "Identifier", - "name": "yyy", "range": [ - 37, - 40 + 24, + 36 ], + "key": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 24, + 27 + ], + "name": "xxx" + }, + "value": { + "type": "NumberTypeAnnotation", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 29, + 35 + ] + }, + "optional": false + }, + { + "type": "ObjectTypeProperty", + "start": 37, + "end": 48, "loc": { "start": { "line": 1, "column": 37 }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "value": { - "type": "StringTypeAnnotation", - "range": [ - 42, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 42 - }, "end": { "line": 1, "column": 48 } - } - }, - "optional": false, - "range": [ - 37, - 48 - ], - "loc": { - "start": { - "line": 1, - "column": 37 }, - "end": { - "line": 1, - "column": 48 - } + "range": [ + 37, + 48 + ], + "key": { + "type": "Identifier", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 37, + 40 + ], + "name": "yyy" + }, + "value": { + "type": "StringTypeAnnotation", + "start": 42, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 42, + 48 + ] + }, + "optional": false } - } - ], - "indexers": [], - "callProperties": [], - "range": [ - 23, - 49 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 49 - } + ], + "indexers": [] } }, - "range": [ - 21, - 49 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, - "range": [ - 1, - 49 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, - "range": [ - 0, - 50 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 + "parenthesizedExpression": true } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/typecasts/3/expected.json b/test/fixtures/flow/typecasts/3/expected.json index c4be9fbf3c..4e896c60db 100644 --- a/test/fixtures/flow/typecasts/3/expected.json +++ b/test/fixtures/flow/typecasts/3/expected.json @@ -1,94 +1,63 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "TypeCastExpression", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "xxx", - "range": [ - 2, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], - "body": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "Identifier", - "name": "xxx", - "range": [ - 10, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "right": { - "type": "Literal", - "value": 1, - "raw": "1", - "range": [ - 16, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "range": [ - 10, - 17 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - } + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 0, + 43 + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 0, + 43 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "generator": false, - "expression": true, - "range": [ - 1, - 17 - ], + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 0, + 43 + ], + "expression": { + "type": "TypeCastExpression", + "start": 1, + "end": 42, "loc": { "start": { "line": 1, @@ -96,146 +65,243 @@ }, "end": { "line": 1, - "column": 17 + "column": 42 } - } - }, - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "FunctionTypeAnnotation", + }, + "range": [ + 1, + 42 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 1, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 1, + 17 + ], + "id": null, + "generator": false, + "expression": true, + "async": false, "params": [ { - "type": "FunctionTypeParam", - "name": { - "type": "Identifier", - "name": "xxx", - "range": [ - 20, - 23 - ], + "type": "Identifier", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 2, + 5 + ], + "name": "xxx" + } + ], + "body": { + "type": "BinaryExpression", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 10, + 17 + ], + "left": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 10, + 13 + ], + "name": "xxx" + }, + "operator": "+", + "right": { + "type": "Literal", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 17, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 17, + 42 + ], + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 19, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 19, + 42 + ], + "params": [ + { + "type": "FunctionTypeParam", + "start": 20, + "end": 31, "loc": { "start": { "line": 1, "column": 20 }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 25, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, "end": { "line": 1, "column": 31 } + }, + "range": [ + 20, + 31 + ], + "name": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 20, + 23 + ], + "name": "xxx" + }, + "optional": false, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 25, + 31 + ] } - }, - "optional": false, - "range": [ - 20, - 31 - ], + } + ], + "rest": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 36, + "end": 42, "loc": { "start": { "line": 1, - "column": 20 + "column": 36 }, "end": { "line": 1, - "column": 31 + "column": 42 } - } - } - ], - "returnType": { - "type": "NumberTypeAnnotation", - "range": [ - 36, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 36 }, - "end": { - "line": 1, - "column": 42 - } - } - }, - "typeParameters": null, - "range": [ - 19, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 19 + "range": [ + 36, + 42 + ] }, - "end": { - "line": 1, - "column": 42 - } + "typeParameters": null } }, - "range": [ - 17, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 42 - } - } - }, - "range": [ - 1, - 42 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 42 - } - } - }, - "range": [ - 0, - 43 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 + "parenthesizedExpression": true } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/flow/typecasts/4/expected.json b/test/fixtures/flow/typecasts/4/expected.json index 4b9fb14a39..60fae4fb1e 100644 --- a/test/fixtures/flow/typecasts/4/expected.json +++ b/test/fixtures/flow/typecasts/4/expected.json @@ -1,20 +1,82 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "SequenceExpression", - "expressions": [ - { - "type": "TypeCastExpression", - "expression": { - "type": "Identifier", - "name": "xxx", - "range": [ - 2, - 5 - ], + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "expression": { + "type": "SequenceExpression", + "start": 1, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 1, + 29 + ], + "expressions": [ + { + "type": "TypeCastExpression", + "start": 2, + "end": 13, "loc": { "start": { "line": 1, @@ -22,68 +84,77 @@ }, "end": { "line": 1, - "column": 5 + "column": 13 } - } - }, - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "range": [ - 7, - 13 - ], + }, + "range": [ + 2, + 13 + ], + "expression": { + "type": "Identifier", + "start": 2, + "end": 5, "loc": { "start": { "line": 1, - "column": 7 + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 2, + 5 + ], + "name": "xxx" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 5 }, "end": { "line": 1, "column": 13 } - } - }, - "range": [ - 5, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 5 }, - "end": { - "line": 1, - "column": 13 + "range": [ + 5, + 13 + ], + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 7, + 13 + ] } - } - }, - "range": [ - 2, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 2 }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "TypeCastExpression", - "expression": { - "type": "Identifier", - "name": "yyy", - "range": [ - 17, - 20 - ], + "parenthesizedExpression": true + }, + { + "type": "TypeCastExpression", + "start": 17, + "end": 28, "loc": { "start": { "line": 1, @@ -91,89 +162,77 @@ }, "end": { "line": 1, - "column": 20 + "column": 28 } - } - }, - "typeAnnotation": { - "type": "TypeAnnotation", - "typeAnnotation": { - "type": "StringTypeAnnotation", - "range": [ - 22, - 28 - ], + }, + "range": [ + 17, + 28 + ], + "expression": { + "type": "Identifier", + "start": 17, + "end": 20, "loc": { "start": { "line": 1, - "column": 22 + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 17, + 20 + ], + "name": "yyy" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 }, "end": { "line": 1, "column": 28 } - } - }, - "range": [ - 20, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 20 }, - "end": { - "line": 1, - "column": 28 + "range": [ + 20, + 28 + ], + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 22, + 28 + ] } - } - }, - "range": [ - 17, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 17 }, - "end": { - "line": 1, - "column": 28 - } + "parenthesizedExpression": true } - } - ], - "range": [ - 1, - 29 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "range": [ - 0, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 + ], + "parenthesizedExpression": true } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/1/expected.json b/test/fixtures/harmony/uncategorised/1/expected.json index 3973b139dc..c92341aa33 100644 --- a/test/fixtures/harmony/uncategorised/1/expected.json +++ b/test/fixtures/harmony/uncategorised/1/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "煎茶", - "raw": "\"\\u{714E}\\u{8336}\"", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 18 } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "value": "煎茶", + "rawValue": "煎茶", + "raw": "\"\\u{714E}\\u{8336}\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/10/expected.json b/test/fixtures/harmony/uncategorised/10/expected.json index 7f0161ffce..55afcf63af 100644 --- a/test/fixtures/harmony/uncategorised/10/expected.json +++ b/test/fixtures/harmony/uncategorised/10/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 2, - "raw": "0O2", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 3 } + }, + "range": [ + 0, + 3 + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "value": 2, + "rawValue": 2, + "raw": "0O2" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/100/expected.json b/test/fixtures/harmony/uncategorised/100/expected.json index 29c4f4ae36..c53461d3b3 100644 --- a/test/fixtures/harmony/uncategorised/100/expected.json +++ b/test/fixtures/harmony/uncategorised/100/expected.json @@ -1,107 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "YieldExpression", - "argument": null, - "delegate": false, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 2, - "column": 3 - } - } - }, - "generator": true, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - } - } - ], + "type": "File", + "start": 0, + "end": 26, "loc": { "start": { "line": 1, @@ -111,5 +11,174 @@ "line": 2, "column": 4 } + }, + "range": [ + 0, + 26 + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "range": [ + 0, + 26 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "range": [ + 0, + 26 + ], + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 25 + ], + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 14, + 25 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 16, + 21 + ], + "expression": { + "type": "YieldExpression", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 16, + 21 + ], + "delegate": false, + "argument": null + } + }, + { + "type": "ExpressionStatement", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "range": [ + 22, + 23 + ], + "expression": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "range": [ + 22, + 23 + ], + "name": "v" + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/101/expected.json b/test/fixtures/harmony/uncategorised/101/expected.json index 2d88ccba33..a037f50d2d 100644 --- a/test/fixtures/harmony/uncategorised/101/expected.json +++ b/test/fixtures/harmony/uncategorised/101/expected.json @@ -1,93 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "YieldExpression", - "argument": { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "delegate": true, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "generator": true, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], + "type": "File", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -97,5 +11,154 @@ "line": 1, "column": 27 } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 1, + 26 + ], + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 14, + 26 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 16, + 24 + ], + "expression": { + "type": "YieldExpression", + "start": 16, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 16, + 24 + ], + "delegate": true, + "argument": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 23, + 24 + ], + "name": "v" + } + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/102/expected.json b/test/fixtures/harmony/uncategorised/102/expected.json index 33047b7255..36adf7460f 100644 --- a/test/fixtures/harmony/uncategorised/102/expected.json +++ b/test/fixtures/harmony/uncategorised/102/expected.json @@ -1,93 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "test", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "YieldExpression", - "argument": { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "delegate": true, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "generator": true, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], + "type": "File", + "start": 0, + "end": 30, "loc": { "start": { "line": 1, @@ -97,5 +11,153 @@ "line": 1, "column": 30 } + }, + "range": [ + 0, + 30 + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 10, + 14 + ], + "name": "test" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 18, + 30 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 20, + 28 + ], + "expression": { + "type": "YieldExpression", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 20, + 28 + ], + "delegate": true, + "argument": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 27, + 28 + ], + "name": "v" + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/103/expected.json b/test/fixtures/harmony/uncategorised/103/expected.json index 0ca9c9e1f6..d7c678b756 100644 --- a/test/fixtures/harmony/uncategorised/103/expected.json +++ b/test/fixtures/harmony/uncategorised/103/expected.json @@ -1,169 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "test", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "YieldExpression", - "argument": { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "delegate": true, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "generator": true, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], + "type": "File", + "start": 0, + "end": 34, "loc": { "start": { "line": 1, @@ -173,5 +11,259 @@ "line": 1, "column": 34 } + }, + "range": [ + 0, + 34 + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 4, + 33 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 4, + 5 + ], + "name": "x" + }, + "init": { + "type": "ObjectExpression", + "start": 8, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 8, + 33 + ], + "properties": [ + { + "type": "Property", + "start": 10, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 10, + 31 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 11, + 15 + ], + "name": "test" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 16, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 16, + 31 + ], + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 19, + 31 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 21, + 29 + ], + "expression": { + "type": "YieldExpression", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 21, + 29 + ], + "delegate": true, + "argument": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 28, + 29 + ], + "name": "v" + } + } + } + ] + } + } + } + ] + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/104/expected.json b/test/fixtures/harmony/uncategorised/104/expected.json index 065b7382d4..953225b56f 100644 --- a/test/fixtures/harmony/uncategorised/104/expected.json +++ b/test/fixtures/harmony/uncategorised/104/expected.json @@ -1,46 +1,181 @@ { - "body": [ - { - "id": { - "name": "foo", - "type": "Identifier" - }, - "generator": true, - "expression": false, - "params": [], - "body": { - "body": [ - { - "expression": { - "callee": { - "object": { - "name": "console", - "type": "Identifier" - }, - "property": { - "name": "log", - "type": "Identifier" - }, - "computed": false, - "type": "MemberExpression" - }, - "arguments": [ - { - "delegate": false, - "argument": null, - "type": "YieldExpression" - } - ], - "type": "CallExpression" - }, - "type": "ExpressionStatement" - } - ], - "type": "BlockStatement" - }, - "type": "FunctionDeclaration" + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 } - ], - "sourceType": "script", - "type": "Program" + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "foo" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "expression": { + "type": "CallExpression", + "start": 18, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "callee": { + "type": "MemberExpression", + "start": 18, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "object": { + "type": "Identifier", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "console" + }, + "property": { + "type": "Identifier", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "log" + }, + "computed": false + }, + "arguments": [ + { + "type": "YieldExpression", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "delegate": false, + "argument": null + } + ] + } + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/105/expected.json b/test/fixtures/harmony/uncategorised/105/expected.json index 6eb7f3a6bd..8fb310f4db 100644 --- a/test/fixtures/harmony/uncategorised/105/expected.json +++ b/test/fixtures/harmony/uncategorised/105/expected.json @@ -1,51 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "t", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "generator": true, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -55,5 +11,93 @@ "line": 1, "column": 16 } + }, + "range": [ + 0, + 16 + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "t" + }, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 14, + 16 + ], + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/106/expected.json b/test/fixtures/harmony/uncategorised/106/expected.json index 046f2b7002..9d5385660b 100644 --- a/test/fixtures/harmony/uncategorised/106/expected.json +++ b/test/fixtures/harmony/uncategorised/106/expected.json @@ -1,108 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "YieldExpression", - "argument": { - "type": "YieldExpression", - "argument": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "delegate": false, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "delegate": false, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "generator": true, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], + "type": "File", + "start": 0, + "end": 33, "loc": { "start": { "line": 1, @@ -112,5 +11,176 @@ "line": 1, "column": 33 } + }, + "range": [ + 0, + 33 + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 1, + 32 + ], + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 14, + 32 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 16, + 30 + ], + "expression": { + "type": "YieldExpression", + "start": 16, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 16, + 30 + ], + "delegate": false, + "argument": { + "type": "YieldExpression", + "start": 22, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 22, + 30 + ], + "delegate": false, + "argument": { + "type": "Literal", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 28, + 30 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + } + } + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/107/expected.json b/test/fixtures/harmony/uncategorised/107/expected.json index 4ada2274fd..a47e72d406 100644 --- a/test/fixtures/harmony/uncategorised/107/expected.json +++ b/test/fixtures/harmony/uncategorised/107/expected.json @@ -1,104 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForOfStatement", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "right": { - "type": "Identifier", - "name": "list", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "process", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], + "type": "File", + "start": 0, + "end": 26, "loc": { "start": { "line": 1, @@ -108,5 +11,170 @@ "line": 1, "column": 26 } + }, + "range": [ + 0, + 26 + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "left": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 4, + 5 + ], + "name": "x" + }, + "right": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 9, + 13 + ], + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 15, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 15, + 26 + ], + "expression": { + "type": "CallExpression", + "start": 15, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 15, + 25 + ], + "callee": { + "type": "Identifier", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 15, + 22 + ], + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 23, + 24 + ], + "name": "x" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/108/expected.json b/test/fixtures/harmony/uncategorised/108/expected.json index a3eff64f7a..75c71c2b1d 100644 --- a/test/fixtures/harmony/uncategorised/108/expected.json +++ b/test/fixtures/harmony/uncategorised/108/expected.json @@ -1,134 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForOfStatement", - "left": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "right": { - "type": "Identifier", - "name": "list", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "process", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], + "type": "File", + "start": 0, + "end": 31, "loc": { "start": { "line": 1, @@ -138,5 +11,212 @@ "line": 1, "column": 31 } + }, + "range": [ + 0, + 31 + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 5, + 10 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "x" + }, + "init": null + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 14, + 18 + ], + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 20, + 31 + ], + "expression": { + "type": "CallExpression", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 20, + 30 + ], + "callee": { + "type": "Identifier", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 20, + 27 + ], + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 28, + 29 + ], + "name": "x" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/109/expected.json b/test/fixtures/harmony/uncategorised/109/expected.json index 367dd63bf2..65c6068088 100644 --- a/test/fixtures/harmony/uncategorised/109/expected.json +++ b/test/fixtures/harmony/uncategorised/109/expected.json @@ -1,148 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForOfStatement", - "left": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "init": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "right": { - "type": "Identifier", - "name": "list", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "process", - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], + "type": "File", + "start": 0, + "end": 36, "loc": { "start": { "line": 1, @@ -152,5 +11,233 @@ "line": 1, "column": 36 } + }, + "range": [ + 0, + 36 + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 0, + 36 + ], + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 5, + 15 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 9, + 15 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "x" + }, + "init": { + "type": "Literal", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 13, + 15 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 19, + 23 + ], + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 25, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 25, + 36 + ], + "expression": { + "type": "CallExpression", + "start": 25, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 25, + 35 + ], + "callee": { + "type": "Identifier", + "start": 25, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 25, + 32 + ], + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 33, + 34 + ], + "name": "x" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/11/expected.json b/test/fixtures/harmony/uncategorised/11/expected.json index 8346a99486..4812e74c0c 100644 --- a/test/fixtures/harmony/uncategorised/11/expected.json +++ b/test/fixtures/harmony/uncategorised/11/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 10, - "raw": "0O12", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], + "type": "File", + "start": 0, + "end": 4, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 4 } + }, + "range": [ + 0, + 4 + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "value": 10, + "rawValue": 10, + "raw": "0O12" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/110/expected.json b/test/fixtures/harmony/uncategorised/110/expected.json index 7d10cb4bfe..3a96e94ee4 100644 --- a/test/fixtures/harmony/uncategorised/110/expected.json +++ b/test/fixtures/harmony/uncategorised/110/expected.json @@ -1,134 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ForOfStatement", - "left": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "right": { - "type": "Identifier", - "name": "list", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "process", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], + "type": "File", + "start": 0, + "end": 31, "loc": { "start": { "line": 1, @@ -138,5 +11,212 @@ "line": 1, "column": 31 } + }, + "range": [ + 0, + 31 + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 5, + 10 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "x" + }, + "init": null + } + ], + "kind": "let" + }, + "right": { + "type": "Identifier", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 14, + 18 + ], + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 20, + 31 + ], + "expression": { + "type": "CallExpression", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 20, + 30 + ], + "callee": { + "type": "Identifier", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 20, + 27 + ], + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 28, + 29 + ], + "name": "x" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/111/expected.json b/test/fixtures/harmony/uncategorised/111/expected.json index 0936793167..2b37a831c6 100644 --- a/test/fixtures/harmony/uncategorised/111/expected.json +++ b/test/fixtures/harmony/uncategorised/111/expected.json @@ -1,91 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": { - "type": "ClassExpression", - "superClass": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "body": { - "type": "ClassBody", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], + "type": "File", + "start": 0, + "end": 26, "loc": { "start": { "line": 1, @@ -95,5 +11,152 @@ "line": 1, "column": 26 } + }, + "range": [ + 0, + 26 + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 4, + 26 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 4, + 5 + ], + "name": "A" + }, + "init": { + "type": "ClassExpression", + "start": 8, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 8, + 26 + ], + "id": null, + "superClass": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ], + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 24, + 26 + ], + "body": [] + } + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/112/expected.json b/test/fixtures/harmony/uncategorised/112/expected.json index 29eb53121e..83b27df7b9 100644 --- a/test/fixtures/harmony/uncategorised/112/expected.json +++ b/test/fixtures/harmony/uncategorised/112/expected.json @@ -1,103 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": { - "type": "ClassExpression", - "id": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "body": { - "type": "ClassBody", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "body": { - "type": "ClassBody", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 39 - } - } - } - ], + "type": "File", + "start": 0, + "end": 39, "loc": { "start": { "line": 1, @@ -107,5 +11,169 @@ "line": 1, "column": 39 } + }, + "range": [ + 0, + 39 + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": { + "type": "ClassExpression", + "start": 16, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 16, + 36 + ], + "id": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ], + "name": "B" + }, + "superClass": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 32, + 33 + ], + "name": "C" + }, + "body": { + "type": "ClassBody", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 34, + 36 + ], + "body": [] + } + }, + "body": { + "type": "ClassBody", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 37, + 39 + ], + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/113/expected.json b/test/fixtures/harmony/uncategorised/113/expected.json index ad003a453c..927c25bab8 100644 --- a/test/fixtures/harmony/uncategorised/113/expected.json +++ b/test/fixtures/harmony/uncategorised/113/expected.json @@ -1,111 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "kind": "method", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -115,5 +11,177 @@ "line": 1, "column": 18 } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 8, + 18 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 9, + 17 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "get" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 12, + 17 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 15, + 17 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/114/expected.json b/test/fixtures/harmony/uncategorised/114/expected.json index f59a86ce3e..88cadea1a3 100644 --- a/test/fixtures/harmony/uncategorised/114/expected.json +++ b/test/fixtures/harmony/uncategorised/114/expected.json @@ -1,111 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "kind": "method", - "static": true, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], + "type": "File", + "start": 0, + "end": 26, "loc": { "start": { "line": 1, @@ -115,5 +11,177 @@ "line": 1, "column": 26 } + }, + "range": [ + 0, + 26 + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 8, + 26 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 10, + 25 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 17, + 20 + ], + "name": "get" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 20, + 25 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 23, + 25 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/115/expected.json b/test/fixtures/harmony/uncategorised/115/expected.json index 72ee297980..2e168b4488 100644 --- a/test/fixtures/harmony/uncategorised/115/expected.json +++ b/test/fixtures/harmony/uncategorised/115/expected.json @@ -1,124 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "kind": "get", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], + "type": "File", + "start": 0, + "end": 32, "loc": { "start": { "line": 1, @@ -128,5 +11,196 @@ "line": 1, "column": 32 } + }, + "range": [ + 0, + 32 + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 0, + 32 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 0, + 32 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 18, + 32 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 19, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 19, + 31 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 23, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 23, + 26 + ], + "name": "foo" + }, + "static": false, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 26, + 31 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 29, + 31 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/116/expected.json b/test/fixtures/harmony/uncategorised/116/expected.json index eeeae8ea7f..130f2d6d28 100644 --- a/test/fixtures/harmony/uncategorised/116/expected.json +++ b/test/fixtures/harmony/uncategorised/116/expected.json @@ -1,124 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "kind": "get", - "static": true, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - } - } - ], + "type": "File", + "start": 0, + "end": 40, "loc": { "start": { "line": 1, @@ -128,5 +11,196 @@ "line": 1, "column": 40 } + }, + "range": [ + 0, + 40 + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 18, + 40 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 20, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 20, + 39 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 31, + 34 + ], + "name": "foo" + }, + "static": true, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 34, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 34, + 39 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 37, + 39 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/117/expected.json b/test/fixtures/harmony/uncategorised/117/expected.json index 9ef3b1b913..788769feea 100644 --- a/test/fixtures/harmony/uncategorised/117/expected.json +++ b/test/fixtures/harmony/uncategorised/117/expected.json @@ -1,126 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "kind": "set", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], + "type": "File", + "start": 0, + "end": 21, "loc": { "start": { "line": 1, @@ -130,5 +11,198 @@ "line": 1, "column": 21 } + }, + "range": [ + 0, + 21 + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 8, + 21 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 9, + 20 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "a" + }, + "static": false, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 14, + 20 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 18, + 20 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/118/expected.json b/test/fixtures/harmony/uncategorised/118/expected.json index 471037eac8..ac784b3fe7 100644 --- a/test/fixtures/harmony/uncategorised/118/expected.json +++ b/test/fixtures/harmony/uncategorised/118/expected.json @@ -1,126 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "kind": "set", - "static": true, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], + "type": "File", + "start": 0, + "end": 29, "loc": { "start": { "line": 1, @@ -130,5 +11,198 @@ "line": 1, "column": 29 } + }, + "range": [ + 0, + 29 + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 8, + 29 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 10, + 28 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "name": "a" + }, + "static": true, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 22, + 28 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 23, + 24 + ], + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 26, + 28 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/119/expected.json b/test/fixtures/harmony/uncategorised/119/expected.json index 9e7cf649a2..2a17a61889 100644 --- a/test/fixtures/harmony/uncategorised/119/expected.json +++ b/test/fixtures/harmony/uncategorised/119/expected.json @@ -1,126 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "set", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "kind": "method", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], + "type": "File", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, @@ -130,5 +11,198 @@ "line": 1, "column": 20 } + }, + "range": [ + 0, + 20 + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 8, + 20 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 9, + 18 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "set" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 12, + 18 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 16, + 18 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/12/expected.json b/test/fixtures/harmony/uncategorised/12/expected.json index 7f24ff3c97..d2d04221dd 100644 --- a/test/fixtures/harmony/uncategorised/12/expected.json +++ b/test/fixtures/harmony/uncategorised/12/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 0, - "raw": "0b0", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 3 } + }, + "range": [ + 0, + 3 + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "value": 0, + "rawValue": 0, + "raw": "0b0" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/120/expected.json b/test/fixtures/harmony/uncategorised/120/expected.json index 395779feed..919b4201a2 100644 --- a/test/fixtures/harmony/uncategorised/120/expected.json +++ b/test/fixtures/harmony/uncategorised/120/expected.json @@ -1,126 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "set", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "kind": "method", - "static": true, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], + "type": "File", + "start": 0, + "end": 28, "loc": { "start": { "line": 1, @@ -130,5 +11,198 @@ "line": 1, "column": 28 } + }, + "range": [ + 0, + 28 + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 8, + 28 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 10, + 26 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 17, + 20 + ], + "name": "set" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 20, + 26 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 24, + 26 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/121/expected.json b/test/fixtures/harmony/uncategorised/121/expected.json index 03d4f98c4f..bfbe2304f0 100644 --- a/test/fixtures/harmony/uncategorised/121/expected.json +++ b/test/fixtures/harmony/uncategorised/121/expected.json @@ -1,168 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "gen", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "YieldExpression", - "argument": { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "delegate": false, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "generator": true, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "kind": "method", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], + "type": "File", + "start": 0, + "end": 30, "loc": { "start": { "line": 1, @@ -172,5 +11,258 @@ "line": 1, "column": 30 } + }, + "range": [ + 0, + 30 + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 8, + 30 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 9, + 29 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 10, + 13 + ], + "name": "gen" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 13, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 13, + 29 + ], + "id": null, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 17, + 29 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 19, + 27 + ], + "expression": { + "type": "YieldExpression", + "start": 19, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 19, + 26 + ], + "delegate": false, + "argument": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 25, + 26 + ], + "name": "v" + } + } + } + ] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/122/expected.json b/test/fixtures/harmony/uncategorised/122/expected.json index 776797081f..4f9a3b3590 100644 --- a/test/fixtures/harmony/uncategorised/122/expected.json +++ b/test/fixtures/harmony/uncategorised/122/expected.json @@ -1,168 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "gen", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "YieldExpression", - "argument": { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "delegate": false, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "generator": true, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "kind": "method", - "static": true, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } - } - } - ], + "type": "File", + "start": 0, + "end": 38, "loc": { "start": { "line": 1, @@ -172,5 +11,258 @@ "line": 1, "column": 38 } + }, + "range": [ + 0, + 38 + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 8, + 38 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 10, + 37 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 18, + 21 + ], + "name": "gen" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 21, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 21, + 37 + ], + "id": null, + "generator": true, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ], + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 25, + 37 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 27, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 27, + 35 + ], + "expression": { + "type": "YieldExpression", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 27, + 34 + ], + "delegate": false, + "argument": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 33, + 34 + ], + "name": "v" + } + } + } + ] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/123/expected.json b/test/fixtures/harmony/uncategorised/123/expected.json index e744391c50..a08a86c29e 100644 --- a/test/fixtures/harmony/uncategorised/123/expected.json +++ b/test/fixtures/harmony/uncategorised/123/expected.json @@ -1,193 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "use strict", - "raw": "\"use strict\"", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "ClassExpression", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Super", - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 45 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 47 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, - "kind": "constructor", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 49 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 51 - } - } - } - ], + "type": "File", + "start": 0, + "end": 51, "loc": { "start": { "line": 1, @@ -197,5 +11,297 @@ "line": 1, "column": 51 } + }, + "range": [ + 0, + 51 + ], + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 0, + 51 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + }, + { + "type": "ExpressionStatement", + "start": 14, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 14, + 51 + ], + "expression": { + "type": "ClassExpression", + "start": 15, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 15, + 50 + ], + "id": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 23, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 23, + 50 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 24, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 24, + 49 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 24, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 24, + 35 + ], + "name": "constructor" + }, + "static": false, + "kind": "constructor", + "value": { + "type": "FunctionExpression", + "start": 35, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 35, + 49 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 38, + 49 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 40, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 40, + 47 + ], + "expression": { + "type": "CallExpression", + "start": 40, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 40, + 47 + ], + "callee": { + "type": "Super", + "start": 40, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 40, + 45 + ] + }, + "arguments": [] + } + } + ] + } + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/124/expected.json b/test/fixtures/harmony/uncategorised/124/expected.json index e7930f02c5..7a76a503ec 100644 --- a/test/fixtures/harmony/uncategorised/124/expected.json +++ b/test/fixtures/harmony/uncategorised/124/expected.json @@ -1,39 +1,153 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A" + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Literal", - "value": "constructor" + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 }, - "static": false, - "kind": "constructor", - "value": { - "type": "FunctionExpression", - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "body": [] + "end": { + "line": 1, + "column": 7 + } + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "computed": false, + "key": { + "type": "Literal", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": "constructor", + "rawValue": "constructor", + "raw": "'constructor'" + }, + "static": false, + "kind": "constructor", + "value": { + "type": "FunctionExpression", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [] + } } } - } - ] + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/128/expected.json b/test/fixtures/harmony/uncategorised/128/expected.json index 3f054f61f4..38a79bf1f0 100644 --- a/test/fixtures/harmony/uncategorised/128/expected.json +++ b/test/fixtures/harmony/uncategorised/128/expected.json @@ -1,111 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "kind": "method", - "static": true, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], + "type": "File", + "start": 0, + "end": 25, "loc": { "start": { "line": 1, @@ -115,5 +11,177 @@ "line": 1, "column": 25 } + }, + "range": [ + 0, + 25 + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 8, + 25 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 9, + 24 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 16, + 19 + ], + "name": "foo" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 19, + 24 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 22, + 24 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/129/expected.json b/test/fixtures/harmony/uncategorised/129/expected.json index 6142009d61..d007681d5d 100644 --- a/test/fixtures/harmony/uncategorised/129/expected.json +++ b/test/fixtures/harmony/uncategorised/129/expected.json @@ -1,172 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "kind": "method", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "kind": "method", - "static": true, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], + "type": "File", + "start": 0, + "end": 34, "loc": { "start": { "line": 1, @@ -176,5 +11,262 @@ "line": 1, "column": 34 } + }, + "range": [ + 0, + 34 + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 8, + 34 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 9, + 17 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "name": "foo" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 12, + 17 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 15, + 17 + ], + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 18, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 18, + 33 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 25, + 28 + ], + "name": "bar" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 28, + 33 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 31, + 33 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/13/expected.json b/test/fixtures/harmony/uncategorised/13/expected.json index 2c167c3ba1..68b1e202b9 100644 --- a/test/fixtures/harmony/uncategorised/13/expected.json +++ b/test/fixtures/harmony/uncategorised/13/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 1, - "raw": "0b1", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 3 } + }, + "range": [ + 0, + 3 + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "value": 1, + "rawValue": 1, + "raw": "0b1" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/130/expected.json b/test/fixtures/harmony/uncategorised/130/expected.json index 72e824020e..42678c8c97 100644 --- a/test/fixtures/harmony/uncategorised/130/expected.json +++ b/test/fixtures/harmony/uncategorised/130/expected.json @@ -1,193 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "use strict", - "raw": "\"use strict\"", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "ClassExpression", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 43 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Super", - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 53 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 55 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 57 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 57 - } - } - }, - "kind": "method", - "static": true, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 57 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 59 - } - } - } - ], + "type": "File", + "start": 0, + "end": 59, "loc": { "start": { "line": 1, @@ -197,5 +11,297 @@ "line": 1, "column": 59 } + }, + "range": [ + 0, + 59 + ], + "program": { + "type": "Program", + "start": 0, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "range": [ + 0, + 59 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "value": "use strict", + "rawValue": "use strict", + "raw": "\"use strict\"" + } + }, + { + "type": "ExpressionStatement", + "start": 14, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "range": [ + 14, + 59 + ], + "expression": { + "type": "ClassExpression", + "start": 15, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "range": [ + 15, + 58 + ], + "id": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 23, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "range": [ + 23, + 58 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 25, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "range": [ + 25, + 57 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 32, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 32, + 43 + ], + "name": "constructor" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 43, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "range": [ + 43, + 57 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 46, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "range": [ + 46, + 57 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 48, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "range": [ + 48, + 55 + ], + "expression": { + "type": "CallExpression", + "start": 48, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "range": [ + 48, + 55 + ], + "callee": { + "type": "Super", + "start": 48, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 48, + 53 + ] + }, + "arguments": [] + } + } + ] + } + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/131/expected.json b/test/fixtures/harmony/uncategorised/131/expected.json index 68f09ba499..61ebd222a8 100644 --- a/test/fixtures/harmony/uncategorised/131/expected.json +++ b/test/fixtures/harmony/uncategorised/131/expected.json @@ -1,172 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "kind": "method", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "kind": "method", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], + "type": "File", + "start": 0, + "end": 28, "loc": { "start": { "line": 1, @@ -176,5 +11,262 @@ "line": 1, "column": 28 } + }, + "range": [ + 0, + 28 + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 8, + 28 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 10, + 18 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 10, + 13 + ], + "name": "foo" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 13, + 18 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 16, + 18 + ], + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 19, + 27 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 19, + 22 + ], + "name": "bar" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 22, + 27 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 25, + 27 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/132/expected.json b/test/fixtures/harmony/uncategorised/132/expected.json index de7232921c..bd0dfa4081 100644 --- a/test/fixtures/harmony/uncategorised/132/expected.json +++ b/test/fixtures/harmony/uncategorised/132/expected.json @@ -1,187 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "kind": "get", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "kind": "set", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - } - } - ], + "type": "File", + "start": 0, + "end": 37, "loc": { "start": { "line": 1, @@ -191,5 +11,283 @@ "line": 1, "column": 37 } + }, + "range": [ + 0, + 37 + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 0, + 37 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 0, + 37 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 8, + 37 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 10, + 22 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 14, + 17 + ], + "name": "foo" + }, + "static": false, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 17, + 22 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 20, + 22 + ], + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 23, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 23, + 36 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 27, + 30 + ], + "name": "foo" + }, + "static": false, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 30, + 36 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 31, + 32 + ], + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 34, + 36 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/133/expected.json b/test/fixtures/harmony/uncategorised/133/expected.json index 1424f26134..633498acde 100644 --- a/test/fixtures/harmony/uncategorised/133/expected.json +++ b/test/fixtures/harmony/uncategorised/133/expected.json @@ -1,172 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "kind": "get", - "static": true, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 42 - } - } - }, - "kind": "get", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 42 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - } - } - ], + "type": "File", + "start": 0, + "end": 43, "loc": { "start": { "line": 1, @@ -176,5 +11,262 @@ "line": 1, "column": 43 } + }, + "range": [ + 0, + 43 + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 0, + 43 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 0, + 43 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "range": [ + 8, + 43 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 10, + 29 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 21, + 24 + ], + "name": "foo" + }, + "static": true, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 24, + 29 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 27, + 29 + ], + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 30, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 30, + 42 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 34, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 34, + 37 + ], + "name": "foo" + }, + "static": false, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 37, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 37, + 42 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 40, + 42 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/134/expected.json b/test/fixtures/harmony/uncategorised/134/expected.json index 3a5e00c965..0707a1e872 100644 --- a/test/fixtures/harmony/uncategorised/134/expected.json +++ b/test/fixtures/harmony/uncategorised/134/expected.json @@ -1,172 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "kind": "get", - "static": true, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 44 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, - "kind": "get", - "static": true, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 49 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - } - } - ], + "type": "File", + "start": 0, + "end": 51, "loc": { "start": { "line": 1, @@ -176,5 +11,262 @@ "line": 1, "column": 51 } + }, + "range": [ + 0, + 51 + ], + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 0, + 51 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 0, + 51 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 8, + 51 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 10, + 29 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 21, + 24 + ], + "name": "foo" + }, + "static": true, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 24, + 29 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 27, + 29 + ], + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 30, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 30, + 49 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 41, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "range": [ + 41, + 44 + ], + "name": "bar" + }, + "static": true, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 44, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 44, + 49 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 47, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 47, + 49 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/135/expected.json b/test/fixtures/harmony/uncategorised/135/expected.json index c1099f1aa5..0af49eedb3 100644 --- a/test/fixtures/harmony/uncategorised/135/expected.json +++ b/test/fixtures/harmony/uncategorised/135/expected.json @@ -1,324 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "kind": "get", - "static": true, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 44 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 46 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - "kind": "set", - "static": true, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 58 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 61 - }, - "end": { - "line": 1, - "column": 63 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 58 - }, - "end": { - "line": 1, - "column": 63 - } - } - }, - "kind": "get", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 63 - } - } - }, - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 68 - }, - "end": { - "line": 1, - "column": 71 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 72 - }, - "end": { - "line": 1, - "column": 73 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 75 - }, - "end": { - "line": 1, - "column": 77 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 71 - }, - "end": { - "line": 1, - "column": 77 - } - } - }, - "kind": "set", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 64 - }, - "end": { - "line": 1, - "column": 77 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 78 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 78 - } - } - } - ], + "type": "File", + "start": 0, + "end": 78, "loc": { "start": { "line": 1, @@ -328,5 +11,474 @@ "line": 1, "column": 78 } + }, + "range": [ + 0, + 78 + ], + "program": { + "type": "Program", + "start": 0, + "end": 78, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 78 + } + }, + "range": [ + 0, + 78 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 78, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 78 + } + }, + "range": [ + 0, + 78 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 78, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 78 + } + }, + "range": [ + 8, + 78 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 10, + 29 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 21, + 24 + ], + "name": "foo" + }, + "static": true, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 24, + 29 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 27, + 29 + ], + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 30, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 30, + 50 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 41, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "range": [ + 41, + 44 + ], + "name": "foo" + }, + "static": true, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 44, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 44, + 50 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "range": [ + 45, + 46 + ], + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 48, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 48, + 50 + ], + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 51, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "range": [ + 51, + 63 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 55, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "range": [ + 55, + 58 + ], + "name": "foo" + }, + "static": false, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 58, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 58 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "range": [ + 58, + 63 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 61, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 61 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "range": [ + 61, + 63 + ], + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 64, + "end": 77, + "loc": { + "start": { + "line": 1, + "column": 64 + }, + "end": { + "line": 1, + "column": 77 + } + }, + "range": [ + 64, + 77 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 68, + "end": 71, + "loc": { + "start": { + "line": 1, + "column": 68 + }, + "end": { + "line": 1, + "column": 71 + } + }, + "range": [ + 68, + 71 + ], + "name": "foo" + }, + "static": false, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 71, + "end": 77, + "loc": { + "start": { + "line": 1, + "column": 71 + }, + "end": { + "line": 1, + "column": 77 + } + }, + "range": [ + 71, + 77 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 72, + "end": 73, + "loc": { + "start": { + "line": 1, + "column": 72 + }, + "end": { + "line": 1, + "column": 73 + } + }, + "range": [ + 72, + 73 + ], + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 75, + "end": 77, + "loc": { + "start": { + "line": 1, + "column": 75 + }, + "end": { + "line": 1, + "column": 77 + } + }, + "range": [ + 75, + 77 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/136/expected.json b/test/fixtures/harmony/uncategorised/136/expected.json index c0b658c4d0..77970e1f12 100644 --- a/test/fixtures/harmony/uncategorised/136/expected.json +++ b/test/fixtures/harmony/uncategorised/136/expected.json @@ -1,5 +1,7 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 29, "loc": { "start": { "line": 1, @@ -10,110 +12,176 @@ "column": 29 } }, - "body": [ - { - "type": "ClassDeclaration", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } + "range": [ + 0, + 29 + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "id": { - "type": "Identifier", + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 29, "loc": { "start": { "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "name": "A" - }, - "superClass": null, - "body": { - "type": "ClassBody", - "loc": { - "start": { - "line": 1, - "column": 8 + "column": 0 }, "end": { "line": 1, "column": 29 } }, - "body": [ - { - "type": "MethodDefinition", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } + "range": [ + 0, + 29 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 }, - "static": true, - "computed": true, - "key": { - "type": "Identifier", + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 8, + 29 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 27, "loc": { "start": { "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "name": "foo" - }, - "kind": "method", - "value": { - "type": "FunctionExpression", - "loc": { - "start": { - "line": 1, - "column": 22 + "column": 10 }, "end": { "line": 1, "column": 27 } }, - "id": null, - "params": [], - "generator": false, - "body": { - "type": "BlockStatement", + "range": [ + 10, + 27 + ], + "computed": true, + "key": { + "type": "Identifier", + "start": 18, + "end": 21, "loc": { "start": { "line": 1, - "column": 25 + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 18, + 21 + ], + "name": "foo" + }, + "static": true, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 }, "end": { "line": 1, "column": 27 } }, - "body": [] - }, - "expression": false + "range": [ + 22, + 27 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 25, + 27 + ], + "body": [] + } + } } - } - ] + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/137/expected.json b/test/fixtures/harmony/uncategorised/137/expected.json index 46a9e9ccca..f2d68f9da6 100644 --- a/test/fixtures/harmony/uncategorised/137/expected.json +++ b/test/fixtures/harmony/uncategorised/137/expected.json @@ -1,5 +1,7 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 33, "loc": { "start": { "line": 1, @@ -10,114 +12,176 @@ "column": 33 } }, - "body": [ - { - "type": "ClassDeclaration", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } + "range": [ + 0, + 33 + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "id": { - "type": "Identifier", + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 33, "loc": { "start": { "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 6, - 7 - ], - "name": "A" - }, - "superClass": null, - "body": { - "type": "ClassBody", - "loc": { - "start": { - "line": 1, - "column": 8 + "column": 0 }, "end": { "line": 1, "column": 33 } }, - "body": [ - { - "type": "MethodDefinition", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 31 - } + "range": [ + 0, + 33 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 }, - "static": true, - "computed": true, - "key": { - "type": "Identifier", + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 8, + 33 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 31, "loc": { "start": { "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "name": "foo" - }, - "kind": "get", - "value": { - "type": "FunctionExpression", - "loc": { - "start": { - "line": 1, - "column": 26 + "column": 10 }, "end": { "line": 1, "column": 31 } }, - "id": null, - "params": [], - "generator": false, - "body": { - "type": "BlockStatement", + "range": [ + 10, + 31 + ], + "computed": true, + "key": { + "type": "Identifier", + "start": 22, + "end": 25, "loc": { "start": { "line": 1, - "column": 29 + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 22, + 25 + ], + "name": "foo" + }, + "static": true, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 }, "end": { "line": 1, "column": 31 } }, - "body": [] - }, - "expression": false + "range": [ + 26, + 31 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 29, + 31 + ], + "body": [] + } + } } - } - ] + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/138/expected.json b/test/fixtures/harmony/uncategorised/138/expected.json index c5f49b7ae4..133e316e83 100644 --- a/test/fixtures/harmony/uncategorised/138/expected.json +++ b/test/fixtures/harmony/uncategorised/138/expected.json @@ -1,187 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "kind": "set", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "kind": "get", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } - } - } - ], + "type": "File", + "start": 0, + "end": 38, "loc": { "start": { "line": 1, @@ -191,5 +11,283 @@ "line": 1, "column": 38 } + }, + "range": [ + 0, + 38 + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 8, + 38 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 10, + 23 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 14, + 17 + ], + "name": "foo" + }, + "static": false, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 17, + 23 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 21, + 23 + ], + "body": [] + } + } + }, + { + "type": "MethodDefinition", + "start": 24, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 24, + 36 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 28, + 31 + ], + "name": "foo" + }, + "static": false, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 31, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 31, + 36 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 34, + 36 + ], + "body": [] + } + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/139/expected.json b/test/fixtures/harmony/uncategorised/139/expected.json index b32b31c0ed..d0d6907fe0 100644 --- a/test/fixtures/harmony/uncategorised/139/expected.json +++ b/test/fixtures/harmony/uncategorised/139/expected.json @@ -1,5 +1,7 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 33, "loc": { "start": { "line": 1, @@ -10,171 +12,261 @@ "column": 33 } }, - "body": [ - { - "type": "ClassDeclaration", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } + "range": [ + 0, + 33 + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "id": { - "type": "Identifier", + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 33, "loc": { "start": { "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "name": "A" - }, - "superClass": null, - "body": { - "type": "ClassBody", - "loc": { - "start": { - "line": 1, - "column": 8 + "column": 0 }, "end": { "line": 1, "column": 33 } }, - "body": [ - { - "type": "MethodDefinition", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } + "range": [ + 0, + 33 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 }, - "static": false, - "computed": false, - "key": { - "type": "Identifier", + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 8, + 33 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 18, "loc": { "start": { "line": 1, "column": 10 }, - "end": { - "line": 1, - "column": 13 - } - }, - "name": "foo" - }, - "kind": "method", - "value": { - "type": "FunctionExpression", - "loc": { - "start": { - "line": 1, - "column": 13 - }, "end": { "line": 1, "column": 18 } }, - "id": null, - "params": [], - "generator": false, - "body": { - "type": "BlockStatement", + "range": [ + 10, + 18 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 13, "loc": { "start": { "line": 1, - "column": 16 + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 10, + 13 + ], + "name": "foo" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 }, "end": { "line": 1, "column": 18 } }, - "body": [] - }, - "expression": false - } - }, - { - "type": "MethodDefinition", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 + "range": [ + 13, + 18 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 16, + 18 + ], + "body": [] + } } }, - "static": false, - "computed": false, - "key": { - "type": "Identifier", + { + "type": "MethodDefinition", + "start": 19, + "end": 31, "loc": { "start": { "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "name": "foo" - }, - "kind": "get", - "value": { - "type": "FunctionExpression", - "loc": { - "start": { - "line": 1, - "column": 26 + "column": 19 }, "end": { "line": 1, "column": 31 } }, - "id": null, - "params": [], - "generator": false, - "body": { - "type": "BlockStatement", + "range": [ + 19, + 31 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 23, + "end": 26, "loc": { "start": { "line": 1, - "column": 29 + "column": 23 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 23, + 26 + ], + "name": "foo" + }, + "static": false, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 }, "end": { "line": 1, "column": 31 } }, - "body": [] - }, - "expression": false + "range": [ + 26, + 31 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 29, + 31 + ], + "body": [] + } + } } - } - ] + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/14/expected.json b/test/fixtures/harmony/uncategorised/14/expected.json index efd4ea799c..11d6629495 100644 --- a/test/fixtures/harmony/uncategorised/14/expected.json +++ b/test/fixtures/harmony/uncategorised/14/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 2, - "raw": "0b10", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], + "type": "File", + "start": 0, + "end": 4, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 4 } + }, + "range": [ + 0, + 4 + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "value": 2, + "rawValue": 2, + "raw": "0b10" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/140/expected.json b/test/fixtures/harmony/uncategorised/140/expected.json index b22470d6c6..3753e5e93b 100644 --- a/test/fixtures/harmony/uncategorised/140/expected.json +++ b/test/fixtures/harmony/uncategorised/140/expected.json @@ -1,5 +1,7 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 21, "loc": { "start": { "line": 1, @@ -10,48 +12,90 @@ "column": 21 } }, - "body": [ - { - "type": "ClassDeclaration", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } + "range": [ + 0, + 21 + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "id": { - "type": "Identifier", + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 21, "loc": { "start": { "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "name": "Semicolon" - }, - "superClass": null, - "body": { - "type": "ClassBody", - "loc": { - "start": { - "line": 1, - "column": 16 + "column": 0 }, "end": { "line": 1, "column": 21 } }, - "body": [] + "range": [ + 0, + 21 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 6, + 15 + ], + "name": "Semicolon" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 16, + 21 + ], + "body": [] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/141/expected.json b/test/fixtures/harmony/uncategorised/141/expected.json index 7426f53989..50f51ac49c 100644 --- a/test/fixtures/harmony/uncategorised/141/expected.json +++ b/test/fixtures/harmony/uncategorised/141/expected.json @@ -1,81 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "value": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -85,5 +11,137 @@ "line": 1, "column": 11 } + }, + "range": [ + 0, + 11 + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 1, + 10 + ], + "properties": [ + { + "type": "Property", + "start": 2, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 2, + 9 + ], + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "x" + }, + "value": { + "type": "Literal", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 7, + 9 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + }, + "kind": "init" + } + ], + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/142/expected.json b/test/fixtures/harmony/uncategorised/142/expected.json index adbdff1904..4f0178e80f 100644 --- a/test/fixtures/harmony/uncategorised/142/expected.json +++ b/test/fixtures/harmony/uncategorised/142/expected.json @@ -1,111 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "Literal", - "value": "x", - "raw": "\"x\"", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "right": { - "type": "Literal", - "value": "y", - "raw": "\"y\"", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "value": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], + "type": "File", + "start": 0, + "end": 19, "loc": { "start": { "line": 1, @@ -115,5 +11,181 @@ "line": 1, "column": 19 } + }, + "range": [ + 0, + 19 + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 1, + 18 + ], + "properties": [ + { + "type": "Property", + "start": 2, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 2, + 17 + ], + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "BinaryExpression", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 3, + 12 + ], + "left": { + "type": "Literal", + "start": 3, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 3, + 6 + ], + "value": "x", + "rawValue": "x", + "raw": "\"x\"" + }, + "operator": "+", + "right": { + "type": "Literal", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "value": "y", + "rawValue": "y", + "raw": "\"y\"" + } + }, + "value": { + "type": "Literal", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 15, + 17 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + }, + "kind": "init" + } + ], + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/143/expected.json b/test/fixtures/harmony/uncategorised/143/expected.json index d65eabc3ac..f99dd153d0 100644 --- a/test/fixtures/harmony/uncategorised/143/expected.json +++ b/test/fixtures/harmony/uncategorised/143/expected.json @@ -1,97 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -101,5 +11,158 @@ "line": 1, "column": 22 } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 1, + 21 + ], + "properties": [ + { + "type": "Property", + "start": 2, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 2, + 20 + ], + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "x" + }, + "value": { + "type": "FunctionExpression", + "start": 7, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 7, + 20 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 18, + 20 + ], + "body": [] + } + }, + "kind": "init" + } + ], + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/144/expected.json b/test/fixtures/harmony/uncategorised/144/expected.json index 69c00cfdb6..df4487b72e 100644 --- a/test/fixtures/harmony/uncategorised/144/expected.json +++ b/test/fixtures/harmony/uncategorised/144/expected.json @@ -1,127 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "value": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "value": { - "type": "Literal", - "value": 20, - "raw": "20", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -131,5 +11,202 @@ "line": 1, "column": 18 } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 1, + 17 + ], + "properties": [ + { + "type": "Property", + "start": 2, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 2, + 9 + ], + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "x" + }, + "value": { + "type": "Literal", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 7, + 9 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 11, + 16 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "y" + }, + "value": { + "type": "Literal", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 14, + 16 + ], + "value": 20, + "rawValue": 20, + "raw": "20" + }, + "kind": "init" + } + ], + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/145/expected.json b/test/fixtures/harmony/uncategorised/145/expected.json index 4ee1696372..344cc40864 100644 --- a/test/fixtures/harmony/uncategorised/145/expected.json +++ b/test/fixtures/harmony/uncategorised/145/expected.json @@ -1,174 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "kind": "get", - "method": false, - "shorthand": false, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "kind": "set", - "method": false, - "shorthand": false, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], + "type": "File", + "start": 0, + "end": 31, "loc": { "start": { "line": 1, @@ -178,5 +11,265 @@ "line": 1, "column": 31 } + }, + "range": [ + 0, + 31 + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 1, + 30 + ], + "properties": [ + { + "type": "Property", + "start": 2, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 2, + 14 + ], + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "x" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 9, + 14 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 12, + 14 + ], + "body": [] + } + } + }, + { + "type": "Property", + "start": 16, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 16, + 29 + ], + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "name": "x" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 23, + 29 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 24, + 25 + ], + "name": "v" + } + ], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 27, + 29 + ], + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/146/expected.json b/test/fixtures/harmony/uncategorised/146/expected.json index 261688ef42..dea23e5746 100644 --- a/test/fixtures/harmony/uncategorised/146/expected.json +++ b/test/fixtures/harmony/uncategorised/146/expected.json @@ -1,97 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -101,5 +11,158 @@ "line": 1, "column": 12 } + }, + "range": [ + 0, + 12 + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 1, + 11 + ], + "properties": [ + { + "type": "Property", + "start": 2, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 2, + 10 + ], + "method": true, + "shorthand": false, + "computed": true, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 5, + 10 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 8, + 10 + ], + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/147/expected.json b/test/fixtures/harmony/uncategorised/147/expected.json index 9f53df10ae..f720c47d16 100644 --- a/test/fixtures/harmony/uncategorised/147/expected.json +++ b/test/fixtures/harmony/uncategorised/147/expected.json @@ -1,156 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "value": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "value": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -160,5 +11,240 @@ "line": 1, "column": 18 } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 4, + 18 + ], + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 4, + 12 + ], + "properties": [ + { + "type": "Property", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 5, + 11 + ], + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "y" + }, + "kind": "init" + } + ] + }, + "init": { + "type": "ObjectExpression", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 15, + 18 + ], + "properties": [ + { + "type": "Property", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "y" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "y" + } + } + ] + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/148/expected.json b/test/fixtures/harmony/uncategorised/148/expected.json index bd8ed7548c..9f1ac19fe0 100644 --- a/test/fixtures/harmony/uncategorised/148/expected.json +++ b/test/fixtures/harmony/uncategorised/148/expected.json @@ -1,112 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "params": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], + "type": "File", + "start": 0, + "end": 23, "loc": { "start": { "line": 1, @@ -116,5 +11,178 @@ "line": 1, "column": 23 } + }, + "range": [ + 0, + 23 + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "f" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 11, + 19 + ], + "properties": [ + { + "type": "Property", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 12, + 18 + ], + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "name": "y" + }, + "kind": "init" + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 21, + 23 + ], + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/149/expected.json b/test/fixtures/harmony/uncategorised/149/expected.json index 9f2f3bd04b..2558dda873 100644 --- a/test/fixtures/harmony/uncategorised/149/expected.json +++ b/test/fixtures/harmony/uncategorised/149/expected.json @@ -1,169 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "test", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "YieldExpression", - "argument": { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "delegate": true, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "generator": true, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], + "type": "File", + "start": 0, + "end": 33, "loc": { "start": { "line": 1, @@ -173,5 +11,259 @@ "line": 1, "column": 33 } + }, + "range": [ + 0, + 33 + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 4, + 33 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 4, + 5 + ], + "name": "x" + }, + "init": { + "type": "ObjectExpression", + "start": 8, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 8, + 33 + ], + "properties": [ + { + "type": "Property", + "start": 9, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 9, + 32 + ], + "method": true, + "shorthand": false, + "computed": true, + "key": { + "type": "Identifier", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 11, + 15 + ], + "name": "test" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 16, + 32 + ], + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 19, + 32 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 21, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 21, + 30 + ], + "expression": { + "type": "YieldExpression", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 21, + 29 + ], + "delegate": true, + "argument": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 28, + 29 + ], + "name": "v" + } + } + } + ] + } + } + } + ] + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/15/expected.json b/test/fixtures/harmony/uncategorised/15/expected.json index c89090ec1e..fd5457d090 100644 --- a/test/fixtures/harmony/uncategorised/15/expected.json +++ b/test/fixtures/harmony/uncategorised/15/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 0, - "raw": "0B0", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 3 } + }, + "range": [ + 0, + 3 + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "value": 0, + "rawValue": 0, + "raw": "0B0" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/150/expected.json b/test/fixtures/harmony/uncategorised/150/expected.json index 1f0ec6b167..03d42666e3 100644 --- a/test/fixtures/harmony/uncategorised/150/expected.json +++ b/test/fixtures/harmony/uncategorised/150/expected.json @@ -1,5 +1,7 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -10,110 +12,176 @@ "column": 18 } }, - "body": [ - { - "type": "ClassDeclaration", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "id": { - "type": "Identifier", + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "name": "A" - }, - "superClass": null, - "body": { - "type": "ClassBody", - "loc": { - "start": { - "line": 1, - "column": 8 + "column": 0 }, "end": { "line": 1, "column": 18 } }, - "body": [ - { - "type": "MethodDefinition", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } + "range": [ + 0, + 18 + ], + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 }, - "static": false, - "computed": true, - "key": { - "type": "Identifier", + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 8, + 18 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 9, + "end": 17, "loc": { "start": { "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "name": "x" - }, - "kind": "method", - "value": { - "type": "FunctionExpression", - "loc": { - "start": { - "line": 1, - "column": 12 + "column": 9 }, "end": { "line": 1, "column": 17 } }, - "id": null, - "params": [], - "generator": false, - "body": { - "type": "BlockStatement", + "range": [ + 9, + 17 + ], + "computed": true, + "key": { + "type": "Identifier", + "start": 10, + "end": 11, "loc": { "start": { "line": 1, - "column": 15 + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "x" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 }, "end": { "line": 1, "column": 17 } }, - "body": [] - }, - "expression": false + "range": [ + 12, + 17 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 15, + 17 + ], + "body": [] + } + } } - } - ] + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/152/expected.json b/test/fixtures/harmony/uncategorised/152/expected.json index 50862a105a..f8a12208f0 100644 --- a/test/fixtures/harmony/uncategorised/152/expected.json +++ b/test/fixtures/harmony/uncategorised/152/expected.json @@ -1,124 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [ - { - "type": "Literal", - "value": 1, - "raw": "1", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], + "type": "File", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, @@ -128,5 +11,198 @@ "line": 1, "column": 24 } + }, + "range": [ + 0, + 24 + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "f" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 11, + 20 + ], + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 11, + 14 + ], + "elements": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "x" + } + ] + }, + "right": { + "type": "ArrayExpression", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 17, + 20 + ], + "elements": [ + { + "type": "Literal", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "value": 1, + "rawValue": 1, + "raw": "1" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 22, + 24 + ], + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/153/expected.json b/test/fixtures/harmony/uncategorised/153/expected.json index d34e4704a9..e39c2aac40 100644 --- a/test/fixtures/harmony/uncategorised/153/expected.json +++ b/test/fixtures/harmony/uncategorised/153/expected.json @@ -1,186 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "value": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "value": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], + "type": "File", + "start": 0, + "end": 28, "loc": { "start": { "line": 1, @@ -190,5 +11,284 @@ "line": 1, "column": 28 } + }, + "range": [ + 0, + 28 + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "f" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 11, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 11, + 24 + ], + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 11, + 14 + ], + "properties": [ + { + "type": "Property", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "x" + } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 17, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 17, + 24 + ], + "properties": [ + { + "type": "Property", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 18, + 23 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "x" + }, + "value": { + "type": "Literal", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 21, + 23 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + }, + "kind": "init" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 26, + 28 + ], + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/154/expected.json b/test/fixtures/harmony/uncategorised/154/expected.json index 0f4301cf8e..6df53df98a 100644 --- a/test/fixtures/harmony/uncategorised/154/expected.json +++ b/test/fixtures/harmony/uncategorised/154/expected.json @@ -1,214 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "value": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "value": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - } - } - ], + "type": "File", + "start": 0, + "end": 30, "loc": { "start": { "line": 1, @@ -218,5 +11,324 @@ "line": 1, "column": 30 } + }, + "range": [ + 0, + 30 + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "f" + }, + "right": { + "type": "FunctionExpression", + "start": 4, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 4, + 30 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 13, + 26 + ], + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 13, + 16 + ], + "properties": [ + { + "type": "Property", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "x" + } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 19, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 19, + 26 + ], + "properties": [ + { + "type": "Property", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 20, + 25 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 20, + 21 + ], + "name": "x" + }, + "value": { + "type": "Literal", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 23, + 25 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + }, + "kind": "init" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 28, + 30 + ], + "body": [] + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/155/expected.json b/test/fixtures/harmony/uncategorised/155/expected.json index 0e2a4f76f7..13ab0734ac 100644 --- a/test/fixtures/harmony/uncategorised/155/expected.json +++ b/test/fixtures/harmony/uncategorised/155/expected.json @@ -1,232 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "value": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "value": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], + "type": "File", + "start": 0, + "end": 33, "loc": { "start": { "line": 1, @@ -236,5 +11,349 @@ "line": 1, "column": 33 } + }, + "range": [ + 0, + 33 + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 1, + 32 + ], + "properties": [ + { + "type": "Property", + "start": 2, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 2, + 31 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 2, + 3 + ], + "name": "f" + }, + "value": { + "type": "FunctionExpression", + "start": 5, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 5, + 31 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 14, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 14, + 27 + ], + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 14, + 17 + ], + "properties": [ + { + "type": "Property", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "x" + } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 20, + 27 + ], + "properties": [ + { + "type": "Property", + "start": 21, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 21, + 26 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "name": "x" + }, + "value": { + "type": "Literal", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 24, + 26 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + }, + "kind": "init" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 29, + 31 + ], + "body": [] + } + }, + "kind": "init" + } + ], + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/156/expected.json b/test/fixtures/harmony/uncategorised/156/expected.json index dd4e716ced..6b26760b30 100644 --- a/test/fixtures/harmony/uncategorised/156/expected.json +++ b/test/fixtures/harmony/uncategorised/156/expected.json @@ -1,232 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "value": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "value": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], + "type": "File", + "start": 0, + "end": 23, "loc": { "start": { "line": 1, @@ -236,5 +11,349 @@ "line": 1, "column": 23 } + }, + "range": [ + 0, + 23 + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 1, + 22 + ], + "properties": [ + { + "type": "Property", + "start": 2, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 2, + 21 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 2, + 3 + ], + "name": "f" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 3, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 3, + 21 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 4, + 17 + ], + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "properties": [ + { + "type": "Property", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "x" + } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 10, + 17 + ], + "properties": [ + { + "type": "Property", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 11, + 16 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "x" + }, + "value": { + "type": "Literal", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 14, + 16 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + }, + "kind": "init" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 19, + 21 + ], + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/157/expected.json b/test/fixtures/harmony/uncategorised/157/expected.json index b36d877c00..bd1dc26f73 100644 --- a/test/fixtures/harmony/uncategorised/157/expected.json +++ b/test/fixtures/harmony/uncategorised/157/expected.json @@ -1,245 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ClassExpression", - "superClass": null, - "body": { - "type": "ClassBody", - "body": [ - { - "type": "MethodDefinition", - "computed": false, - "key": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "value": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "value": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "kind": "method", - "static": false, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], + "type": "File", + "start": 0, + "end": 29, "loc": { "start": { "line": 1, @@ -249,5 +11,369 @@ "line": 1, "column": 29 } + }, + "range": [ + 0, + 29 + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "expression": { + "type": "ClassExpression", + "start": 1, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 1, + 28 + ], + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 7, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 7, + 28 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 8, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 8, + 27 + ], + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "f" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 9, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 9, + 27 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 10, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 10, + 23 + ], + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 10, + 13 + ], + "properties": [ + { + "type": "Property", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "x" + } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 16, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 16, + 23 + ], + "properties": [ + { + "type": "Property", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 17, + 22 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "name": "x" + }, + "value": { + "type": "Literal", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 20, + 22 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + }, + "kind": "init" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 25, + 27 + ], + "body": [] + } + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/158/expected.json b/test/fixtures/harmony/uncategorised/158/expected.json index 376648eb3c..a124117bff 100644 --- a/test/fixtures/harmony/uncategorised/158/expected.json +++ b/test/fixtures/harmony/uncategorised/158/expected.json @@ -1,186 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "value": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "value": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], + "type": "File", + "start": 0, + "end": 23, "loc": { "start": { "line": 1, @@ -190,5 +11,284 @@ "line": 1, "column": 23 } + }, + "range": [ + 0, + 23 + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 1, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 1, + 22 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 2, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 2, + 15 + ], + "left": { + "type": "ObjectPattern", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 2, + 5 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "x" + } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 8, + 15 + ], + "properties": [ + { + "type": "Property", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 9, + 14 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "x" + }, + "value": { + "type": "Literal", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 12, + 14 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + }, + "kind": "init" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 20, + 22 + ], + "body": [] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/159/expected.json b/test/fixtures/harmony/uncategorised/159/expected.json index d2d1a7093f..8e260d0421 100644 --- a/test/fixtures/harmony/uncategorised/159/expected.json +++ b/test/fixtures/harmony/uncategorised/159/expected.json @@ -1,122 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "right": { - "type": "Literal", - "value": 1, - "raw": "1", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -126,5 +11,196 @@ "line": 1, "column": 22 } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "x" + }, + "right": { + "type": "FunctionExpression", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 4, + 22 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 13, + 18 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "y" + }, + "right": { + "type": "Literal", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 20, + 22 + ], + "body": [] + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/16/expected.json b/test/fixtures/harmony/uncategorised/16/expected.json index 780092163c..719347ca54 100644 --- a/test/fixtures/harmony/uncategorised/16/expected.json +++ b/test/fixtures/harmony/uncategorised/16/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 1, - "raw": "0B1", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 3 } + }, + "range": [ + 0, + 3 + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "value": 1, + "rawValue": 1, + "raw": "0B1" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/160/expected.json b/test/fixtures/harmony/uncategorised/160/expected.json index 82429d8b3b..a4414c951e 100644 --- a/test/fixtures/harmony/uncategorised/160/expected.json +++ b/test/fixtures/harmony/uncategorised/160/expected.json @@ -1,94 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "right": { - "type": "Literal", - "value": 1, - "raw": "1", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], + "type": "File", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, @@ -98,5 +11,156 @@ "line": 1, "column": 20 } + }, + "range": [ + 0, + 20 + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "f" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 11, + 16 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "a" + }, + "right": { + "type": "Literal", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 18, + 20 + ], + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/161/expected.json b/test/fixtures/harmony/uncategorised/161/expected.json index 333f6e9f45..d288d68e93 100644 --- a/test/fixtures/harmony/uncategorised/161/expected.json +++ b/test/fixtures/harmony/uncategorised/161/expected.json @@ -1,168 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "right": { - "type": "Literal", - "value": 1, - "raw": "1", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], + "type": "File", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -172,5 +11,260 @@ "line": 1, "column": 27 } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 4, + 27 + ], + "properties": [ + { + "type": "Property", + "start": 6, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 6, + 25 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "f" + }, + "value": { + "type": "FunctionExpression", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 9, + 25 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 18, + 21 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "a" + }, + "right": { + "type": "Literal", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 20, + 21 + ], + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 23, + 25 + ], + "body": [] + } + }, + "kind": "init" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/162/expected.json b/test/fixtures/harmony/uncategorised/162/expected.json index 2ae94bff50..c877b1aeba 100644 --- a/test/fixtures/harmony/uncategorised/162/expected.json +++ b/test/fixtures/harmony/uncategorised/162/expected.json @@ -1,168 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "right": { - "type": "Literal", - "value": 1, - "raw": "1", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -172,5 +11,260 @@ "line": 1, "column": 17 } + }, + "range": [ + 0, + 17 + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 4, + 17 + ], + "properties": [ + { + "type": "Property", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 6, + 15 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "f" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 7, + 15 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 8, + 11 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "a" + }, + "right": { + "type": "Literal", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 13, + 15 + ], + "body": [] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/163/expected.json b/test/fixtures/harmony/uncategorised/163/expected.json index e2ee598290..3fd0ffe939 100644 --- a/test/fixtures/harmony/uncategorised/163/expected.json +++ b/test/fixtures/harmony/uncategorised/163/expected.json @@ -1,83 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -87,5 +11,153 @@ "line": 1, "column": 22 } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "f" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "a" + }, + { + "type": "RestElement", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 14, + 18 + ], + "argument": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "name": "b" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 20, + 22 + ], + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/164/expected.json b/test/fixtures/harmony/uncategorised/164/expected.json index a3f84e809e..53bc251508 100644 --- a/test/fixtures/harmony/uncategorised/164/expected.json +++ b/test/fixtures/harmony/uncategorised/164/expected.json @@ -1,95 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "params": [ - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -99,5 +11,155 @@ "line": 1, "column": 22 } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "x" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "ArrayPattern", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 11, + 19 + ], + "elements": [ + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "b" + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 20, + 22 + ], + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/165/expected.json b/test/fixtures/harmony/uncategorised/165/expected.json index 1b8177fe3d..0a717add26 100644 --- a/test/fixtures/harmony/uncategorised/165/expected.json +++ b/test/fixtures/harmony/uncategorised/165/expected.json @@ -1,157 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "params": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "value": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -161,5 +11,241 @@ "line": 1, "column": 22 } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "x" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 11, + 19 + ], + "properties": [ + { + "type": "Property", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "a" + } + }, + { + "type": "Property", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "b" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "b" + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 20, + 22 + ], + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/166/expected.json b/test/fixtures/harmony/uncategorised/166/expected.json index 65b9dbf04d..6ba4d3b304 100644 --- a/test/fixtures/harmony/uncategorised/166/expected.json +++ b/test/fixtures/harmony/uncategorised/166/expected.json @@ -1,126 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -130,5 +11,198 @@ "line": 1, "column": 22 } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "x" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "a" + }, + { + "type": "ObjectPattern", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 14, + 19 + ], + "properties": [ + { + "type": "Property", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "a" + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 20, + 22 + ], + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/167/expected.json b/test/fixtures/harmony/uncategorised/167/expected.json index 3dee998ff3..323d98eb0b 100644 --- a/test/fixtures/harmony/uncategorised/167/expected.json +++ b/test/fixtures/harmony/uncategorised/167/expected.json @@ -1,98 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], + "type": "File", + "start": 0, + "end": 25, "loc": { "start": { "line": 1, @@ -102,5 +11,174 @@ "line": 1, "column": 25 } + }, + "range": [ + 0, + 25 + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "x" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "RestElement", + "start": 11, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 11, + 22 + ], + "argument": { + "type": "ArrayPattern", + "start": 14, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 14, + 22 + ], + "elements": [ + { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ], + "name": "b" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 23, + 25 + ], + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/168/expected.json b/test/fixtures/harmony/uncategorised/168/expected.json index 1bad33c03a..10fcca3c4d 100644 --- a/test/fixtures/harmony/uncategorised/168/expected.json +++ b/test/fixtures/harmony/uncategorised/168/expected.json @@ -1,337 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "params": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "value": { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "value": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "value": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 47 - } - } - }, - { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 50 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 51 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 54 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - } - } - ], + "type": "File", + "start": 0, + "end": 54, "loc": { "start": { "line": 1, @@ -341,5 +11,509 @@ "line": 1, "column": 54 } + }, + "range": [ + 0, + 54 + ], + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 0, + 54 + ], + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 0, + 54 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "x" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 11, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 11, + 37 + ], + "properties": [ + { + "type": "Property", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 13, + 24 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "a" + }, + "value": { + "type": "ObjectPattern", + "start": 16, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 16, + 24 + ], + "properties": [ + { + "type": "Property", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "w" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "w" + } + }, + { + "type": "Property", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "name": "x" + } + } + ] + }, + "kind": "init" + }, + { + "type": "Property", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 26, + 35 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 26, + 27 + ], + "name": "b" + }, + "value": { + "type": "ArrayPattern", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 29, + 35 + ], + "elements": [ + { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 30, + 31 + ], + "name": "y" + }, + { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 33, + 34 + ], + "name": "z" + } + ] + }, + "kind": "init" + } + ] + }, + { + "type": "RestElement", + "start": 39, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 39, + 51 + ], + "argument": { + "type": "ArrayPattern", + "start": 42, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 42, + 51 + ], + "elements": [ + { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "range": [ + 43, + 44 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 46, + 47 + ], + "name": "b" + }, + { + "type": "Identifier", + "start": 49, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 49, + 50 + ], + "name": "c" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 52, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 52, + 54 + ], + "body": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/169/expected.json b/test/fixtures/harmony/uncategorised/169/expected.json index 394ac48f1c..c9508e73fd 100644 --- a/test/fixtures/harmony/uncategorised/169/expected.json +++ b/test/fixtures/harmony/uncategorised/169/expected.json @@ -1,108 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "params": [ - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], + "type": "File", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, @@ -112,5 +11,175 @@ "line": 1, "column": 24 } + }, + "range": [ + 0, + 24 + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 1, + 23 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "x" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "ArrayPattern", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 12, + 20 + ], + "elements": [ + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "name": "b" + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 21, + 23 + ], + "body": [] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/17/expected.json b/test/fixtures/harmony/uncategorised/17/expected.json index 288feea002..42faeec56c 100644 --- a/test/fixtures/harmony/uncategorised/17/expected.json +++ b/test/fixtures/harmony/uncategorised/17/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 2, - "raw": "0B10", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], + "type": "File", + "start": 0, + "end": 4, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 4 } + }, + "range": [ + 0, + 4 + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "value": 2, + "rawValue": 2, + "raw": "0B10" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/170/expected.json b/test/fixtures/harmony/uncategorised/170/expected.json index 992699e6a6..2ea57a34bf 100644 --- a/test/fixtures/harmony/uncategorised/170/expected.json +++ b/test/fixtures/harmony/uncategorised/170/expected.json @@ -1,170 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "params": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "value": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], + "type": "File", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, @@ -174,5 +11,261 @@ "line": 1, "column": 24 } + }, + "range": [ + 0, + 24 + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 1, + 23 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "x" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 12, + 20 + ], + "properties": [ + { + "type": "Property", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "a" + } + }, + { + "type": "Property", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "name": "b" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "name": "b" + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 21, + 23 + ], + "body": [] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/171/expected.json b/test/fixtures/harmony/uncategorised/171/expected.json index bf8a6e30cc..c26272226a 100644 --- a/test/fixtures/harmony/uncategorised/171/expected.json +++ b/test/fixtures/harmony/uncategorised/171/expected.json @@ -1,111 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], + "type": "File", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -115,5 +11,194 @@ "line": 1, "column": 27 } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 1, + 26 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "x" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "RestElement", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 12, + 23 + ], + "argument": { + "type": "ArrayPattern", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 15, + 23 + ], + "elements": [ + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 20, + 21 + ], + "name": "b" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 24, + 26 + ], + "body": [] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/172/expected.json b/test/fixtures/harmony/uncategorised/172/expected.json index 2969f1535f..23d09d58f1 100644 --- a/test/fixtures/harmony/uncategorised/172/expected.json +++ b/test/fixtures/harmony/uncategorised/172/expected.json @@ -1,350 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "params": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "value": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "value": { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "value": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "value": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 45 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 48 - } - } - }, - { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 51 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 52 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 55 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - } - } - ], + "type": "File", + "start": 0, + "end": 56, "loc": { "start": { "line": 1, @@ -354,5 +11,529 @@ "line": 1, "column": 56 } + }, + "range": [ + 0, + 56 + ], + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "range": [ + 0, + 56 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "range": [ + 0, + 56 + ], + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "range": [ + 1, + 55 + ], + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "x" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 12, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 12, + 38 + ], + "properties": [ + { + "type": "Property", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 14, + 25 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "a" + }, + "value": { + "type": "ObjectPattern", + "start": 17, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 17, + 25 + ], + "properties": [ + { + "type": "Property", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ], + "name": "w" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ], + "name": "w" + } + }, + { + "type": "Property", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ], + "name": "x" + } + } + ] + }, + "kind": "init" + }, + { + "type": "Property", + "start": 27, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 27, + 36 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 27, + 28 + ], + "name": "b" + }, + "value": { + "type": "ArrayPattern", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 30, + 36 + ], + "elements": [ + { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 31, + 32 + ], + "name": "y" + }, + { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 34, + 35 + ], + "name": "z" + } + ] + }, + "kind": "init" + } + ] + }, + { + "type": "RestElement", + "start": 40, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 40, + 52 + ], + "argument": { + "type": "ArrayPattern", + "start": 43, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 43, + 52 + ], + "elements": [ + { + "type": "Identifier", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 44, + 45 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 47, + 48 + ], + "name": "b" + }, + { + "type": "Identifier", + "start": 50, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 50, + 51 + ], + "name": "c" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 53, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "range": [ + 53, + 55 + ], + "body": [] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/173/expected.json b/test/fixtures/harmony/uncategorised/173/expected.json index 1173634268..29394edaf8 100644 --- a/test/fixtures/harmony/uncategorised/173/expected.json +++ b/test/fixtures/harmony/uncategorised/173/expected.json @@ -1,141 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], + "type": "File", + "start": 0, + "end": 19, "loc": { "start": { "line": 1, @@ -145,5 +11,220 @@ "line": 1, "column": 19 } + }, + "range": [ + 0, + 19 + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 1, + 18 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 3, + 16 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 4, + 16 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "ArrayPattern", + "start": 5, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 5, + 13 + ], + "elements": [ + { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "b" + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 14, + 16 + ], + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/174/expected.json b/test/fixtures/harmony/uncategorised/174/expected.json index f0b63b8cd0..e8a1a93b05 100644 --- a/test/fixtures/harmony/uncategorised/174/expected.json +++ b/test/fixtures/harmony/uncategorised/174/expected.json @@ -1,144 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -148,5 +11,239 @@ "line": 1, "column": 22 } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 1, + 21 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 3, + 19 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 4, + 19 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "RestElement", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 5, + 16 + ], + "argument": { + "type": "ArrayPattern", + "start": 8, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 8, + 16 + ], + "elements": [ + { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "b" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 17, + 19 + ], + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/175/expected.json b/test/fixtures/harmony/uncategorised/175/expected.json index 28c75923ce..d2db03b9b8 100644 --- a/test/fixtures/harmony/uncategorised/175/expected.json +++ b/test/fixtures/harmony/uncategorised/175/expected.json @@ -1,383 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "value": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "value": { - "type": "Identifier", - "name": "w", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "value": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "value": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 45 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 48 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 48 - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 48 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - } - } - ], + "type": "File", + "start": 0, + "end": 51, "loc": { "start": { "line": 1, @@ -387,5 +11,574 @@ "line": 1, "column": 51 } + }, + "range": [ + 0, + 51 + ], + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 0, + 51 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 0, + 51 + ], + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 1, + 50 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 3, + 48 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 4, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 4, + 48 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 5, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 5, + 31 + ], + "properties": [ + { + "type": "Property", + "start": 7, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 7, + 18 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "a" + }, + "value": { + "type": "ObjectPattern", + "start": 10, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 10, + 18 + ], + "properties": [ + { + "type": "Property", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "w" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "w" + } + }, + { + "type": "Property", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "x" + } + } + ] + }, + "kind": "init" + }, + { + "type": "Property", + "start": 20, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 20, + 29 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 20, + 21 + ], + "name": "b" + }, + "value": { + "type": "ArrayPattern", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 23, + 29 + ], + "elements": [ + { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 24, + 25 + ], + "name": "y" + }, + { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 27, + 28 + ], + "name": "z" + } + ] + }, + "kind": "init" + } + ] + }, + { + "type": "RestElement", + "start": 33, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 33, + 45 + ], + "argument": { + "type": "ArrayPattern", + "start": 36, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 36, + 45 + ], + "elements": [ + { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 37, + 38 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 40, + 41 + ], + "name": "b" + }, + { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "range": [ + 43, + 44 + ], + "name": "c" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 46, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 46, + 48 + ], + "body": [] + } + } + } + ], + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/176/expected.json b/test/fixtures/harmony/uncategorised/176/expected.json index 50d0ac8bc2..8a61a6642f 100644 --- a/test/fixtures/harmony/uncategorised/176/expected.json +++ b/test/fixtures/harmony/uncategorised/176/expected.json @@ -1,69 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -73,5 +11,133 @@ "line": 1, "column": 12 } + }, + "range": [ + 0, + 12 + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "RestElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 1, + 5 + ], + "argument": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 4, + 5 + ], + "name": "a" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 10, + 12 + ], + "body": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/177/expected.json b/test/fixtures/harmony/uncategorised/177/expected.json index 53d6908a2e..06f09cd326 100644 --- a/test/fixtures/harmony/uncategorised/177/expected.json +++ b/test/fixtures/harmony/uncategorised/177/expected.json @@ -1,83 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], + "type": "File", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, @@ -87,5 +11,153 @@ "line": 1, "column": 15 } + }, + "range": [ + 0, + 15 + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + { + "type": "RestElement", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 4, + 8 + ], + "argument": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "b" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 13, + 15 + ], + "body": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/178/expected.json b/test/fixtures/harmony/uncategorised/178/expected.json index 11e1ae3223..b26df64c81 100644 --- a/test/fixtures/harmony/uncategorised/178/expected.json +++ b/test/fixtures/harmony/uncategorised/178/expected.json @@ -1,112 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -116,5 +11,178 @@ "line": 1, "column": 13 } + }, + "range": [ + 0, + 13 + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 1, + 6 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "a" + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 11, + 13 + ], + "body": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/179/expected.json b/test/fixtures/harmony/uncategorised/179/expected.json index 8c8345abbf..c3ee26fa13 100644 --- a/test/fixtures/harmony/uncategorised/179/expected.json +++ b/test/fixtures/harmony/uncategorised/179/expected.json @@ -1,129 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], + "type": "File", + "start": 0, + "end": 19, "loc": { "start": { "line": 1, @@ -133,5 +11,217 @@ "line": 1, "column": 19 } + }, + "range": [ + 0, + 19 + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 1, + 6 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "a" + } + } + ] + }, + { + "type": "RestElement", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 8, + 12 + ], + "argument": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "b" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 17, + 19 + ], + "body": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/18/expected.json b/test/fixtures/harmony/uncategorised/18/expected.json index d73156adcc..dad656897d 100644 --- a/test/fixtures/harmony/uncategorised/18/expected.json +++ b/test/fixtures/harmony/uncategorised/18/expected.json @@ -1,54 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "TemplateLiteral", - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "42", - "cooked": "42" - }, - "tail": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], - "expressions": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], + "type": "File", + "start": 0, + "end": 4, "loc": { "start": { "line": 1, @@ -58,5 +11,96 @@ "line": 1, "column": 4 } + }, + "range": [ + 0, + 4 + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 1, + 3 + ], + "value": { + "raw": "42", + "cooked": "42" + }, + "tail": true + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/180/expected.json b/test/fixtures/harmony/uncategorised/180/expected.json index 5dc8d4a513..af35ee8e1c 100644 --- a/test/fixtures/harmony/uncategorised/180/expected.json +++ b/test/fixtures/harmony/uncategorised/180/expected.json @@ -1,98 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -102,5 +11,174 @@ "line": 1, "column": 17 } + }, + "range": [ + 0, + 17 + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "RestElement", + "start": 1, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 1, + 10 + ], + "argument": { + "type": "ArrayPattern", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 4, + 10 + ], + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "b" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 15, + 17 + ], + "body": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/181/expected.json b/test/fixtures/harmony/uncategorised/181/expected.json index b6431967a0..76d5224485 100644 --- a/test/fixtures/harmony/uncategorised/181/expected.json +++ b/test/fixtures/harmony/uncategorised/181/expected.json @@ -1,98 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -102,5 +11,174 @@ "line": 1, "column": 17 } + }, + "range": [ + 0, + 17 + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + { + "type": "RestElement", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 4, + 10 + ], + "argument": { + "type": "ArrayPattern", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 7, + 10 + ], + "elements": [ + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "b" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 15, + 17 + ], + "body": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/182/expected.json b/test/fixtures/harmony/uncategorised/182/expected.json index ae7bcb53c5..ca9ea9cae7 100644 --- a/test/fixtures/harmony/uncategorised/182/expected.json +++ b/test/fixtures/harmony/uncategorised/182/expected.json @@ -1,158 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "value": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], + "type": "File", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -162,5 +11,258 @@ "line": 1, "column": 27 } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 1, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 1, + 14 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 3, + 12 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "a" + }, + "value": { + "type": "ArrayPattern", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 6, + 12 + ], + "elements": [ + { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "b" + } + ] + }, + "kind": "init" + } + ] + }, + { + "type": "RestElement", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 16, + 20 + ], + "argument": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ], + "name": "c" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 25, + 27 + ], + "body": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/183/expected.json b/test/fixtures/harmony/uncategorised/183/expected.json index fb43142df7..90a3ee7e2e 100644 --- a/test/fixtures/harmony/uncategorised/183/expected.json +++ b/test/fixtures/harmony/uncategorised/183/expected.json @@ -1,217 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "value": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "value": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], + "type": "File", + "start": 0, + "end": 33, "loc": { "start": { "line": 1, @@ -221,5 +11,341 @@ "line": 1, "column": 33 } + }, + "range": [ + 0, + 33 + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "ObjectPattern", + "start": 1, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 1, + 12 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 3, + 7 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "b" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "c" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "c" + } + } + ] + }, + { + "type": "ArrayPattern", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 14, + 20 + ], + "elements": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "d" + }, + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "e" + } + ] + }, + { + "type": "RestElement", + "start": 22, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 22, + 26 + ], + "argument": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 25, + 26 + ], + "name": "f" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 31, + 33 + ], + "body": [] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/184/expected.json b/test/fixtures/harmony/uncategorised/184/expected.json index 0575ba4141..198fca158e 100644 --- a/test/fixtures/harmony/uncategorised/184/expected.json +++ b/test/fixtures/harmony/uncategorised/184/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "ArrayPattern", - "elements": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "right": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], + "type": "File", + "start": 0, + "end": 10, "loc": { "start": { "line": 1, @@ -94,5 +11,150 @@ "line": 1, "column": 10 } + }, + "range": [ + 0, + 10 + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 0, + 10 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 0, + 10 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 0, + 10 + ], + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 0, + 6 + ], + "elements": [ + { + "type": "RestElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 1, + 5 + ], + "argument": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 4, + 5 + ], + "name": "a" + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "b" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/185/expected.json b/test/fixtures/harmony/uncategorised/185/expected.json index 5febf90ec5..f6412fc895 100644 --- a/test/fixtures/harmony/uncategorised/185/expected.json +++ b/test/fixtures/harmony/uncategorised/185/expected.json @@ -1,104 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "right": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -108,5 +11,170 @@ "line": 1, "column": 13 } + }, + "range": [ + 0, + 13 + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 0, + 9 + ], + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + { + "type": "RestElement", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 4, + 8 + ], + "argument": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "b" + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "c" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/186/expected.json b/test/fixtures/harmony/uncategorised/186/expected.json index 1f598e07ae..b36b3196f1 100644 --- a/test/fixtures/harmony/uncategorised/186/expected.json +++ b/test/fixtures/harmony/uncategorised/186/expected.json @@ -1,195 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "ArrayPattern", - "elements": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "value": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "right": { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], + "type": "File", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, @@ -199,5 +11,297 @@ "line": 1, "column": 20 } + }, + "range": [ + 0, + 20 + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "elements": [ + { + "type": "ObjectPattern", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 1, + 9 + ], + "properties": [ + { + "type": "Property", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "a" + } + }, + { + "type": "Property", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "b" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "b" + } + } + ] + }, + { + "type": "RestElement", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 11, + 15 + ], + "argument": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ], + "name": "c" + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ], + "name": "d" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/187/expected.json b/test/fixtures/harmony/uncategorised/187/expected.json index 7b019dac9d..8c04c0580b 100644 --- a/test/fixtures/harmony/uncategorised/187/expected.json +++ b/test/fixtures/harmony/uncategorised/187/expected.json @@ -1,133 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "right": { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -137,5 +11,211 @@ "line": 1, "column": 18 } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + { + "type": "RestElement", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 4, + 13 + ], + "argument": { + "type": "ArrayPattern", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 7, + 13 + ], + "elements": [ + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "b" + }, + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "c" + } + ] + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "name": "d" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/188/expected.json b/test/fixtures/harmony/uncategorised/188/expected.json index f43330b085..7937fc363a 100644 --- a/test/fixtures/harmony/uncategorised/188/expected.json +++ b/test/fixtures/harmony/uncategorised/188/expected.json @@ -1,92 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ArrayPattern", - "elements": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "init": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -96,5 +11,152 @@ "line": 1, "column": 14 } + }, + "range": [ + 0, + 14 + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 4, + 14 + ], + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 4, + 10 + ], + "elements": [ + { + "type": "RestElement", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 5, + 9 + ], + "argument": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "a" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "b" + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/189/expected.json b/test/fixtures/harmony/uncategorised/189/expected.json index fa7619a769..b481e4cff1 100644 --- a/test/fixtures/harmony/uncategorised/189/expected.json +++ b/test/fixtures/harmony/uncategorised/189/expected.json @@ -1,106 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "init": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -110,5 +11,172 @@ "line": 1, "column": 17 } + }, + "range": [ + 0, + 17 + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 4, + 17 + ], + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 4, + 13 + ], + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "a" + }, + { + "type": "RestElement", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 8, + 12 + ], + "argument": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "b" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 16, + 17 + ], + "name": "c" + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/19/expected.json b/test/fixtures/harmony/uncategorised/19/expected.json index 827cd49288..14751283d1 100644 --- a/test/fixtures/harmony/uncategorised/19/expected.json +++ b/test/fixtures/harmony/uncategorised/19/expected.json @@ -1,81 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "TaggedTemplateExpression", - "tag": { - "type": "Identifier", - "name": "raw", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "quasi": { - "type": "TemplateLiteral", - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "42", - "cooked": "42" - }, - "tail": true, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], - "expressions": [], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - } - ], + "type": "File", + "start": 0, + "end": 7, "loc": { "start": { "line": 1, @@ -85,5 +11,135 @@ "line": 1, "column": 7 } + }, + "range": [ + 0, + 7 + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 0, + 7 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 0, + 7 + ], + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 0, + 7 + ], + "tag": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "name": "raw" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 3, + 7 + ], + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 4, + 6 + ], + "value": { + "raw": "42", + "cooked": "42" + }, + "tail": true + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/190/expected.json b/test/fixtures/harmony/uncategorised/190/expected.json index 76220391c2..5478853cf6 100644 --- a/test/fixtures/harmony/uncategorised/190/expected.json +++ b/test/fixtures/harmony/uncategorised/190/expected.json @@ -1,197 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ArrayPattern", - "elements": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "value": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "init": { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], + "type": "File", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, @@ -201,5 +11,299 @@ "line": 1, "column": 24 } + }, + "range": [ + 0, + 24 + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 4, + 24 + ], + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 4, + 20 + ], + "elements": [ + { + "type": "ObjectPattern", + "start": 5, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 5, + 13 + ], + "properties": [ + { + "type": "Property", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "a" + } + }, + { + "type": "Property", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "b" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "b" + } + } + ] + }, + { + "type": "RestElement", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 15, + 19 + ], + "argument": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "c" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 23, + 24 + ], + "name": "d" + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/191/expected.json b/test/fixtures/harmony/uncategorised/191/expected.json index 2d72df8d1f..973cb8a87d 100644 --- a/test/fixtures/harmony/uncategorised/191/expected.json +++ b/test/fixtures/harmony/uncategorised/191/expected.json @@ -1,135 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "init": { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -139,5 +11,213 @@ "line": 1, "column": 22 } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 4, + 22 + ], + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 4, + 18 + ], + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "a" + }, + { + "type": "RestElement", + "start": 8, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 8, + 17 + ], + "argument": { + "type": "ArrayPattern", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 11, + 17 + ], + "elements": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "b" + }, + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "name": "c" + } + ] + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "name": "d" + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/192/expected.json b/test/fixtures/harmony/uncategorised/192/expected.json index a4ca6ec701..ae629b000d 100644 --- a/test/fixtures/harmony/uncategorised/192/expected.json +++ b/test/fixtures/harmony/uncategorised/192/expected.json @@ -1,76 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "func", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "arguments": [ - { - "type": "SpreadElement", - "argument": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], + "type": "File", + "start": 0, + "end": 10, "loc": { "start": { "line": 1, @@ -80,5 +11,130 @@ "line": 1, "column": 10 } + }, + "range": [ + 0, + 10 + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 0, + 10 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 0, + 10 + ], + "expression": { + "type": "CallExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 0, + 10 + ], + "callee": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "name": "func" + }, + "arguments": [ + { + "type": "SpreadElement", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 5, + 9 + ], + "argument": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "a" + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/193/expected.json b/test/fixtures/harmony/uncategorised/193/expected.json index 36727fa603..1a2be651a5 100644 --- a/test/fixtures/harmony/uncategorised/193/expected.json +++ b/test/fixtures/harmony/uncategorised/193/expected.json @@ -1,90 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "func", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - { - "type": "SpreadElement", - "argument": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -94,5 +11,150 @@ "line": 1, "column": 13 } + }, + "range": [ + 0, + 13 + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "expression": { + "type": "CallExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "callee": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "name": "func" + }, + "arguments": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "a" + }, + { + "type": "SpreadElement", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 8, + 12 + ], + "argument": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "b" + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/194/expected.json b/test/fixtures/harmony/uncategorised/194/expected.json index 518412b159..4bac7112e5 100644 --- a/test/fixtures/harmony/uncategorised/194/expected.json +++ b/test/fixtures/harmony/uncategorised/194/expected.json @@ -1,5 +1,7 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -10,21 +12,34 @@ "column": 13 } }, - "body": [ - { - "type": "ExpressionStatement", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } + "range": [ + 0, + 13 + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "expression": { - "type": "CallExpression", + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -35,8 +50,14 @@ "column": 13 } }, - "callee": { - "type": "Identifier", + "range": [ + 0, + 13 + ], + "expression": { + "type": "CallExpression", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -44,55 +65,96 @@ }, "end": { "line": 1, - "column": 4 + "column": 13 } }, - "name": "func" - }, - "arguments": [ - { - "type": "SpreadElement", + "range": [ + 0, + 13 + ], + "callee": { + "type": "Identifier", + "start": 0, + "end": 4, "loc": { "start": { "line": 1, - "column": 5 + "column": 0 }, "end": { "line": 1, - "column": 9 + "column": 4 } }, - "argument": { - "type": "Identifier", + "range": [ + 0, + 4 + ], + "name": "func" + }, + "arguments": [ + { + "type": "SpreadElement", + "start": 5, + "end": 9, "loc": { "start": { "line": 1, - "column": 8 + "column": 5 }, "end": { "line": 1, "column": 9 } }, - "name": "a" - } - }, - { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 + "range": [ + 5, + 9 + ], + "argument": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "a" } }, - "name": "b" - } - ] + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "b" + } + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/195/expected.json b/test/fixtures/harmony/uncategorised/195/expected.json index ff15a60dbe..2ca03c6467 100644 --- a/test/fixtures/harmony/uncategorised/195/expected.json +++ b/test/fixtures/harmony/uncategorised/195/expected.json @@ -1,14 +1,37 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "regex": { - "pattern": "[a-z]", - "flags": "u" - }, + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, "loc": { "start": { "line": 1, @@ -18,8 +41,28 @@ "line": 1, "column": 8 } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "raw": "/[a-z]/u", + "regex": { + "pattern": "[a-z]", + "flags": "u" + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/196/expected.json b/test/fixtures/harmony/uncategorised/196/expected.json index ef7051101d..c8b5823f15 100644 --- a/test/fixtures/harmony/uncategorised/196/expected.json +++ b/test/fixtures/harmony/uncategorised/196/expected.json @@ -1,14 +1,37 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "regex": { - "pattern": "[\\uD834\\uDF06-\\uD834\\uDF08a-z]", - "flags": "u" - }, + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 33, "loc": { "start": { "line": 1, @@ -18,8 +41,28 @@ "line": 1, "column": 33 } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "raw": "/[\\uD834\\uDF06-\\uD834\\uDF08a-z]/u", + "regex": { + "pattern": "[\\uD834\\uDF06-\\uD834\\uDF08a-z]", + "flags": "u" + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/197/expected.json b/test/fixtures/harmony/uncategorised/197/expected.json index 7c9d54374b..8b60d84c91 100644 --- a/test/fixtures/harmony/uncategorised/197/expected.json +++ b/test/fixtures/harmony/uncategorised/197/expected.json @@ -1,42 +1,129 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 26, - "body": [ - { - "type": "DoWhileStatement", - "start": 0, - "end": 19, - "body": { - "type": "BlockStatement", - "start": 3, - "end": 5, - "body": [] + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "test": { - "type": "Literal", - "start": 13, - "end": 18, - "value": false, - "raw": "false" + "end": { + "line": 1, + "column": 26 } }, - { - "type": "ExpressionStatement", - "start": 20, - "end": 26, - "expression": { - "type": "CallExpression", - "start": 20, - "end": 25, - "callee": { - "type": "Identifier", - "start": 20, - "end": 23, - "name": "foo" + "sourceType": "script", + "body": [ + { + "type": "DoWhileStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } }, - "arguments": [] + "body": { + "type": "BlockStatement", + "start": 3, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "body": [] + }, + "test": { + "type": "Literal", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": false, + "rawValue": false, + "raw": "false" + } + }, + { + "type": "ExpressionStatement", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "CallExpression", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "callee": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "name": "foo" + }, + "arguments": [] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/2/expected.json b/test/fixtures/harmony/uncategorised/2/expected.json index 54ce1bc6e1..c93c7d0cdf 100644 --- a/test/fixtures/harmony/uncategorised/2/expected.json +++ b/test/fixtures/harmony/uncategorised/2/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "𠮷野家", - "raw": "\"\\u{20BB7}\\u{91CE}\\u{5BB6}\"", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], + "type": "File", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 27 } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "value": "𠮷野家", + "rawValue": "𠮷野家", + "raw": "\"\\u{20BB7}\\u{91CE}\\u{5BB6}\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/20/expected.json b/test/fixtures/harmony/uncategorised/20/expected.json index d54e283526..761c93054b 100644 --- a/test/fixtures/harmony/uncategorised/20/expected.json +++ b/test/fixtures/harmony/uncategorised/20/expected.json @@ -1,114 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "TaggedTemplateExpression", - "tag": { - "type": "Identifier", - "name": "raw", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "quasi": { - "type": "TemplateLiteral", - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "hello ", - "cooked": "hello " - }, - "tail": false, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - { - "type": "TemplateElement", - "value": { - "raw": "", - "cooked": "" - }, - "tail": true, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "expressions": [ - { - "type": "Identifier", - "name": "name", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -118,5 +11,180 @@ "line": 1, "column": 18 } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "tag": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "name": "raw" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 3, + 18 + ], + "expressions": [ + { + "type": "Identifier", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 12, + 16 + ], + "name": "name" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 4, + 10 + ], + "value": { + "raw": "hello ", + "cooked": "hello " + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 17, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 17, + 17 + ], + "value": { + "raw": "", + "cooked": "" + }, + "tail": true + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/21/expected.json b/test/fixtures/harmony/uncategorised/21/expected.json index 35182a3330..795e77823e 100644 --- a/test/fixtures/harmony/uncategorised/21/expected.json +++ b/test/fixtures/harmony/uncategorised/21/expected.json @@ -1,54 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "TemplateLiteral", - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "$", - "cooked": "$" - }, - "tail": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], - "expressions": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -58,5 +11,96 @@ "line": 1, "column": 3 } + }, + "range": [ + 0, + 3 + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "value": { + "raw": "$", + "cooked": "$" + }, + "tail": true + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/22/expected.json b/test/fixtures/harmony/uncategorised/22/expected.json index ef3e991697..d50dc192c8 100644 --- a/test/fixtures/harmony/uncategorised/22/expected.json +++ b/test/fixtures/harmony/uncategorised/22/expected.json @@ -1,54 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "TemplateLiteral", - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "\\n\\r\\b\\v\\t\\f\\\n\\\n", - "cooked": "\n\r\b\u000b\t\f" - }, - "tail": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 3, - "column": 0 - } - } - } - ], - "expressions": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -58,5 +11,96 @@ "line": 3, "column": 1 } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 0, + 18 + ], + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 0, + 18 + ], + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 3, + "column": 0 + } + }, + "range": [ + 1, + 17 + ], + "value": { + "raw": "\\n\\r\\b\\v\\t\\f\\\n\\\n", + "cooked": "\n\r\b\u000b\t\f" + }, + "tail": true + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/23/expected.json b/test/fixtures/harmony/uncategorised/23/expected.json index 7ed7db33cc..6e822df913 100644 --- a/test/fixtures/harmony/uncategorised/23/expected.json +++ b/test/fixtures/harmony/uncategorised/23/expected.json @@ -1,54 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "TemplateLiteral", - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "\n\n\n", - "cooked": "\n\n\n" - }, - "tail": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 4, - "column": 0 - } - } - } - ], - "expressions": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - } - } - ], + "type": "File", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -58,5 +11,96 @@ "line": 4, "column": 1 } + }, + "range": [ + 0, + 5 + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "range": [ + 0, + 5 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "range": [ + 0, + 5 + ], + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "range": [ + 0, + 5 + ], + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 4, + "column": 0 + } + }, + "range": [ + 1, + 4 + ], + "value": { + "raw": "\n\n\n", + "cooked": "\n\n\n" + }, + "tail": true + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/24/expected.json b/test/fixtures/harmony/uncategorised/24/expected.json index 579dc5cc28..0c4c807da5 100644 --- a/test/fixtures/harmony/uncategorised/24/expected.json +++ b/test/fixtures/harmony/uncategorised/24/expected.json @@ -1,54 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "TemplateLiteral", - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "\\u{000042}\\u0042\\x42u0\\A", - "cooked": "BBBu0A" - }, - "tail": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], - "expressions": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], + "type": "File", + "start": 0, + "end": 26, "loc": { "start": { "line": 1, @@ -58,5 +11,96 @@ "line": 1, "column": 26 } + }, + "range": [ + 0, + 26 + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 1, + 25 + ], + "value": { + "raw": "\\u{000042}\\u0042\\x42u0\\A", + "cooked": "BBBu0A" + }, + "tail": true + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/25/expected.json b/test/fixtures/harmony/uncategorised/25/expected.json index 4c2958d477..fbbe390fbc 100644 --- a/test/fixtures/harmony/uncategorised/25/expected.json +++ b/test/fixtures/harmony/uncategorised/25/expected.json @@ -1,95 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "NewExpression", - "callee": { - "type": "TaggedTemplateExpression", - "tag": { - "type": "Identifier", - "name": "raw", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "quasi": { - "type": "TemplateLiteral", - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "42", - "cooked": "42" - }, - "tail": true, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], - "expressions": [], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -99,5 +11,155 @@ "line": 1, "column": 11 } + }, + "range": [ + 0, + 11 + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "expression": { + "type": "NewExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "callee": { + "type": "TaggedTemplateExpression", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 4, + 11 + ], + "tag": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "name": "raw" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 7, + 11 + ], + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 8, + 10 + ], + "value": { + "raw": "42", + "cooked": "42" + }, + "tail": true + } + ] + } + }, + "arguments": [] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/256/expected.json b/test/fixtures/harmony/uncategorised/256/expected.json index 4552845375..3b6d436cd0 100644 --- a/test/fixtures/harmony/uncategorised/256/expected.json +++ b/test/fixtures/harmony/uncategorised/256/expected.json @@ -1,63 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "operator": "*", - "left": { - "type": "Identifier", - "name": "yield", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "right": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -67,5 +11,112 @@ "line": 1, "column": 9 } + }, + "range": [ + 0, + 9 + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 0, + 9 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 0, + 9 + ], + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 0, + 9 + ], + "left": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ], + "name": "yield" + }, + "operator": "*", + "right": { + "type": "Literal", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 7, + 9 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/257/expected.json b/test/fixtures/harmony/uncategorised/257/expected.json index da00dcdf5d..c9ec8d2bbb 100644 --- a/test/fixtures/harmony/uncategorised/257/expected.json +++ b/test/fixtures/harmony/uncategorised/257/expected.json @@ -1,95 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "BinaryExpression", - "operator": "*", - "left": { - "type": "Identifier", - "name": "yield", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "right": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -99,5 +11,156 @@ "line": 1, "column": 14 } + }, + "range": [ + 0, + 14 + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "e" + } + ], + "body": { + "type": "BinaryExpression", + "start": 5, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 5, + 14 + ], + "left": { + "type": "Identifier", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 5, + 10 + ], + "name": "yield" + }, + "operator": "*", + "right": { + "type": "Literal", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 12, + 14 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/259/expected.json b/test/fixtures/harmony/uncategorised/259/expected.json index 7ef6749796..cab055cecf 100644 --- a/test/fixtures/harmony/uncategorised/259/expected.json +++ b/test/fixtures/harmony/uncategorised/259/expected.json @@ -1,108 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "operator": "*", - "left": { - "type": "Identifier", - "name": "yield", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "right": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], + "type": "File", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -112,5 +11,176 @@ "line": 1, "column": 27 } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 1, + 26 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 13, + 26 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 15, + 24 + ], + "expression": { + "type": "BinaryExpression", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 15, + 24 + ], + "left": { + "type": "Identifier", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 15, + 20 + ], + "name": "yield" + }, + "operator": "*", + "right": { + "type": "Literal", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 22, + 24 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + } + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/26/expected.json b/test/fixtures/harmony/uncategorised/26/expected.json index 622096b08d..a3d1a0b6eb 100644 --- a/test/fixtures/harmony/uncategorised/26/expected.json +++ b/test/fixtures/harmony/uncategorised/26/expected.json @@ -1,119 +1,377 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "TemplateLiteral", - "expressions": [ - { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "x" - }, - "value": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "y" - }, - "value": { - "type": "Literal", - "value": 10, - "raw": "10" - }, - "kind": "init" - } - ] - }, - "kind": "init" - } - ] - }, - { - "type": "TemplateLiteral", - "expressions": [ - { - "type": "FunctionExpression", - "id": null, - "params": [], - "generator": false, - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ReturnStatement", - "argument": { - "type": "Literal", - "value": 1, - "raw": "1" - } - } - ] - }, - "expression": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "cooked": "nested", - "raw": "nested" - }, - "tail": false - }, - { - "type": "TemplateElement", - "value": { - "cooked": "endnest", - "raw": "endnest" - }, - "tail": true - } - ] - } - ], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "cooked": "outer", - "raw": "outer" - }, - "tail": false - }, - { - "type": "TemplateElement", - "value": { - "cooked": "bar", - "raw": "bar" - }, - "tail": false - }, - { - "type": "TemplateElement", - "value": { - "cooked": "end", - "raw": "end" - }, - "tail": true - } - ] - } + "type": "File", + "start": 0, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 70 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "expressions": [ + { + "type": "ObjectExpression", + "start": 8, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "properties": [ + { + "type": "Property", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "x" + }, + "value": { + "type": "ObjectExpression", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "properties": [ + { + "type": "Property", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "y" + }, + "value": { + "type": "Literal", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + }, + "kind": "init" + } + ] + }, + "kind": "init" + } + ] + }, + { + "type": "TemplateLiteral", + "start": 26, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "expressions": [ + { + "type": "FunctionExpression", + "start": 35, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 45, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 46, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "argument": { + "type": "Literal", + "start": 53, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ] + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 27, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "value": { + "raw": "nested", + "cooked": "nested" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 57, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 57 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "value": { + "raw": "endnest", + "cooked": "endnest" + }, + "tail": true + } + ] + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": { + "raw": "outer", + "cooked": "outer" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "bar", + "cooked": "bar" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 66, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 66 + }, + "end": { + "line": 1, + "column": 69 + } + }, + "value": { + "raw": "end", + "cooked": "end" + }, + "tail": true + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/27/expected.json b/test/fixtures/harmony/uncategorised/27/expected.json index 2aa5c0d75f..03d7e8df2e 100644 --- a/test/fixtures/harmony/uncategorised/27/expected.json +++ b/test/fixtures/harmony/uncategorised/27/expected.json @@ -1,138 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "SwitchStatement", - "discriminant": { - "type": "Identifier", - "name": "answer", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "cases": [ - { - "type": "SwitchCase", - "test": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "consequent": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "t", - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "init": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 37 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 38 - } - } - }, - { - "type": "BreakStatement", - "label": null, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 45 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 45 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - } - } - ], + "type": "File", + "start": 0, + "end": 47, "loc": { "start": { "line": 1, @@ -142,5 +11,218 @@ "line": 1, "column": 47 } + }, + "range": [ + 0, + 47 + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 0, + 47 + ], + "sourceType": "script", + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 0, + 47 + ], + "discriminant": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 8, + 14 + ], + "name": "answer" + }, + "cases": [ + { + "type": "SwitchCase", + "start": 18, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 18, + 45 + ], + "consequent": [ + { + "type": "VariableDeclaration", + "start": 27, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 27, + 38 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 31, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 31, + 37 + ], + "id": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 31, + 32 + ], + "name": "t" + }, + "init": { + "type": "Literal", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 35, + 37 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ], + "kind": "let" + }, + { + "type": "BreakStatement", + "start": 39, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 39, + 45 + ], + "label": null + } + ], + "test": { + "type": "Literal", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 23, + 25 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ] + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/28/expected.json b/test/fixtures/harmony/uncategorised/28/expected.json index c5c8e5b6a9..d01d114f6f 100644 --- a/test/fixtures/harmony/uncategorised/28/expected.json +++ b/test/fixtures/harmony/uncategorised/28/expected.json @@ -1,52 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [], - "body": { - "type": "Literal", - "value": "test", - "raw": "\"test\"", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -56,5 +11,95 @@ "line": 1, "column": 12 } + }, + "range": [ + 0, + 12 + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "id": null, + "generator": false, + "expression": true, + "params": [], + "body": { + "type": "Literal", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 6, + 12 + ], + "value": "test", + "rawValue": "test", + "raw": "\"test\"" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/29/expected.json b/test/fixtures/harmony/uncategorised/29/expected.json index a374908e88..2c466f20a7 100644 --- a/test/fixtures/harmony/uncategorised/29/expected.json +++ b/test/fixtures/harmony/uncategorised/29/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "Literal", - "value": "test", - "raw": "\"test\"", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - } - ], + "type": "File", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -71,5 +11,116 @@ "line": 1, "column": 11 } + }, + "range": [ + 0, + 11 + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "e" + } + ], + "body": { + "type": "Literal", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 5, + 11 + ], + "value": "test", + "rawValue": "test", + "raw": "\"test\"" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/292/expected.json b/test/fixtures/harmony/uncategorised/292/expected.json index da71dd74f8..6f2037ac63 100644 --- a/test/fixtures/harmony/uncategorised/292/expected.json +++ b/test/fixtures/harmony/uncategorised/292/expected.json @@ -1,5 +1,7 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -10,21 +12,34 @@ "column": 12 } }, - "body": [ - { - "type": "ExpressionStatement", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } + "range": [ + 0, + 12 + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "expression": { - "type": "AssignmentExpression", + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -35,9 +50,14 @@ "column": 12 } }, - "operator": "=", - "left": { - "type": "ArrayPattern", + "range": [ + 0, + 12 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -45,54 +65,96 @@ }, "end": { "line": 1, - "column": 8 + "column": 12 } }, - "elements": [ - { - "type": "RestElement", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - } + "range": [ + 0, + 12 + ], + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "argument": { - "type": "Identifier", + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 0, + 8 + ], + "elements": [ + { + "type": "RestElement", + "start": 1, + "end": 5, "loc": { "start": { "line": 1, - "column": 4 + "column": 1 }, "end": { "line": 1, "column": 5 } }, - "name": "a" + "range": [ + 1, + 5 + ], + "argument": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 4, + 5 + ], + "name": "a" + } } - } - ] - }, - "right": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } + ] }, - "name": "b" + "right": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "b" + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/299/expected.json b/test/fixtures/harmony/uncategorised/299/expected.json index bace756463..67a0f6223a 100644 --- a/test/fixtures/harmony/uncategorised/299/expected.json +++ b/test/fixtures/harmony/uncategorised/299/expected.json @@ -1,76 +1,260 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "doSmth" + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } }, - "arguments": [ - { - "type": "TemplateLiteral", - "expressions": [ - { - "type": "Identifier", - "name": "x" + "expression": { + "type": "CallExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 }, - { - "type": "Identifier", - "name": "y" + "end": { + "line": 1, + "column": 6 + } + }, + "name": "doSmth" + }, + "arguments": [ + { + "type": "TemplateLiteral", + "start": 7, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 31 + } }, - { - "type": "BinaryExpression", - "left": { + "expressions": [ + { "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, "name": "x" }, - "operator": "+", - "right": { + { "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, "name": "y" + }, + { + "type": "BinaryExpression", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "left": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "name": "x" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "y" + } } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "cooked": "", - "raw": "" + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 8, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": { + "raw": "", + "cooked": "" + }, + "tail": false }, - "tail": false - }, - { - "type": "TemplateElement", - "value": { - "cooked": " + ", - "raw": " + " + { + "type": "TemplateElement", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": " + ", + "cooked": " + " + }, + "tail": false }, - "tail": false - }, - { - "type": "TemplateElement", - "value": { - "cooked": " = ", - "raw": " = " + { + "type": "TemplateElement", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": " = ", + "cooked": " = " + }, + "tail": false }, - "tail": false - }, - { - "type": "TemplateElement", - "value": { - "cooked": "", - "raw": "" - }, - "tail": true - } - ] - } - ] + { + "type": "TemplateElement", + "start": 30, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": { + "raw": "", + "cooked": "" + }, + "tail": true + } + ] + } + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/3/expected.json b/test/fixtures/harmony/uncategorised/3/expected.json index d2761bdf96..a8ea5f8efd 100644 --- a/test/fixtures/harmony/uncategorised/3/expected.json +++ b/test/fixtures/harmony/uncategorised/3/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 0, - "raw": "00", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], + "type": "File", + "start": 0, + "end": 2, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 2 } + }, + "range": [ + 0, + 2 + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 0, + 2 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 0, + 2 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 0, + 2 + ], + "value": 0, + "rawValue": 0, + "raw": "00" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/30/expected.json b/test/fixtures/harmony/uncategorised/30/expected.json index c6d03377fe..dd01678586 100644 --- a/test/fixtures/harmony/uncategorised/30/expected.json +++ b/test/fixtures/harmony/uncategorised/30/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], - "body": { - "type": "Literal", - "value": "test", - "raw": "\"test\"", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -71,5 +11,116 @@ "line": 1, "column": 13 } + }, + "range": [ + 0, + 13 + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "e" + } + ], + "body": { + "type": "Literal", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 7, + 13 + ], + "value": "test", + "rawValue": "test", + "raw": "\"test\"" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/300/expected.json b/test/fixtures/harmony/uncategorised/300/expected.json index 974391f310..ba241b2787 100644 --- a/test/fixtures/harmony/uncategorised/300/expected.json +++ b/test/fixtures/harmony/uncategorised/300/expected.json @@ -1,36 +1,150 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "normal" - }, - "params": [ - { - "type": "Identifier", - "name": "x" - }, - { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "y" - }, - "right": { - "type": "Literal", - "value": 10, - "raw": "10" - } - } - ], - "generator": false, - "body": { - "type": "BlockStatement", - "body": [] - }, - "expression": false + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "normal" + }, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "x" + }, + { + "type": "AssignmentPattern", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "y" + }, + "right": { + "type": "Literal", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/301/expected.json b/test/fixtures/harmony/uncategorised/301/expected.json index afd84e5568..748f7b6f7d 100644 --- a/test/fixtures/harmony/uncategorised/301/expected.json +++ b/test/fixtures/harmony/uncategorised/301/expected.json @@ -1,29 +1,130 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "foo" + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 } }, - { - "type": "ImportNamespaceSpecifier", - "local": { - "type": "Identifier", - "name": "bar" + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "local": { + "type": "Identifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "foo" + } + }, + { + "type": "ImportNamespaceSpecifier", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "local": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "name": "bar" + } } + ], + "source": { + "type": "Literal", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": "baz", + "rawValue": "baz", + "raw": "'baz'" } - ], - "source": { - "type": "Literal", - "value": "baz", - "raw": "'baz'" } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/302/expected.json b/test/fixtures/harmony/uncategorised/302/expected.json index 4394b55e84..835ebf5398 100644 --- a/test/fixtures/harmony/uncategorised/302/expected.json +++ b/test/fixtures/harmony/uncategorised/302/expected.json @@ -1,54 +1,178 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "SequenceExpression", - "expressions": [ - { - "type": "TemplateLiteral", - "expressions": [ - { - "type": "Identifier", - "name": "x" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "cooked": "{", - "raw": "{" - }, - "tail": false - }, - { - "type": "TemplateElement", - "value": { - "cooked": "}", - "raw": "}" - }, - "tail": true - } - ] - }, - { - "type": "TemplateLiteral", - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "cooked": "}", - "raw": "}" - }, - "tail": true - } - ] - } - ] - } + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expressions": [ + { + "type": "TemplateLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": "x" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "value": { + "raw": "{", + "cooked": "{" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": { + "raw": "}", + "cooked": "}" + }, + "tail": true + } + ] + }, + { + "type": "TemplateLiteral", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "}", + "cooked": "}" + }, + "tail": true + } + ] + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/303/expected.json b/test/fixtures/harmony/uncategorised/303/expected.json index c27da5dbb2..c58193f339 100644 --- a/test/fixtures/harmony/uncategorised/303/expected.json +++ b/test/fixtures/harmony/uncategorised/303/expected.json @@ -1,38 +1,150 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "get" - }, - "kind": "init", - "value": { - "type": "Identifier", - "name": "get" - } - } - ] - }, - "init": { - "type": "Identifier", - "name": "obj" - } - } - ], - "kind": "var" + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "properties": [ + { + "type": "Property", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "get" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "get" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "obj" + } + } + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/304/expected.json b/test/fixtures/harmony/uncategorised/304/expected.json index bc553e84d9..834d1c2f58 100644 --- a/test/fixtures/harmony/uncategorised/304/expected.json +++ b/test/fixtures/harmony/uncategorised/304/expected.json @@ -1,85 +1,226 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, "range": [ 0, 45 ], - "body": [ - { - "type": "VariableDeclaration", - "range": [ - 0, - 45 - ], - "declarations": [ - { - "type": "VariableDeclarator", - "range": [ - 4, - 45 - ], - "id": { - "type": "ObjectPattern", + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 0, + 45 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 0, + 45 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 45 + } + }, "range": [ 4, - 39 - ], - "properties": [ - { - "type": "Property", - "range": [ - 5, - 38 - ], - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "range": [ - 5, - 13 - ], - "name": "propName" - }, - "value": { - "type": "AssignmentPattern", - "range": [ - 15, - 38 - ], - "left": { - "type": "Identifier", - "range": [ - 15, - 23 - ], - "name": "localVar" - }, - "right": { - "type": "Identifier", - "range": [ - 26, - 38 - ], - "name": "defaultValue" - } - }, - "kind": "init" - } - ] - }, - "init": { - "type": "Identifier", - "range": [ - 42, 45 ], - "name": "obj" + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 4, + 39 + ], + "properties": [ + { + "type": "Property", + "start": 5, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 5, + 38 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 5, + 13 + ], + "name": "propName" + }, + "value": { + "type": "AssignmentPattern", + "start": 15, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 15, + 38 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 15, + 23 + ], + "name": "localVar" + }, + "right": { + "type": "Identifier", + "start": 26, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 26, + 38 + ], + "name": "defaultValue" + } + }, + "kind": "init" + } + ] + }, + "init": { + "type": "Identifier", + "start": 42, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 42, + 45 + ], + "name": "obj" + } } - } - ], - "kind": "var" - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/305/expected.json b/test/fixtures/harmony/uncategorised/305/expected.json index df625e210d..d6d4d7a725 100644 --- a/test/fixtures/harmony/uncategorised/305/expected.json +++ b/test/fixtures/harmony/uncategorised/305/expected.json @@ -1,85 +1,226 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, "range": [ 0, 35 ], - "body": [ - { - "type": "VariableDeclaration", - "range": [ - 0, - 35 - ], - "declarations": [ - { - "type": "VariableDeclarator", - "range": [ - 4, - 35 - ], - "id": { - "type": "ObjectPattern", + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 35 + } + }, "range": [ 4, - 29 + 35 ], - "properties": [ - { - "type": "Property", - "range": [ - 5, - 28 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "range": [ - 5, - 13 - ], - "name": "propName" + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 4 }, - "kind": "init", - "value": { - "type": "AssignmentPattern", + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 4, + 29 + ], + "properties": [ + { + "type": "Property", + "start": 5, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 28 + } + }, "range": [ 5, 28 ], - "left": { + "method": false, + "shorthand": true, + "computed": false, + "key": { "type": "Identifier", + "start": 5, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 13 + } + }, "range": [ 5, 13 ], "name": "propName" }, - "right": { - "type": "Identifier", + "kind": "init", + "value": { + "type": "AssignmentPattern", + "start": 5, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 28 + } + }, "range": [ - 16, + 5, 28 ], - "name": "defaultValue" + "operator": "=", + "left": { + "type": "Identifier", + "start": 5, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 5, + 13 + ], + "name": "propName" + }, + "right": { + "type": "Identifier", + "start": 16, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 16, + 28 + ], + "name": "defaultValue" + } } } - } - ] - }, - "init": { - "type": "Identifier", - "range": [ - 32, - 35 - ], - "name": "obj" + ] + }, + "init": { + "type": "Identifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 32, + 35 + ], + "name": "obj" + } } - } - ], - "kind": "var" - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/306/expected.json b/test/fixtures/harmony/uncategorised/306/expected.json index 3dd00f7f3c..2d8b534196 100644 --- a/test/fixtures/harmony/uncategorised/306/expected.json +++ b/test/fixtures/harmony/uncategorised/306/expected.json @@ -1,66 +1,183 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, "range": [ 0, 35 ], - "body": [ - { - "type": "VariableDeclaration", - "range": [ - 0, - 35 - ], - "declarations": [ - { - "type": "VariableDeclarator", - "range": [ - 4, - 35 - ], - "id": { - "type": "ArrayPattern", + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 35 + } + }, "range": [ 4, - 29 - ], - "elements": [ - { - "type": "AssignmentPattern", - "range": [ - 5, - 28 - ], - "left": { - "type": "Identifier", - "range": [ - 5, - 13 - ], - "name": "localVar" - }, - "right": { - "type": "Identifier", - "range": [ - 16, - 28 - ], - "name": "defaultValue" - } - } - ] - }, - "init": { - "type": "Identifier", - "range": [ - 32, 35 ], - "name": "obj" + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 4, + 29 + ], + "elements": [ + { + "type": "AssignmentPattern", + "start": 5, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 5, + 28 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 5, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 5, + 13 + ], + "name": "localVar" + }, + "right": { + "type": "Identifier", + "start": 16, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 16, + 28 + ], + "name": "defaultValue" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 32, + 35 + ], + "name": "obj" + } } - } - ], - "kind": "var" - } - ] + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/307/expected.json b/test/fixtures/harmony/uncategorised/307/expected.json index 3b67d10c70..ced7a5674c 100644 --- a/test/fixtures/harmony/uncategorised/307/expected.json +++ b/test/fixtures/harmony/uncategorised/307/expected.json @@ -1,83 +1,227 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, "range": [ 0, 15 ], - "body": [ - { - "type": "ExpressionStatement", - "range": [ - 0, - 15 - ], - "expression": { - "type": "AssignmentExpression", + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, "range": [ - 1, - 14 + 0, + 15 ], - "operator": "=", - "left": { - "type": "ObjectPattern", + "expression": { + "type": "AssignmentExpression", + "start": 1, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 14 + } + }, "range": [ 1, - 8 + 14 ], - "properties": [ - { - "type": "Property", - "range": [ - 2, - 7 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "range": [ - 2, - 3 - ], - "name": "x" + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 }, - "kind": "init", - "value": { - "type": "AssignmentPattern", + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 1, + 8 + ], + "properties": [ + { + "type": "Property", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, "range": [ 2, 7 ], - "left": { + "method": false, + "shorthand": true, + "computed": false, + "key": { "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, "range": [ 2, 3 ], "name": "x" }, - "right": { - "type": "Literal", + "kind": "init", + "value": { + "type": "AssignmentPattern", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, "range": [ - 6, + 2, 7 ], - "value": 0 + "operator": "=", + "left": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 2, + 3 + ], + "name": "x" + }, + "right": { + "type": "Literal", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "value": 0, + "rawValue": 0, + "raw": "0" + } } } - } - ] - }, - "right": { - "type": "Identifier", - "range": [ - 11, - 14 - ], - "name": "obj" + ] + }, + "right": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 11, + 14 + ], + "name": "obj" + }, + "parenthesizedExpression": true } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/308/expected.json b/test/fixtures/harmony/uncategorised/308/expected.json index 27bb46f8d0..ac1531ffe4 100644 --- a/test/fixtures/harmony/uncategorised/308/expected.json +++ b/test/fixtures/harmony/uncategorised/308/expected.json @@ -1,87 +1,230 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, "range": [ 0, 14 ], - "body": [ - { - "type": "ExpressionStatement", - "range": [ - 0, - 14 - ], - "expression": { - "type": "ArrowFunctionExpression", + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, "range": [ 0, 14 ], - "id": null, - "generator": false, - "expression": true, - "params": [ - { - "type": "ObjectPattern", - "range": [ - 1, - 8 - ], - "properties": [ - { - "type": "Property", - "range": [ - 2, - 7 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "range": [ - 2, - 3 - ], - "name": "x" + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "ObjectPattern", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 }, - "kind": "init", - "value": { - "type": "AssignmentPattern", + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 1, + 8 + ], + "properties": [ + { + "type": "Property", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, "range": [ 2, 7 ], - "left": { + "method": false, + "shorthand": true, + "computed": false, + "key": { "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, "range": [ 2, 3 ], "name": "x" }, - "right": { - "type": "Literal", + "kind": "init", + "value": { + "type": "AssignmentPattern", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, "range": [ - 6, + 2, 7 ], - "value": 0 + "operator": "=", + "left": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 2, + 3 + ], + "name": "x" + }, + "right": { + "type": "Literal", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "value": 0, + "rawValue": 0, + "raw": "0" + } } } - } - ] - } - ], - "body": { - "type": "Identifier", - "range": [ - 13, - 14 + ] + } ], - "name": "x" + "body": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "x" + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/309/expected.json b/test/fixtures/harmony/uncategorised/309/expected.json index dbefff3674..33b016eb1c 100644 --- a/test/fixtures/harmony/uncategorised/309/expected.json +++ b/test/fixtures/harmony/uncategorised/309/expected.json @@ -1,128 +1,331 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, "range": [ 0, 23 ], - "body": [ - { - "type": "ExpressionStatement", - "range": [ - 0, - 23 - ], - "expression": { - "type": "AssignmentExpression", + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, "range": [ 0, 23 ], - "operator": "=", - "left": { - "type": "ArrayPattern", + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, "range": [ 0, - 17 + 23 ], - "elements": [ - { - "type": "Identifier", - "range": [ - 1, - 2 - ], - "name": "a" + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } }, - { - "type": "ObjectPattern", - "range": [ - 4, - 16 - ], - "properties": [ - { - "type": "Property", - "range": [ - 5, - 15 - ], - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", + "range": [ + 0, + 17 + ], + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + { + "type": "ObjectPattern", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 4, + 16 + ], + "properties": [ + { + "type": "Property", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, "range": [ 5, - 6 - ], - "name": "b" - }, - "value": { - "type": "ObjectPattern", - "range": [ - 8, 15 ], - "properties": [ - { - "type": "Property", - "range": [ - 9, - 14 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "range": [ - 9, - 10 - ], - "name": "c" + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 }, - "kind": "init", - "value": { - "type": "AssignmentPattern", + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "b" + }, + "value": { + "type": "ObjectPattern", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 8, + 15 + ], + "properties": [ + { + "type": "Property", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, "range": [ 9, 14 ], - "left": { + "method": false, + "shorthand": true, + "computed": false, + "key": { "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, "range": [ 9, 10 ], "name": "c" }, - "right": { - "type": "Literal", + "kind": "init", + "value": { + "type": "AssignmentPattern", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, "range": [ - 13, + 9, 14 ], - "value": 1 + "operator": "=", + "left": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "c" + }, + "right": { + "type": "Literal", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "value": 1, + "rawValue": 1, + "raw": "1" + } } } - } - ] - }, - "kind": "init" - } - ] - } - ] - }, - "right": { - "type": "Identifier", - "range": [ - 20, - 23 - ], - "name": "arr" + ] + }, + "kind": "init" + } + ] + } + ] + }, + "right": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 20, + 23 + ], + "name": "arr" + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/31/expected.json b/test/fixtures/harmony/uncategorised/31/expected.json index dba12043f4..386dd08a65 100644 --- a/test/fixtures/harmony/uncategorised/31/expected.json +++ b/test/fixtures/harmony/uncategorised/31/expected.json @@ -1,81 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], - "body": { - "type": "Literal", - "value": "test", - "raw": "\"test\"", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -85,5 +11,136 @@ "line": 1, "column": 16 } + }, + "range": [ + 0, + 16 + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 4, + 5 + ], + "name": "b" + } + ], + "body": { + "type": "Literal", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 10, + 16 + ], + "value": "test", + "rawValue": "test", + "raw": "\"test\"" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/310/expected.json b/test/fixtures/harmony/uncategorised/310/expected.json index 443f825d22..96a1f507cb 100644 --- a/test/fixtures/harmony/uncategorised/310/expected.json +++ b/test/fixtures/harmony/uncategorised/310/expected.json @@ -1,82 +1,225 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, "range": [ 0, 21 ], - "body": [ - { - "type": "ForInStatement", - "range": [ - 0, - 21 - ], - "left": { - "type": "ObjectPattern", + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, "range": [ - 5, - 12 + 0, + 21 ], - "properties": [ - { - "type": "Property", - "range": [ - 6, - 11 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "range": [ - 6, - 7 - ], - "name": "x" + "left": { + "type": "ObjectPattern", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 }, - "kind": "init", - "value": { - "type": "AssignmentPattern", + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 5, + 12 + ], + "properties": [ + { + "type": "Property", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, "range": [ 6, 11 ], - "left": { + "method": false, + "shorthand": true, + "computed": false, + "key": { "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, "range": [ 6, 7 ], "name": "x" }, - "right": { - "type": "Literal", + "kind": "init", + "value": { + "type": "AssignmentPattern", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, "range": [ - 10, + 6, 11 ], - "value": 0 + "operator": "=", + "left": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "x" + }, + "right": { + "type": "Literal", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "value": 0, + "rawValue": 0, + "raw": "0" + } } } - } - ] - }, - "right": { - "type": "Identifier", - "range": [ - 16, - 19 - ], - "name": "arr" - }, - "body": { - "type": "EmptyStatement", - "range": [ - 20, - 21 - ] + ] + }, + "right": { + "type": "Identifier", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 16, + 19 + ], + "name": "arr" + }, + "body": { + "type": "EmptyStatement", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 20, + 21 + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/313/expected.json b/test/fixtures/harmony/uncategorised/313/expected.json index cd7c23b6ce..5b49b6092c 100644 --- a/test/fixtures/harmony/uncategorised/313/expected.json +++ b/test/fixtures/harmony/uncategorised/313/expected.json @@ -1,76 +1,205 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, "range": [ 0, 27 ], - "body": [ - { - "type": "TryStatement", - "range": [ - 0, - 27 - ], - "block": { - "type": "BlockStatement", - "range": [ - 4, - 6 - ], - "body": [] + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "handler": { - "type": "CatchClause", + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "script", + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, "range": [ - 7, + 0, 27 ], - "param": { - "type": "ObjectPattern", - "range": [ - 14, - 23 - ], - "properties": [ - { - "type": "Property", - "range": [ - 15, - 22 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "range": [ - 15, - 22 - ], - "name": "message" - }, - "kind": "init", - "value": { - "type": "Identifier", - "range": [ - 15, - 22 - ], - "name": "message" - } - } - ] - }, - "body": { + "block": { "type": "BlockStatement", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, "range": [ - 25, - 27 + 4, + 6 ], "body": [] - } - }, - "finalizer": null - } - ] + }, + "handler": { + "type": "CatchClause", + "start": 7, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 7, + 27 + ], + "param": { + "type": "ObjectPattern", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 14, + 23 + ], + "properties": [ + { + "type": "Property", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 15, + 22 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 15, + 22 + ], + "name": "message" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 15, + 22 + ], + "name": "message" + } + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 25, + 27 + ], + "body": [] + } + }, + "guardedHandlers": [], + "finalizer": null + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/314/expected.json b/test/fixtures/harmony/uncategorised/314/expected.json index ad736da811..a39dd5d729 100644 --- a/test/fixtures/harmony/uncategorised/314/expected.json +++ b/test/fixtures/harmony/uncategorised/314/expected.json @@ -1,71 +1,187 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, "range": [ 0, 23 ], - "body": [ - { - "type": "ClassDeclaration", - "range": [ - 0, - 23 - ], - "id": { - "type": "Identifier", - "range": [ - 6, - 7 - ], - "name": "A" + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "superClass": null, - "body": { - "type": "ClassBody", + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, "range": [ - 8, + 0, 23 ], - "body": [ - { - "type": "MethodDefinition", - "range": [ - 10, - 21 - ], - "computed": false, - "key": { - "type": "Identifier", + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 8, + 23 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 21 + } + }, "range": [ 10, - 16 - ], - "name": "static" - }, - "static": false, - "kind": "method", - "value": { - "type": "FunctionExpression", - "range": [ - 16, 21 ], - "id": null, - "params": [], - "generator": false, - "body": { - "type": "BlockStatement", + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, "range": [ - 19, + 10, + 16 + ], + "name": "static" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 16, 21 ], - "body": [] - }, - "expression": false + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 19, + 21 + ], + "body": [] + } + } } - } - ] + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/315/expected.json b/test/fixtures/harmony/uncategorised/315/expected.json index ab1848e14f..25ed64855e 100644 --- a/test/fixtures/harmony/uncategorised/315/expected.json +++ b/test/fixtures/harmony/uncategorised/315/expected.json @@ -1,82 +1,222 @@ { - "type": "Program", - "body": [ - { - "type": "ForOfStatement", - "left": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "range": [ - 11, - 12 - ] - }, - "init": null, - "range": [ - 11, - 12 - ] - } - ], - "kind": "const", - "range": [ - 5, - 12 - ] - }, - "right": { - "type": "Identifier", - "name": "list", - "range": [ - 16, - 20 - ] - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "process", - "range": [ - 22, - 29 - ] - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "range": [ - 30, - 31 - ] - } - ], - "range": [ - 22, - 32 - ] - }, - "range": [ - 22, - 33 - ] - }, - "range": [ - 0, - 33 - ] + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 } - ], + }, "range": [ 0, 33 - ] + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "sourceType": "script", + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 5, + 12 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "id": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "x" + }, + "init": null + } + ], + "kind": "const" + }, + "right": { + "type": "Identifier", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 16, + 20 + ], + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 22, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 22, + 33 + ], + "expression": { + "type": "CallExpression", + "start": 22, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 22, + 32 + ], + "callee": { + "type": "Identifier", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 22, + 29 + ], + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 30, + 31 + ], + "name": "x" + } + ] + } + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/316/expected.json b/test/fixtures/harmony/uncategorised/316/expected.json index 582bbfb09e..9ca89fd09d 100644 --- a/test/fixtures/harmony/uncategorised/316/expected.json +++ b/test/fixtures/harmony/uncategorised/316/expected.json @@ -1,71 +1,187 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, "range": [ 0, 24 ], - "body": [ - { - "type": "ClassDeclaration", - "range": [ - 0, - 24 - ], - "id": { - "type": "Identifier", - "range": [ - 6, - 7 - ], - "name": "A" + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "superClass": null, - "body": { - "type": "ClassBody", + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, "range": [ - 8, + 0, 24 ], - "body": [ - { - "type": "MethodDefinition", - "range": [ - 10, - 22 - ], - "computed": false, - "key": { - "type": "Identifier", - "range": [ - 11, - 17 - ], - "name": "static" + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 }, - "static": false, - "kind": "method", - "value": { - "type": "FunctionExpression", + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 8, + 24 + ], + "body": [ + { + "type": "MethodDefinition", + "start": 10, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 22 + } + }, "range": [ - 17, + 10, 22 ], - "id": null, - "params": [], - "generator": true, - "body": { - "type": "BlockStatement", + "computed": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, "range": [ - 20, + 11, + 17 + ], + "name": "static" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 17, 22 ], - "body": [] - }, - "expression": false + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 20, + 22 + ], + "body": [] + } + } } - } - ] + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/317/expected.json b/test/fixtures/harmony/uncategorised/317/expected.json index 436b290032..dbe9545412 100644 --- a/test/fixtures/harmony/uncategorised/317/expected.json +++ b/test/fixtures/harmony/uncategorised/317/expected.json @@ -1,90 +1,230 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 22, - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 22, - "expression": { - "type": "TemplateLiteral", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", "start": 0, "end": 22, - "expressions": [ - { - "type": "MemberExpression", - "start": 3, - "end": 20, - "object": { - "type": "CallExpression", - "start": 3, - "end": 17, - "callee": { - "type": "MemberExpression", - "start": 3, - "end": 12, - "object": { - "type": "Literal", - "start": 3, - "end": 7, - "regex": { - "pattern": "\\d", - "flags": "" - }, - "raw": "/\\d/" - }, - "property": { - "type": "Identifier", - "start": 8, - "end": 12, - "name": "exec" - }, - "computed": false - }, - "arguments": [ - { - "type": "Literal", - "start": 13, - "end": 16, - "value": "1", - "raw": "'1'" - } - ] - }, - "property": { - "type": "Literal", - "start": 18, - "end": 19, - "value": 0, - "raw": "0" - }, - "computed": true - } - ], - "quasis": [ - { - "type": "TemplateElement", - "start": 1, - "end": 1, - "value": { - "raw": "", - "cooked": "" - }, - "tail": false + "loc": { + "start": { + "line": 1, + "column": 0 }, - { - "type": "TemplateElement", - "start": 21, - "end": 21, - "value": { - "raw": "", - "cooked": "" - }, - "tail": true + "end": { + "line": 1, + "column": 22 } - ] + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "MemberExpression", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "object": { + "type": "CallExpression", + "start": 3, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "callee": { + "type": "MemberExpression", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "object": { + "type": "Literal", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": {}, + "rawValue": {}, + "raw": "/\\d/", + "regex": { + "pattern": "\\d", + "flags": "" + } + }, + "property": { + "type": "Identifier", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "exec" + }, + "computed": false + }, + "arguments": [ + { + "type": "Literal", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": "1", + "rawValue": "1", + "raw": "'1'" + } + ] + }, + "property": { + "type": "Literal", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": 0, + "rawValue": 0, + "raw": "0" + }, + "computed": true + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "value": { + "raw": "", + "cooked": "" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 21, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "", + "cooked": "" + }, + "tail": true + } + ] + } } - } - ] -} + ] + } +} \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/318/expected.json b/test/fixtures/harmony/uncategorised/318/expected.json index d96babe10c..76c700c7ee 100644 --- a/test/fixtures/harmony/uncategorised/318/expected.json +++ b/test/fixtures/harmony/uncategorised/318/expected.json @@ -1,33 +1,100 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 13, - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 13, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 12, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "name": "_𐒦" - }, - "init": { - "type": "Literal", - "start": 10, - "end": 12, - "value": 10, - "raw": "10" - } - } - ], - "kind": "var" + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "name": "_𐒦" + }, + "init": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + } + } + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/319/expected.json b/test/fixtures/harmony/uncategorised/319/expected.json index b6c192abc4..15bd7d71f1 100644 --- a/test/fixtures/harmony/uncategorised/319/expected.json +++ b/test/fixtures/harmony/uncategorised/319/expected.json @@ -1,33 +1,100 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 20, - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 20, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 19, - "id": { - "type": "Identifier", - "start": 4, - "end": 14, - "name": "_𐒦" - }, - "init": { - "type": "Literal", - "start": 17, - "end": 19, - "value": 10, - "raw": "10" - } - } - ], - "kind": "var" + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 } - ] + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "_𐒦" + }, + "init": { + "type": "Literal", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": 10, + "rawValue": 10, + "raw": "10" + } + } + ], + "kind": "var" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/32/expected.json b/test/fixtures/harmony/uncategorised/32/expected.json index b85192e8aa..5adb93ac71 100644 --- a/test/fixtures/harmony/uncategorised/32/expected.json +++ b/test/fixtures/harmony/uncategorised/32/expected.json @@ -1,95 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -99,5 +11,156 @@ "line": 1, "column": 12 } + }, + "range": [ + 0, + 12 + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "e" + } + ], + "body": { + "type": "BlockStatement", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 5, + 12 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 7, + 10 + ], + "expression": { + "type": "Literal", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 7, + 9 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/320/expected.json b/test/fixtures/harmony/uncategorised/320/expected.json index fa2f08eabb..45a5aee6ba 100644 --- a/test/fixtures/harmony/uncategorised/320/expected.json +++ b/test/fixtures/harmony/uncategorised/320/expected.json @@ -1,47 +1,134 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "declarations": [ - { - "start": 4, - "id": { - "start": 4, - "elements": [ - { - "start": 5, - "name": "x", - "type": "Identifier", - "end": 6 - } - ], - "type": "ArrayPattern", - "end": 8 - }, - "init": { - "start": 11, - "elements": [ - { - "start": 12, - "value": 1, - "raw": "1", - "type": "Literal", - "end": 13 - } - ], - "type": "ArrayExpression", - "end": 14 - }, - "type": "VariableDeclarator", - "end": 14 - } - ], - "kind": "let", - "type": "VariableDeclaration", - "end": 14 + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 } - ], - "type": "Program", - "end": 14 + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" + } + ] + }, + "init": { + "type": "ArrayExpression", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "elements": [ + { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } + ] + } + } + ], + "kind": "let" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/321/expected.json b/test/fixtures/harmony/uncategorised/321/expected.json index 37eebe58fe..6b9c75753f 100644 --- a/test/fixtures/harmony/uncategorised/321/expected.json +++ b/test/fixtures/harmony/uncategorised/321/expected.json @@ -1,54 +1,150 @@ { + "type": "File", "start": 0, - "body": [ - { - "start": 0, - "declarations": [ - { - "start": 4, - "id": { - "start": 4, - "properties": [ - { - "start": 5, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "start": 5, - "name": "x", - "type": "Identifier", - "end": 6 - }, - "kind": "init", - "value": { - "start": 5, - "name": "x", - "type": "Identifier", - "end": 6 - }, - "type": "Property", - "end": 6 - } - ], - "type": "ObjectPattern", - "end": 7 - }, - "init": { - "start": 10, - "name": "y", - "type": "Identifier", - "end": 11 - }, - "type": "VariableDeclarator", - "end": 11 - } - ], - "kind": "let", - "type": "VariableDeclaration", - "end": 11 + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 } - ], - "type": "Program", - "end": 11 + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "properties": [ + { + "type": "Property", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "name": "x" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": "y" + } + } + ], + "kind": "let" + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/322/expected.json b/test/fixtures/harmony/uncategorised/322/expected.json index dc4fc97f04..6f01dc81ea 100644 --- a/test/fixtures/harmony/uncategorised/322/expected.json +++ b/test/fixtures/harmony/uncategorised/322/expected.json @@ -1,27 +1,116 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "x" - }, - null - ] + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } }, - "right": { - "type": "Literal", - "value": 1, - "raw": "1" + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "name": "x" + }, + null + ] + }, + "right": { + "type": "Literal", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": 1, + "rawValue": 1, + "raw": "1" + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/323/expected.json b/test/fixtures/harmony/uncategorised/323/expected.json index 4b1c5e53a8..6473ce385e 100644 --- a/test/fixtures/harmony/uncategorised/323/expected.json +++ b/test/fixtures/harmony/uncategorised/323/expected.json @@ -1,40 +1,163 @@ { - "body": [ - { - "left": { - "declarations": [ - { - "id": { - "elements": [ - { - "name": "name", - "type": "Identifier" - }, - { - "name": "value", - "type": "Identifier" - } - ], - "type": "ArrayPattern" - }, - "init": null, - "type": "VariableDeclarator" - } - ], - "kind": "var", - "type": "VariableDeclaration" - }, - "right": { - "name": "obj", - "type": "Identifier" - }, - "body": { - "body": [], - "type": "BlockStatement" - }, - "type": "ForInStatement" + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 } - ], - "sourceType": "script", - "type": "Program" + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "ArrayPattern", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "name" + }, + { + "type": "Identifier", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "value" + } + ] + }, + "init": null + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "name": "obj" + }, + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/33/expected.json b/test/fixtures/harmony/uncategorised/33/expected.json index 41cecc9e49..0328455d8a 100644 --- a/test/fixtures/harmony/uncategorised/33/expected.json +++ b/test/fixtures/harmony/uncategorised/33/expected.json @@ -1,113 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "property", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "value": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], + "type": "File", + "start": 0, + "end": 23, "loc": { "start": { "line": 1, @@ -117,5 +11,181 @@ "line": 1, "column": 23 } + }, + "range": [ + 0, + 23 + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "e" + } + ], + "body": { + "type": "ObjectExpression", + "start": 6, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 6, + 22 + ], + "properties": [ + { + "type": "Property", + "start": 8, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 8, + 20 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 8, + 16 + ], + "name": "property" + }, + "value": { + "type": "Literal", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 18, + 20 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + }, + "kind": "init" + } + ], + "parenthesizedExpression": true + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/336/expected.json b/test/fixtures/harmony/uncategorised/336/expected.json index cf3e1f99af..9822daf8c2 100644 --- a/test/fixtures/harmony/uncategorised/336/expected.json +++ b/test/fixtures/harmony/uncategorised/336/expected.json @@ -1,20 +1,95 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "MetaProperty", - "meta": { - "type": "Identifier", - "name": "new" + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } }, - "property": { - "type": "Identifier", - "name": "target" + "expression": { + "type": "MetaProperty", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "meta": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "target" + } } } - } - ], - "sourceType": "script" + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/338/expected.json b/test/fixtures/harmony/uncategorised/338/expected.json index 78731d00c9..4df49d304a 100644 --- a/test/fixtures/harmony/uncategorised/338/expected.json +++ b/test/fixtures/harmony/uncategorised/338/expected.json @@ -1,31 +1,131 @@ { - "body": [ - { - "declaration": { - "id": { - "name": "foo", - "type": "Identifier" - }, - "generator": false, - "expression": false, - "params": [], - "body": { - "body": [], - "type": "BlockStatement" - }, - "type": "FunctionDeclaration" - }, - "type": "ExportDefaultDeclaration" + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 }, - { - "expression": { - "value": false, - "raw": "false", - "type": "Literal" - }, - "type": "ExpressionStatement" + "end": { + "line": 1, + "column": 38 } - ], - "sourceType": "module", - "type": "Program" + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "declaration": { + "type": "FunctionDeclaration", + "start": 15, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "name": "foo" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [] + } + } + }, + { + "type": "ExpressionStatement", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "Literal", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "value": false, + "rawValue": false, + "raw": "false" + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/34/expected.json b/test/fixtures/harmony/uncategorised/34/expected.json index 9bf06316f5..8212b67274 100644 --- a/test/fixtures/harmony/uncategorised/34/expected.json +++ b/test/fixtures/harmony/uncategorised/34/expected.json @@ -1,122 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "LabeledStatement", - "label": { - "type": "Identifier", - "name": "label", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "body": { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -126,5 +11,195 @@ "line": 1, "column": 18 } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "e" + } + ], + "body": { + "type": "BlockStatement", + "start": 5, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 5, + 18 + ], + "body": [ + { + "type": "LabeledStatement", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 7, + 16 + ], + "body": { + "type": "ExpressionStatement", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 14, + 16 + ], + "expression": { + "type": "Literal", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 14, + 16 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + }, + "label": { + "type": "Identifier", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 7, + 12 + ], + "name": "label" + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/35/expected.json b/test/fixtures/harmony/uncategorised/35/expected.json index 95b37d2461..89a7d0e35b 100644 --- a/test/fixtures/harmony/uncategorised/35/expected.json +++ b/test/fixtures/harmony/uncategorised/35/expected.json @@ -1,109 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -113,5 +11,176 @@ "line": 1, "column": 17 } + }, + "range": [ + 0, + 17 + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 4, + 5 + ], + "name": "b" + } + ], + "body": { + "type": "BlockStatement", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 10, + 17 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 12, + 15 + ], + "expression": { + "type": "Literal", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 12, + 14 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/36/expected.json b/test/fixtures/harmony/uncategorised/36/expected.json index 01ae072799..599ed961c7 100644 --- a/test/fixtures/harmony/uncategorised/36/expected.json +++ b/test/fixtures/harmony/uncategorised/36/expected.json @@ -1,97 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - null, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], - "body": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -101,5 +11,158 @@ "line": 1, "column": 16 } + }, + "range": [ + 0, + 16 + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 1, + 9 + ], + "elements": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 2, + 3 + ], + "name": "a" + }, + null, + { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "b" + } + ] + } + ], + "body": { + "type": "Literal", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 14, + 16 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/39/expected.json b/test/fixtures/harmony/uncategorised/39/expected.json index 19e2f07f0c..9d2a367cb8 100644 --- a/test/fixtures/harmony/uncategorised/39/expected.json +++ b/test/fixtures/harmony/uncategorised/39/expected.json @@ -1,122 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "right": { - "type": "Literal", - "value": 1, - "raw": "1", - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], - "body": { - "type": "BinaryExpression", - "operator": "*", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "right": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -126,5 +11,195 @@ "line": 1, "column": 14 } + }, + "range": [ + 0, + 14 + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "AssignmentPattern", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "left": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "x" + }, + "right": { + "type": "Literal", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "value": 1, + "rawValue": 1, + "raw": "1" + } + } + ], + "body": { + "type": "BinaryExpression", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 9, + 14 + ], + "left": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "x" + }, + "operator": "*", + "right": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "x" + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/4/expected.json b/test/fixtures/harmony/uncategorised/4/expected.json index 99d7499ff0..22db8e34ca 100644 --- a/test/fixtures/harmony/uncategorised/4/expected.json +++ b/test/fixtures/harmony/uncategorised/4/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 0, - "raw": "0o0", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 3 } + }, + "range": [ + 0, + 3 + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "value": 0, + "rawValue": 0, + "raw": "0o0" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/40/expected.json b/test/fixtures/harmony/uncategorised/40/expected.json index b5b3caf25d..757caf1bd2 100644 --- a/test/fixtures/harmony/uncategorised/40/expected.json +++ b/test/fixtures/harmony/uncategorised/40/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], - "body": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], + "type": "File", + "start": 0, + "end": 10, "loc": { "start": { "line": 1, @@ -71,5 +11,116 @@ "line": 1, "column": 10 } + }, + "range": [ + 0, + 10 + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 0, + 10 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 0, + 10 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 0, + 10 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "name": "eval" + } + ], + "body": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 8, + 10 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/41/expected.json b/test/fixtures/harmony/uncategorised/41/expected.json index bdc17aecae..5468a6f073 100644 --- a/test/fixtures/harmony/uncategorised/41/expected.json +++ b/test/fixtures/harmony/uncategorised/41/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "arguments", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], - "body": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], + "type": "File", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, @@ -71,5 +11,116 @@ "line": 1, "column": 15 } + }, + "range": [ + 0, + 15 + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 0, + 9 + ], + "name": "arguments" + } + ], + "body": { + "type": "Literal", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 13, + 15 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/42/expected.json b/test/fixtures/harmony/uncategorised/42/expected.json index 54422d1351..09097ef77a 100644 --- a/test/fixtures/harmony/uncategorised/42/expected.json +++ b/test/fixtures/harmony/uncategorised/42/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], - "body": { - "type": "Literal", - "value": 0, - "raw": "00", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], + "type": "File", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -71,5 +11,116 @@ "line": 1, "column": 9 } + }, + "range": [ + 0, + 9 + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 0, + 9 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 0, + 9 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 0, + 9 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + } + ], + "body": { + "type": "Literal", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 7, + 9 + ], + "value": 0, + "rawValue": 0, + "raw": "00" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/43/expected.json b/test/fixtures/harmony/uncategorised/43/expected.json index fcff117829..9dbb616f35 100644 --- a/test/fixtures/harmony/uncategorised/43/expected.json +++ b/test/fixtures/harmony/uncategorised/43/expected.json @@ -1,81 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "body": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], + "type": "File", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, @@ -85,5 +11,136 @@ "line": 1, "column": 15 } + }, + "range": [ + 0, + 15 + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 1, + 5 + ], + "name": "eval" + }, + { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "a" + } + ], + "body": { + "type": "Literal", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 13, + 15 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/44/expected.json b/test/fixtures/harmony/uncategorised/44/expected.json index 82cf4a7952..4613207cfb 100644 --- a/test/fixtures/harmony/uncategorised/44/expected.json +++ b/test/fixtures/harmony/uncategorised/44/expected.json @@ -1,95 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "right": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], - "body": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -99,5 +11,157 @@ "line": 1, "column": 17 } + }, + "range": [ + 0, + 17 + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "AssignmentPattern", + "start": 1, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 1, + 10 + ], + "left": { + "type": "Identifier", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 1, + 5 + ], + "name": "eval" + }, + "right": { + "type": "Literal", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 8, + 10 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + } + } + ], + "body": { + "type": "Literal", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 15, + 17 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/45/expected.json b/test/fixtures/harmony/uncategorised/45/expected.json index 7393a788e4..157ef8d24e 100644 --- a/test/fixtures/harmony/uncategorised/45/expected.json +++ b/test/fixtures/harmony/uncategorised/45/expected.json @@ -1,109 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "eval", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "right": { - "type": "Literal", - "value": 10, - "raw": "10", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], - "body": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], + "type": "File", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, @@ -113,5 +11,177 @@ "line": 1, "column": 20 } + }, + "range": [ + 0, + 20 + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 1, + 5 + ], + "name": "eval" + }, + { + "type": "AssignmentPattern", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 7, + 13 + ], + "left": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "a" + }, + "right": { + "type": "Literal", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 11, + 13 + ], + "value": 10, + "rawValue": 10, + "raw": "10" + } + } + ], + "body": { + "type": "Literal", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 18, + 20 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/46/expected.json b/test/fixtures/harmony/uncategorised/46/expected.json index 1adbed973c..2132cabecb 100644 --- a/test/fixtures/harmony/uncategorised/46/expected.json +++ b/test/fixtures/harmony/uncategorised/46/expected.json @@ -1,66 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], - "body": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], + "type": "File", + "start": 0, + "end": 8, "loc": { "start": { "line": 1, @@ -70,5 +11,115 @@ "line": 1, "column": 8 } + }, + "range": [ + 0, + 8 + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 0, + 8 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 0, + 8 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 1, + 7 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "x" + } + ], + "body": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "x" + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/47/expected.json b/test/fixtures/harmony/uncategorised/47/expected.json index fa344ba1e9..c28d578118 100644 --- a/test/fixtures/harmony/uncategorised/47/expected.json +++ b/test/fixtures/harmony/uncategorised/47/expected.json @@ -1,99 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], - "body": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -103,5 +11,160 @@ "line": 1, "column": 12 } + }, + "range": [ + 0, + 12 + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "x" + } + ], + "body": { + "type": "ArrowFunctionExpression", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 5, + 12 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "y" + } + ], + "body": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 10, + 12 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/48/expected.json b/test/fixtures/harmony/uncategorised/48/expected.json index 9c63fd3359..b96afb7017 100644 --- a/test/fixtures/harmony/uncategorised/48/expected.json +++ b/test/fixtures/harmony/uncategorised/48/expected.json @@ -1,155 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - } - ], - "body": { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], - "body": { - "type": "SequenceExpression", - "expressions": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "generator": false, - "expression": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], + "type": "File", + "start": 0, + "end": 28, "loc": { "start": { "line": 1, @@ -159,5 +11,241 @@ "line": 1, "column": 28 } + }, + "range": [ + 0, + 28 + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 0, + 28 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "x" + } + ], + "body": { + "type": "ArrowFunctionExpression", + "start": 8, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 8, + 27 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "y" + }, + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "z" + } + ], + "body": { + "type": "SequenceExpression", + "start": 19, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 19, + 26 + ], + "expressions": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ], + "name": "x" + }, + { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ], + "name": "y" + }, + { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 25, + 26 + ], + "name": "z" + } + ], + "parenthesizedExpression": true + }, + "parenthesizedExpression": true + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/49/expected.json b/test/fixtures/harmony/uncategorised/49/expected.json index 97e69dbcb2..ffb8436670 100644 --- a/test/fixtures/harmony/uncategorised/49/expected.json +++ b/test/fixtures/harmony/uncategorised/49/expected.json @@ -1,80 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "arguments": [ - { - "type": "ArrowFunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - } - } - ], + "type": "File", + "start": 0, + "end": 13, "loc": { "start": { "line": 1, @@ -84,5 +11,134 @@ "line": 1, "column": 13 } + }, + "range": [ + 0, + 13 + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "expression": { + "type": "CallExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "callee": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "name": "foo" + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 4, + 12 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 10, + 12 + ], + "body": [] + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/5/expected.json b/test/fixtures/harmony/uncategorised/5/expected.json index 0fcdd900fa..e0ef51a1d1 100644 --- a/test/fixtures/harmony/uncategorised/5/expected.json +++ b/test/fixtures/harmony/uncategorised/5/expected.json @@ -1,108 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "test", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "use strict", - "raw": "'use strict'", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 0, - "raw": "0o0", - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - } - } - ], + "type": "File", + "start": 0, + "end": 37, "loc": { "start": { "line": 1, @@ -112,5 +11,176 @@ "line": 1, "column": 37 } + }, + "range": [ + 0, + 37 + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 0, + 37 + ], + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 0, + 37 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 9, + 13 + ], + "name": "test" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 16, + 37 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 17, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 17, + 30 + ], + "expression": { + "type": "Literal", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 17, + 29 + ], + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + }, + { + "type": "ExpressionStatement", + "start": 31, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 31, + 35 + ], + "expression": { + "type": "Literal", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 31, + 34 + ], + "value": 0, + "rawValue": 0, + "raw": "0o0" + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/50/expected.json b/test/fixtures/harmony/uncategorised/50/expected.json index 3ede40dba2..93ed633c02 100644 --- a/test/fixtures/harmony/uncategorised/50/expected.json +++ b/test/fixtures/harmony/uncategorised/50/expected.json @@ -1,109 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "arguments": [ - { - "type": "ArrowFunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -113,5 +11,175 @@ "line": 1, "column": 17 } + }, + "range": [ + 0, + 17 + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "expression": { + "type": "CallExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "callee": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "name": "foo" + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 4, + 16 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "x" + }, + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "y" + } + ], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 14, + 16 + ], + "body": [] + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/51/expected.json b/test/fixtures/harmony/uncategorised/51/expected.json index 0b06a3f37a..6e86eaf1c7 100644 --- a/test/fixtures/harmony/uncategorised/51/expected.json +++ b/test/fixtures/harmony/uncategorised/51/expected.json @@ -1,5 +1,7 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -10,21 +12,34 @@ "column": 12 } }, - "body": [ - { - "type": "ExpressionStatement", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } + "range": [ + 0, + 12 + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "expression": { - "type": "ArrowFunctionExpression", + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -35,55 +50,97 @@ "column": 12 } }, - "id": null, - "params": [ - { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - }, - "name": "a" - }, - { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "name": "a" - } + "range": [ + 0, + 12 ], - "generator": false, - "body": { - "type": "Literal", + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, - "column": 10 + "column": 0 }, "end": { "line": 1, "column": 12 } }, - "value": 42, - "raw": "42" - }, - "expression": true + "range": [ + 0, + 12 + ], + "id": null, + "generator": false, + "expression": true, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 4, + 5 + ], + "name": "a" + } + ], + "body": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 10, + 12 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/52/expected.json b/test/fixtures/harmony/uncategorised/52/expected.json index 99029cb8ca..33eaaa3c07 100644 --- a/test/fixtures/harmony/uncategorised/52/expected.json +++ b/test/fixtures/harmony/uncategorised/52/expected.json @@ -1,125 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "method", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], + "type": "File", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, @@ -129,5 +11,197 @@ "line": 1, "column": 20 } + }, + "range": [ + 0, + 20 + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 4, + 20 + ], + "properties": [ + { + "type": "Property", + "start": 6, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 6, + 18 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 6, + 12 + ], + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 12, + 18 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 15, + 18 + ], + "body": [] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/53/expected.json b/test/fixtures/harmony/uncategorised/53/expected.json index 051a6de5cb..581d5f6e96 100644 --- a/test/fixtures/harmony/uncategorised/53/expected.json +++ b/test/fixtures/harmony/uncategorised/53/expected.json @@ -1,140 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "method", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [ - { - "type": "Identifier", - "name": "test", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], + "type": "File", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, @@ -144,5 +11,218 @@ "line": 1, "column": 24 } + }, + "range": [ + 0, + 24 + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 4, + 24 + ], + "properties": [ + { + "type": "Property", + "start": 6, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 6, + 22 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 6, + 12 + ], + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 12, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 12, + 22 + ], + "id": null, + "generator": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 13, + 17 + ], + "name": "test" + } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 19, + 22 + ], + "body": [] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/54/expected.json b/test/fixtures/harmony/uncategorised/54/expected.json index 916b2cf325..21acd849fa 100644 --- a/test/fixtures/harmony/uncategorised/54/expected.json +++ b/test/fixtures/harmony/uncategorised/54/expected.json @@ -1,126 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Literal", - "value": "method", - "raw": "'method'", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -130,5 +11,199 @@ "line": 1, "column": 22 } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 4, + 22 + ], + "properties": [ + { + "type": "Property", + "start": 6, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 6, + 20 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Literal", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 6, + 14 + ], + "value": "method", + "rawValue": "method", + "raw": "'method'" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 14, + 20 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 17, + 20 + ], + "body": [] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/55/expected.json b/test/fixtures/harmony/uncategorised/55/expected.json index afb5b1cea6..326e97db80 100644 --- a/test/fixtures/harmony/uncategorised/55/expected.json +++ b/test/fixtures/harmony/uncategorised/55/expected.json @@ -1,125 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -129,5 +11,197 @@ "line": 1, "column": 17 } + }, + "range": [ + 0, + 17 + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 4, + 17 + ], + "properties": [ + { + "type": "Property", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 6, + 15 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "name": "get" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 9, + 15 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 12, + 15 + ], + "body": [] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/56/expected.json b/test/fixtures/harmony/uncategorised/56/expected.json index 418a4a592d..4c48bca991 100644 --- a/test/fixtures/harmony/uncategorised/56/expected.json +++ b/test/fixtures/harmony/uncategorised/56/expected.json @@ -1,125 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "set", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "value": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "kind": "init", - "method": true, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -129,5 +11,197 @@ "line": 1, "column": 17 } + }, + "range": [ + 0, + 17 + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 4, + 17 + ], + "properties": [ + { + "type": "Property", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 6, + 15 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "name": "set" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 9, + 15 + ], + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 12, + 15 + ], + "body": [] + } + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/57/expected.json b/test/fixtures/harmony/uncategorised/57/expected.json index de6dd75b03..e129175314 100644 --- a/test/fixtures/harmony/uncategorised/57/expected.json +++ b/test/fixtures/harmony/uncategorised/57/expected.json @@ -1,92 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ComprehensionExpression", - "filter": null, - "blocks": [ - { - "type": "ComprehensionBlock", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "right": { - "type": "Identifier", - "name": "array", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], - "body": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "generator": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], + "type": "File", + "start": 0, + "end": 20, "loc": { "start": { "line": 1, @@ -96,5 +11,152 @@ "line": 1, "column": 20 } + }, + "range": [ + 0, + 20 + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "expression": { + "type": "ComprehensionExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 0, + 20 + ], + "blocks": [ + { + "type": "ComprehensionBlock", + "start": 1, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 1, + 17 + ], + "left": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "x" + }, + "right": { + "type": "Identifier", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 11, + 16 + ], + "name": "array" + } + } + ], + "filter": null, + "body": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ], + "name": "x" + }, + "generator": false + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/58/expected.json b/test/fixtures/harmony/uncategorised/58/expected.json index 08f416fd5d..ed807dd064 100644 --- a/test/fixtures/harmony/uncategorised/58/expected.json +++ b/test/fixtures/harmony/uncategorised/58/expected.json @@ -1,174 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ComprehensionExpression", - "filter": { - "type": "BinaryExpression", - "operator": "===", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "right": { - "type": "Identifier", - "name": "test", - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - "blocks": [ - { - "type": "ComprehensionBlock", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "right": { - "type": "Identifier", - "name": "array", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - { - "type": "ComprehensionBlock", - "left": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "right": { - "type": "Identifier", - "name": "array2", - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "body": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 53 - } - } - }, - "generator": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - } - } - ], + "type": "File", + "start": 0, + "end": 54, "loc": { "start": { "line": 1, @@ -178,5 +11,270 @@ "line": 1, "column": 54 } + }, + "range": [ + 0, + 54 + ], + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 0, + 54 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 0, + 54 + ], + "expression": { + "type": "ComprehensionExpression", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 0, + 54 + ], + "blocks": [ + { + "type": "ComprehensionBlock", + "start": 1, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 1, + 17 + ], + "left": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "x" + }, + "right": { + "type": "Identifier", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 11, + 16 + ], + "name": "array" + } + }, + { + "type": "ComprehensionBlock", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 18, + 35 + ], + "left": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 23, + 24 + ], + "name": "y" + }, + "right": { + "type": "Identifier", + "start": 28, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 28, + 34 + ], + "name": "array2" + } + } + ], + "filter": { + "type": "BinaryExpression", + "start": 40, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 40, + 50 + ], + "left": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 40, + 41 + ], + "name": "x" + }, + "operator": "===", + "right": { + "type": "Identifier", + "start": 46, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 46, + 50 + ], + "name": "test" + } + }, + "body": { + "type": "Identifier", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 52, + 53 + ], + "name": "x" + }, + "generator": false + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/59/expected.json b/test/fixtures/harmony/uncategorised/59/expected.json index 6bdef76d20..e97ed0e7c0 100644 --- a/test/fixtures/harmony/uncategorised/59/expected.json +++ b/test/fixtures/harmony/uncategorised/59/expected.json @@ -1,174 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ComprehensionExpression", - "filter": { - "type": "BinaryExpression", - "operator": "===", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "right": { - "type": "Identifier", - "name": "test", - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 50 - } - } - }, - "blocks": [ - { - "type": "ComprehensionBlock", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "right": { - "type": "Identifier", - "name": "array", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - { - "type": "ComprehensionBlock", - "left": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "right": { - "type": "Identifier", - "name": "array2", - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "body": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 53 - } - } - }, - "generator": true, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - } - } - ], + "type": "File", + "start": 0, + "end": 54, "loc": { "start": { "line": 1, @@ -178,5 +11,270 @@ "line": 1, "column": 54 } + }, + "range": [ + 0, + 54 + ], + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 0, + 54 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 0, + 54 + ], + "expression": { + "type": "ComprehensionExpression", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 0, + 54 + ], + "blocks": [ + { + "type": "ComprehensionBlock", + "start": 1, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 1, + 17 + ], + "left": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "x" + }, + "right": { + "type": "Identifier", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 11, + 16 + ], + "name": "array" + } + }, + { + "type": "ComprehensionBlock", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 18, + 35 + ], + "left": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 23, + 24 + ], + "name": "y" + }, + "right": { + "type": "Identifier", + "start": 28, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 28, + 34 + ], + "name": "array2" + } + } + ], + "filter": { + "type": "BinaryExpression", + "start": 40, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 40, + 50 + ], + "left": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 40, + 41 + ], + "name": "x" + }, + "operator": "===", + "right": { + "type": "Identifier", + "start": 46, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 46, + 50 + ], + "name": "test" + } + }, + "body": { + "type": "Identifier", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 52, + 53 + ], + "name": "x" + }, + "generator": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/6/expected.json b/test/fixtures/harmony/uncategorised/6/expected.json index 6c5c7c6aa1..36e50d9f58 100644 --- a/test/fixtures/harmony/uncategorised/6/expected.json +++ b/test/fixtures/harmony/uncategorised/6/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 2, - "raw": "0o2", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 3 } + }, + "range": [ + 0, + 3 + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "value": 2, + "rawValue": 2, + "raw": "0o2" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/60/expected.json b/test/fixtures/harmony/uncategorised/60/expected.json index 900de96416..4b98f8cb7f 100644 --- a/test/fixtures/harmony/uncategorised/60/expected.json +++ b/test/fixtures/harmony/uncategorised/60/expected.json @@ -1,296 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ComprehensionExpression", - "filter": null, - "blocks": [ - { - "type": "ComprehensionBlock", - "left": { - "type": "ArrayPattern", - "elements": [ - null, - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "right": { - "type": "Identifier", - "name": "array", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - { - "type": "ComprehensionBlock", - "left": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "start", - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "property": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "value": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - { - "type": "Property", - "key": { - "type": "MemberExpression", - "computed": false, - "object": { - "type": "Identifier", - "name": "start", - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 47 - } - } - }, - "property": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 49 - } - } - }, - "value": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 53 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": true, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 53 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 54 - } - } - }, - "right": { - "type": "Identifier", - "name": "array2", - "loc": { - "start": { - "line": 1, - "column": 58 - }, - "end": { - "line": 1, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 65 - } - } - } - ], - "body": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 66 - }, - "end": { - "line": 1, - "column": 67 - } - } - }, - "generator": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 68 - } - } - } - ], + "type": "File", + "start": 0, + "end": 68, "loc": { "start": { "line": 1, @@ -300,5 +11,440 @@ "line": 1, "column": 68 } + }, + "range": [ + 0, + 68 + ], + "program": { + "type": "Program", + "start": 0, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 68 + } + }, + "range": [ + 0, + 68 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 68 + } + }, + "range": [ + 0, + 68 + ], + "expression": { + "type": "ComprehensionExpression", + "start": 0, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 68 + } + }, + "range": [ + 0, + 68 + ], + "blocks": [ + { + "type": "ComprehensionBlock", + "start": 1, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 1, + 20 + ], + "left": { + "type": "ArrayPattern", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 6, + 10 + ], + "elements": [ + null, + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "x" + } + ] + }, + "right": { + "type": "Identifier", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 14, + 19 + ], + "name": "array" + } + }, + { + "type": "ComprehensionBlock", + "start": 21, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "range": [ + 21, + 65 + ], + "left": { + "type": "ObjectPattern", + "start": 26, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 26, + 54 + ], + "properties": [ + { + "type": "Property", + "start": 27, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 27, + 39 + ], + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "MemberExpression", + "start": 28, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 28, + 35 + ], + "object": { + "type": "Identifier", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 28, + 33 + ], + "name": "start" + }, + "property": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 34, + 35 + ], + "name": "x" + }, + "computed": false + }, + "value": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 38, + 39 + ], + "name": "x" + }, + "kind": "init" + }, + { + "type": "Property", + "start": 41, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 41, + 53 + ], + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "MemberExpression", + "start": 42, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 42, + 49 + ], + "object": { + "type": "Identifier", + "start": 42, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 42, + 47 + ], + "name": "start" + }, + "property": { + "type": "Identifier", + "start": 48, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "range": [ + 48, + 49 + ], + "name": "y" + }, + "computed": false + }, + "value": { + "type": "Identifier", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 52, + 53 + ], + "name": "y" + }, + "kind": "init" + } + ] + }, + "right": { + "type": "Identifier", + "start": 58, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 58 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "range": [ + 58, + 64 + ], + "name": "array2" + } + } + ], + "filter": null, + "body": { + "type": "Identifier", + "start": 66, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 66 + }, + "end": { + "line": 1, + "column": 67 + } + }, + "range": [ + 66, + 67 + ], + "name": "x" + }, + "generator": false + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/61/expected.json b/test/fixtures/harmony/uncategorised/61/expected.json index e7fc76aab9..d08a3bab20 100644 --- a/test/fixtures/harmony/uncategorised/61/expected.json +++ b/test/fixtures/harmony/uncategorised/61/expected.json @@ -1,153 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "value": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "value": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -157,5 +11,237 @@ "line": 1, "column": 12 } + }, + "range": [ + 0, + 12 + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ], + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 4, + 12 + ], + "properties": [ + { + "type": "Property", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "y" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "y" + } + }, + { + "type": "Property", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "z" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "z" + } + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/62/expected.json b/test/fixtures/harmony/uncategorised/62/expected.json index a85a41af2c..4b1af86ae9 100644 --- a/test/fixtures/harmony/uncategorised/62/expected.json +++ b/test/fixtures/harmony/uncategorised/62/expected.json @@ -1,120 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [ - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], + "type": "File", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, @@ -124,5 +11,192 @@ "line": 1, "column": 15 } + }, + "range": [ + 0, + 15 + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 0, + 6 + ], + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 4, + 5 + ], + "name": "b" + } + ] + }, + "right": { + "type": "ArrayExpression", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 9, + 15 + ], + "elements": [ + { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 10, + 11 + ], + "name": "b" + }, + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "a" + } + ] + } + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/63/expected.json b/test/fixtures/harmony/uncategorised/63/expected.json index 20b0bc23a2..7f0d7a7c01 100644 --- a/test/fixtures/harmony/uncategorised/63/expected.json +++ b/test/fixtures/harmony/uncategorised/63/expected.json @@ -1,110 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -114,5 +11,176 @@ "line": 1, "column": 14 } + }, + "range": [ + 0, + 14 + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 6, + 14 + ], + "id": { + "type": "ObjectPattern", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "properties": [ + { + "type": "Property", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "a" + } + } + ] + }, + "init": { + "type": "ObjectExpression", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 12, + 14 + ], + "properties": [] + } + } + ], + "kind": "const" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/64/expected.json b/test/fixtures/harmony/uncategorised/64/expected.json index 93dfcef12d..a4996f3354 100644 --- a/test/fixtures/harmony/uncategorised/64/expected.json +++ b/test/fixtures/harmony/uncategorised/64/expected.json @@ -1,79 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "init": { - "type": "ArrayExpression", - "elements": [], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -83,5 +11,133 @@ "line": 1, "column": 14 } + }, + "range": [ + 0, + 14 + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 6, + 14 + ], + "id": { + "type": "ArrayPattern", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "elements": [ + { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "a" + } + ] + }, + "init": { + "type": "ArrayExpression", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 12, + 14 + ], + "elements": [] + } + } + ], + "kind": "const" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/65/expected.json b/test/fixtures/harmony/uncategorised/65/expected.json index d63506481a..d70c189da7 100644 --- a/test/fixtures/harmony/uncategorised/65/expected.json +++ b/test/fixtures/harmony/uncategorised/65/expected.json @@ -1,110 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -114,5 +11,176 @@ "line": 1, "column": 12 } + }, + "range": [ + 0, + 12 + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 4, + 12 + ], + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "properties": [ + { + "type": "Property", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "a" + } + } + ] + }, + "init": { + "type": "ObjectExpression", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 10, + 12 + ], + "properties": [] + } + } + ], + "kind": "let" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/66/expected.json b/test/fixtures/harmony/uncategorised/66/expected.json index d8a836b1ae..b4895bf1c6 100644 --- a/test/fixtures/harmony/uncategorised/66/expected.json +++ b/test/fixtures/harmony/uncategorised/66/expected.json @@ -1,79 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "init": { - "type": "ArrayExpression", - "elements": [], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -83,5 +11,133 @@ "line": 1, "column": 12 } + }, + "range": [ + 0, + 12 + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 4, + 12 + ], + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "a" + } + ] + }, + "init": { + "type": "ArrayExpression", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 10, + 12 + ], + "elements": [] + } + } + ], + "kind": "let" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/67/expected.json b/test/fixtures/harmony/uncategorised/67/expected.json index f96c3a9e68..e05e2a32aa 100644 --- a/test/fixtures/harmony/uncategorised/67/expected.json +++ b/test/fixtures/harmony/uncategorised/67/expected.json @@ -1,110 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -114,5 +11,176 @@ "line": 1, "column": 12 } + }, + "range": [ + 0, + 12 + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 4, + 12 + ], + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "properties": [ + { + "type": "Property", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "a" + } + } + ] + }, + "init": { + "type": "ObjectExpression", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 10, + 12 + ], + "properties": [] + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/68/expected.json b/test/fixtures/harmony/uncategorised/68/expected.json index dc3229d144..788e3e11ee 100644 --- a/test/fixtures/harmony/uncategorised/68/expected.json +++ b/test/fixtures/harmony/uncategorised/68/expected.json @@ -1,79 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "init": { - "type": "ArrayExpression", - "elements": [], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - } - } - ], + "type": "File", + "start": 0, + "end": 12, "loc": { "start": { "line": 1, @@ -83,5 +11,133 @@ "line": 1, "column": 12 } + }, + "range": [ + 0, + 12 + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 0, + 12 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 4, + 12 + ], + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 4, + 7 + ], + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "a" + } + ] + }, + "init": { + "type": "ArrayExpression", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 10, + 12 + ], + "elements": [] + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/69/expected.json b/test/fixtures/harmony/uncategorised/69/expected.json index 2714e90fe0..1a30aac349 100644 --- a/test/fixtures/harmony/uncategorised/69/expected.json +++ b/test/fixtures/harmony/uncategorised/69/expected.json @@ -1,110 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "value": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], + "type": "File", + "start": 0, + "end": 16, "loc": { "start": { "line": 1, @@ -114,5 +11,176 @@ "line": 1, "column": 16 } + }, + "range": [ + 0, + 16 + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 6, + 16 + ], + "id": { + "type": "ObjectPattern", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 6, + 11 + ], + "properties": [ + { + "type": "Property", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 7, + 10 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "b" + }, + "kind": "init" + } + ] + }, + "init": { + "type": "ObjectExpression", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 14, + 16 + ], + "properties": [] + } + } + ], + "kind": "const" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/7/expected.json b/test/fixtures/harmony/uncategorised/7/expected.json index d1c391a757..026879314b 100644 --- a/test/fixtures/harmony/uncategorised/7/expected.json +++ b/test/fixtures/harmony/uncategorised/7/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 10, - "raw": "0o12", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } - } - ], + "type": "File", + "start": 0, + "end": 4, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 4 } + }, + "range": [ + 0, + 4 + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 0, + 4 + ], + "value": 10, + "rawValue": 10, + "raw": "0o12" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/70/expected.json b/test/fixtures/harmony/uncategorised/70/expected.json index aadd9a7548..987a9652b3 100644 --- a/test/fixtures/harmony/uncategorised/70/expected.json +++ b/test/fixtures/harmony/uncategorised/70/expected.json @@ -1,110 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "value": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -114,5 +11,176 @@ "line": 1, "column": 14 } + }, + "range": [ + 0, + 14 + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 4, + 14 + ], + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 4, + 9 + ], + "properties": [ + { + "type": "Property", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 5, + 8 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "b" + }, + "kind": "init" + } + ] + }, + "init": { + "type": "ObjectExpression", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 12, + 14 + ], + "properties": [] + } + } + ], + "kind": "let" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/71/expected.json b/test/fixtures/harmony/uncategorised/71/expected.json index 0ac840b469..a995dff275 100644 --- a/test/fixtures/harmony/uncategorised/71/expected.json +++ b/test/fixtures/harmony/uncategorised/71/expected.json @@ -1,111 +1,7 @@ { - "type": "Program", - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "value": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "kind": "init", - "method": false, - "shorthand": false, - "computed": false, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], + "type": "File", + "start": 0, + "end": 14, "loc": { "start": { "line": 1, @@ -115,5 +11,176 @@ "line": 1, "column": 14 } + }, + "range": [ + 0, + 14 + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 4, + 14 + ], + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 4, + 9 + ], + "properties": [ + { + "type": "Property", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 5, + 8 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "b" + }, + "kind": "init" + } + ] + }, + "init": { + "type": "ObjectExpression", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 12, + 14 + ], + "properties": [] + } + } + ], + "kind": "var" + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/72/expected.json b/test/fixtures/harmony/uncategorised/72/expected.json index 819831476e..1760b19a1a 100644 --- a/test/fixtures/harmony/uncategorised/72/expected.json +++ b/test/fixtures/harmony/uncategorised/72/expected.json @@ -1,67 +1,7 @@ { - "type": "Program", - "sourceType": "module", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "document", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "specifiers": [], - "source": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], + "type": "File", + "start": 0, + "end": 19, "loc": { "start": { "line": 1, @@ -71,5 +11,114 @@ "line": 1, "column": 19 } + }, + "range": [ + 0, + 19 + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 7, + 19 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 11, + 19 + ], + "id": { + "type": "Identifier", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 11, + 19 + ], + "name": "document" + }, + "init": null + } + ], + "kind": "var" + }, + "specifiers": [], + "source": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/73/expected.json b/test/fixtures/harmony/uncategorised/73/expected.json index f92cd0b0bc..5482472d2e 100644 --- a/test/fixtures/harmony/uncategorised/73/expected.json +++ b/test/fixtures/harmony/uncategorised/73/expected.json @@ -1,79 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "document", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "specifiers": [], - "source": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], + "type": "File", + "start": 0, + "end": 25, "loc": { "start": { "line": 1, @@ -83,5 +11,133 @@ "line": 1, "column": 25 } + }, + "range": [ + 0, + 25 + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 7, + 25 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 11, + 25 + ], + "id": { + "type": "Identifier", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 11, + 19 + ], + "name": "document" + }, + "init": { + "type": "ObjectExpression", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 22, + 25 + ], + "properties": [] + } + } + ], + "kind": "var" + }, + "specifiers": [], + "source": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/74/expected.json b/test/fixtures/harmony/uncategorised/74/expected.json index 5a886112e1..ebb74ce067 100644 --- a/test/fixtures/harmony/uncategorised/74/expected.json +++ b/test/fixtures/harmony/uncategorised/74/expected.json @@ -1,66 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "document", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "specifiers": [], - "source": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - } - } - ], + "type": "File", + "start": 0, + "end": 19, "loc": { "start": { "line": 1, @@ -70,5 +11,114 @@ "line": 1, "column": 19 } + }, + "range": [ + 0, + 19 + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 0, + 19 + ], + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 7, + 19 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 11, + 19 + ], + "id": { + "type": "Identifier", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 11, + 19 + ], + "name": "document" + }, + "init": null + } + ], + "kind": "let" + }, + "specifiers": [], + "source": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/75/expected.json b/test/fixtures/harmony/uncategorised/75/expected.json index fc03be0c42..a5dc64c354 100644 --- a/test/fixtures/harmony/uncategorised/75/expected.json +++ b/test/fixtures/harmony/uncategorised/75/expected.json @@ -1,79 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "document", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "specifiers": [], - "source": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], + "type": "File", + "start": 0, + "end": 25, "loc": { "start": { "line": 1, @@ -83,5 +11,133 @@ "line": 1, "column": 25 } + }, + "range": [ + 0, + 25 + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 7, + 25 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 11, + 25 + ], + "id": { + "type": "Identifier", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 11, + 19 + ], + "name": "document" + }, + "init": { + "type": "ObjectExpression", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 22, + 25 + ], + "properties": [] + } + } + ], + "kind": "let" + }, + "specifiers": [], + "source": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/76/expected.json b/test/fixtures/harmony/uncategorised/76/expected.json index 0012278aef..fa85f190d6 100644 --- a/test/fixtures/harmony/uncategorised/76/expected.json +++ b/test/fixtures/harmony/uncategorised/76/expected.json @@ -1,79 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "document", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "specifiers": [], - "source": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], + "type": "File", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -83,5 +11,133 @@ "line": 1, "column": 27 } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 7, + 27 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 13, + 27 + ], + "id": { + "type": "Identifier", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 13, + 21 + ], + "name": "document" + }, + "init": { + "type": "ObjectExpression", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 24, + 27 + ], + "properties": [] + } + } + ], + "kind": "const" + }, + "specifiers": [], + "source": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/77/expected.json b/test/fixtures/harmony/uncategorised/77/expected.json index 00af01e92f..08ead5dfb6 100644 --- a/test/fixtures/harmony/uncategorised/77/expected.json +++ b/test/fixtures/harmony/uncategorised/77/expected.json @@ -1,66 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "parse", - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "specifiers": [], - "source": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], + "type": "File", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -70,5 +11,114 @@ "line": 1, "column": 27 } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "declaration": { + "type": "FunctionDeclaration", + "start": 7, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 7, + 27 + ], + "id": { + "type": "Identifier", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 16, + 21 + ], + "name": "parse" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 24, + 27 + ], + "body": [] + } + }, + "specifiers": [], + "source": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/78/expected.json b/test/fixtures/harmony/uncategorised/78/expected.json index b63f5761b8..d7ccae912d 100644 --- a/test/fixtures/harmony/uncategorised/78/expected.json +++ b/test/fixtures/harmony/uncategorised/78/expected.json @@ -1,64 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "ClassDeclaration", - "id": { - "type": "Identifier", - "name": "Class", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "superClass": null, - "body": { - "type": "ClassBody", - "body": [], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "specifiers": [], - "source": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], + "type": "File", + "start": 0, + "end": 21, "loc": { "start": { "line": 1, @@ -68,5 +11,112 @@ "line": 1, "column": 21 } + }, + "range": [ + 0, + 21 + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 0, + 21 + ], + "declaration": { + "type": "ClassDeclaration", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 7, + 21 + ], + "id": { + "type": "Identifier", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 13, + 18 + ], + "name": "Class" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 19, + 21 + ], + "body": [] + } + }, + "specifiers": [], + "source": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/79/expected.json b/test/fixtures/harmony/uncategorised/79/expected.json index b197cd45e6..17d0e7875c 100644 --- a/test/fixtures/harmony/uncategorised/79/expected.json +++ b/test/fixtures/harmony/uncategorised/79/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExportDefaultDeclaration", - "declaration": { - "type": "Literal", - "value": 42, - "raw": "42", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - ], + "type": "File", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 17 } + }, + "range": [ + 0, + 17 + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "declaration": { + "type": "Literal", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 15, + 17 + ], + "value": 42, + "rawValue": 42, + "raw": "42" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/8/expected.json b/test/fixtures/harmony/uncategorised/8/expected.json index 7cbc677bfd..13c0f9b64c 100644 --- a/test/fixtures/harmony/uncategorised/8/expected.json +++ b/test/fixtures/harmony/uncategorised/8/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 0, - "raw": "0O0", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - } - ], + "type": "File", + "start": 0, + "end": 3, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 3 } + }, + "range": [ + 0, + 3 + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "expression": { + "type": "Literal", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "value": 0, + "rawValue": 0, + "raw": "0O0" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/80/expected.json b/test/fixtures/harmony/uncategorised/80/expected.json index c57785894e..94f712c781 100644 --- a/test/fixtures/harmony/uncategorised/80/expected.json +++ b/test/fixtures/harmony/uncategorised/80/expected.json @@ -1,35 +1,103 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, "range": [ 0, 29 ], - "body": [ - { - "type": "ExportDefaultDeclaration", - "range": [ - 0, - 29 - ], - "declaration": { - "type": "FunctionExpression", + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, "range": [ - 15, + 0, 29 ], - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", + "declaration": { + "type": "FunctionExpression", + "start": 15, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 29 + } + }, "range": [ - 27, + 15, 29 ], - "body": [] + "id": null, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 27, + 29 + ], + "body": [] + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/81/expected.json b/test/fixtures/harmony/uncategorised/81/expected.json index 0ff23f61fd..f353245d66 100644 --- a/test/fixtures/harmony/uncategorised/81/expected.json +++ b/test/fixtures/harmony/uncategorised/81/expected.json @@ -1,42 +1,122 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, "range": [ 0, 30 ], - "body": [ - { - "type": "ExportDefaultDeclaration", - "range": [ - 0, - 30 - ], - "declaration": { - "type": "FunctionDeclaration", + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, "range": [ - 15, + 0, 30 ], - "id": { - "type": "Identifier", + "declaration": { + "type": "FunctionDeclaration", + "start": 15, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 30 + } + }, "range": [ - 24, - 25 - ], - "name": "f" - }, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "range": [ - 28, + 15, 30 ], - "body": [] + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 24, + 25 + ], + "name": "f" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 28, + 30 + ], + "body": [] + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/82/expected.json b/test/fixtures/harmony/uncategorised/82/expected.json index 4794d01fec..8d916c0821 100644 --- a/test/fixtures/harmony/uncategorised/82/expected.json +++ b/test/fixtures/harmony/uncategorised/82/expected.json @@ -1,33 +1,101 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, "range": [ 0, 23 ], - "body": [ - { - "type": "ExportDefaultDeclaration", - "range": [ - 0, - 23 - ], - "declaration": { - "type": "ClassExpression", + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 0, + 23 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, "range": [ - 15, + 0, 23 ], - "id": null, - "superClass": null, - "body": { - "type": "ClassBody", + "declaration": { + "type": "ClassExpression", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, "range": [ - 21, + 15, 23 ], - "body": [] + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 21, + 23 + ], + "body": [] + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/83/expected.json b/test/fixtures/harmony/uncategorised/83/expected.json index 8a8d7d932e..294ef4841d 100644 --- a/test/fixtures/harmony/uncategorised/83/expected.json +++ b/test/fixtures/harmony/uncategorised/83/expected.json @@ -1,40 +1,120 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, "range": [ 0, 25 ], - "body": [ - { - "type": "ExportDefaultDeclaration", - "range": [ - 0, - 25 - ], - "declaration": { - "type": "ClassDeclaration", + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, "range": [ - 15, + 0, 25 ], - "id": { - "type": "Identifier", + "declaration": { + "type": "ClassDeclaration", + "start": 15, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 25 + } + }, "range": [ - 21, - 22 - ], - "name": "A" - }, - "superClass": null, - "body": { - "type": "ClassBody", - "range": [ - 23, + 15, 25 ], - "body": [] + "id": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 23, + 25 + ], + "body": [] + } } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/85/expected.json b/test/fixtures/harmony/uncategorised/85/expected.json index ffd2612a40..ab4cf68452 100644 --- a/test/fixtures/harmony/uncategorised/85/expected.json +++ b/test/fixtures/harmony/uncategorised/85/expected.json @@ -1,35 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExportAllDeclaration", - "source": { - "type": "Literal", - "value": "crypto", - "raw": "\"crypto\"", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -39,5 +11,72 @@ "line": 1, "column": 22 } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportAllDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "source": { + "type": "Literal", + "start": 14, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 14, + 22 + ], + "value": "crypto", + "rawValue": "crypto", + "raw": "\"crypto\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/86/expected.json b/test/fixtures/harmony/uncategorised/86/expected.json index fb37ff6dac..94a6d70a3f 100644 --- a/test/fixtures/harmony/uncategorised/86/expected.json +++ b/test/fixtures/harmony/uncategorised/86/expected.json @@ -1,65 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "exported": { - "type": "Identifier", - "name": "encrypt", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "local": { - "type": "Identifier", - "name": "encrypt", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "source": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], + "type": "File", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -69,5 +11,113 @@ "line": 1, "column": 18 } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "local": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "name": "encrypt" + }, + "exported": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "name": "encrypt" + } + } + ], + "source": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/87/expected.json b/test/fixtures/harmony/uncategorised/87/expected.json index 38ab70f338..de54e8aee6 100644 --- a/test/fixtures/harmony/uncategorised/87/expected.json +++ b/test/fixtures/harmony/uncategorised/87/expected.json @@ -1,106 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "exported": { - "type": "Identifier", - "name": "encrypt", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "local": { - "type": "Identifier", - "name": "encrypt", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "ExportSpecifier", - "exported": { - "type": "Identifier", - "name": "decrypt", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "local": { - "type": "Identifier", - "name": "decrypt", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], - "source": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], + "type": "File", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -110,5 +11,172 @@ "line": 1, "column": 27 } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "local": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "name": "encrypt" + }, + "exported": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "name": "encrypt" + } + }, + { + "type": "ExportSpecifier", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 18, + 25 + ], + "local": { + "type": "Identifier", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 18, + 25 + ], + "name": "decrypt" + }, + "exported": { + "type": "Identifier", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 18, + 25 + ], + "name": "decrypt" + } + } + ], + "source": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/88/expected.json b/test/fixtures/harmony/uncategorised/88/expected.json index 47ade7045b..e3b884a1b1 100644 --- a/test/fixtures/harmony/uncategorised/88/expected.json +++ b/test/fixtures/harmony/uncategorised/88/expected.json @@ -1,65 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "exported": { - "type": "Identifier", - "name": "default", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "local": { - "type": "Identifier", - "name": "encrypt", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 27 - } - } - } - ], - "source": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - } - } - ], + "type": "File", + "start": 0, + "end": 29, "loc": { "start": { "line": 1, @@ -69,5 +11,113 @@ "line": 1, "column": 29 } + }, + "range": [ + 0, + 29 + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 0, + 29 + ], + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 9, + 27 + ], + "local": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "name": "encrypt" + }, + "exported": { + "type": "Identifier", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 20, + 27 + ], + "name": "default" + } + } + ], + "source": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/89/expected.json b/test/fixtures/harmony/uncategorised/89/expected.json index 6e24a6566b..0fa564d7e3 100644 --- a/test/fixtures/harmony/uncategorised/89/expected.json +++ b/test/fixtures/harmony/uncategorised/89/expected.json @@ -1,106 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "exported": { - "type": "Identifier", - "name": "encrypt", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "local": { - "type": "Identifier", - "name": "encrypt", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "ExportSpecifier", - "exported": { - "type": "Identifier", - "name": "dec", - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "local": { - "type": "Identifier", - "name": "decrypt", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "source": null, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - } - } - ], + "type": "File", + "start": 0, + "end": 34, "loc": { "start": { "line": 1, @@ -110,5 +11,172 @@ "line": 1, "column": 34 } + }, + "range": [ + 0, + 34 + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 0, + 34 + ], + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "local": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "name": "encrypt" + }, + "exported": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "name": "encrypt" + } + }, + { + "type": "ExportSpecifier", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 18, + 32 + ], + "local": { + "type": "Identifier", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 18, + 25 + ], + "name": "decrypt" + }, + "exported": { + "type": "Identifier", + "start": 29, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 29, + 32 + ], + "name": "dec" + } + } + ], + "source": null + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/9/expected.json b/test/fixtures/harmony/uncategorised/9/expected.json index 7cc180913d..08e0fb85df 100644 --- a/test/fixtures/harmony/uncategorised/9/expected.json +++ b/test/fixtures/harmony/uncategorised/9/expected.json @@ -1,108 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "FunctionDeclaration", - "id": { - "type": "Identifier", - "name": "test", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": "use strict", - "raw": "'use strict'", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Literal", - "value": 0, - "raw": "0O0", - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 37 - } - } - }, - "generator": false, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - } - } - ], + "type": "File", + "start": 0, + "end": 37, "loc": { "start": { "line": 1, @@ -112,5 +11,176 @@ "line": 1, "column": 37 } + }, + "range": [ + 0, + 37 + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 0, + 37 + ], + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 0, + 37 + ], + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 9, + 13 + ], + "name": "test" + }, + "generator": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 16, + 37 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 17, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 17, + 30 + ], + "expression": { + "type": "Literal", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 17, + 29 + ], + "value": "use strict", + "rawValue": "use strict", + "raw": "'use strict'" + } + }, + { + "type": "ExpressionStatement", + "start": 31, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 31, + 35 + ], + "expression": { + "type": "Literal", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 31, + 34 + ], + "value": 0, + "rawValue": 0, + "raw": "0O0" + } + } + ] + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/90/expected.json b/test/fixtures/harmony/uncategorised/90/expected.json index 87ff74b4fb..e610050078 100644 --- a/test/fixtures/harmony/uncategorised/90/expected.json +++ b/test/fixtures/harmony/uncategorised/90/expected.json @@ -1,79 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "exported": { - "type": "Identifier", - "name": "default", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "local": { - "type": "Identifier", - "name": "default", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - } - ], - "source": { - "type": "Literal", - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "value": "other", - "raw": "\"other\"" - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - } - } - ], + "type": "File", + "start": 0, + "end": 31, "loc": { "start": { "line": 1, @@ -83,5 +11,134 @@ "line": 1, "column": 31 } + }, + "range": [ + 0, + 31 + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "local": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "name": "default" + }, + "exported": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "name": "default" + } + } + ], + "source": { + "type": "Literal", + "start": 24, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 24, + 31 + ], + "value": "other", + "rawValue": "other", + "raw": "\"other\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/91/expected.json b/test/fixtures/harmony/uncategorised/91/expected.json index 7fd80220c3..dcd070bc87 100644 --- a/test/fixtures/harmony/uncategorised/91/expected.json +++ b/test/fixtures/harmony/uncategorised/91/expected.json @@ -1,36 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [], - "source": { - "type": "Literal", - "value": "jquery", - "raw": "\"jquery\"", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], + "type": "File", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, @@ -40,5 +11,73 @@ "line": 1, "column": 15 } + }, + "range": [ + 0, + 15 + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "specifiers": [], + "source": { + "type": "Literal", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 7, + 15 + ], + "value": "jquery", + "rawValue": "jquery", + "raw": "\"jquery\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/92/expected.json b/test/fixtures/harmony/uncategorised/92/expected.json index 0d1e4fd2f9..fb2f970fc3 100644 --- a/test/fixtures/harmony/uncategorised/92/expected.json +++ b/test/fixtures/harmony/uncategorised/92/expected.json @@ -1,64 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "$", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "source": { - "type": "Literal", - "value": "jquery", - "raw": "\"jquery\"", - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], + "type": "File", + "start": 0, + "end": 22, "loc": { "start": { "line": 1, @@ -68,5 +11,113 @@ "line": 1, "column": 22 } + }, + "range": [ + 0, + 22 + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "local": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "$" + } + } + ], + "source": { + "type": "Literal", + "start": 14, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 14, + 22 + ], + "value": "jquery", + "rawValue": "jquery", + "raw": "\"jquery\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/93/expected.json b/test/fixtures/harmony/uncategorised/93/expected.json index 42e6cf44c7..64fc49f073 100644 --- a/test/fixtures/harmony/uncategorised/93/expected.json +++ b/test/fixtures/harmony/uncategorised/93/expected.json @@ -1,119 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [ - { - "type": "ImportSpecifier", - "imported": { - "type": "Identifier", - "name": "encrypt", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "local": { - "type": "Identifier", - "name": "encrypt", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "ImportSpecifier", - "imported": { - "type": "Identifier", - "name": "decrypt", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "local": { - "type": "Identifier", - "name": "decrypt", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - ], - "source": { - "type": "Literal", - "value": "crypto", - "raw": "\"crypto\"", - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 41 - } - } - } - ], + "type": "File", + "start": 0, + "end": 41, "loc": { "start": { "line": 1, @@ -123,5 +11,192 @@ "line": 1, "column": 41 } + }, + "range": [ + 0, + 41 + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "imported": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "name": "encrypt" + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "name": "encrypt" + } + }, + { + "type": "ImportSpecifier", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 18, + 25 + ], + "imported": { + "type": "Identifier", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 18, + 25 + ], + "name": "decrypt" + }, + "local": { + "type": "Identifier", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 18, + 25 + ], + "name": "decrypt" + } + } + ], + "source": { + "type": "Literal", + "start": 33, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 33, + 41 + ], + "value": "crypto", + "rawValue": "crypto", + "raw": "\"crypto\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/94/expected.json b/test/fixtures/harmony/uncategorised/94/expected.json index 6eccae6e66..d138ea595f 100644 --- a/test/fixtures/harmony/uncategorised/94/expected.json +++ b/test/fixtures/harmony/uncategorised/94/expected.json @@ -1,78 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [ - { - "type": "ImportSpecifier", - "imported": { - "type": "Identifier", - "name": "encrypt", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - "local": { - "type": "Identifier", - "name": "enc", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], - "source": { - "type": "Literal", - "value": "crypto", - "raw": "\"crypto\"", - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 39 - } - } - } - ], + "type": "File", + "start": 0, + "end": 39, "loc": { "start": { "line": 1, @@ -82,5 +11,133 @@ "line": 1, "column": 39 } + }, + "range": [ + 0, + 39 + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 0, + 39 + ], + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 9, + 23 + ], + "imported": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 9, + 16 + ], + "name": "encrypt" + }, + "local": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 20, + 23 + ], + "name": "enc" + } + } + ], + "source": { + "type": "Literal", + "start": 31, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 31, + 39 + ], + "value": "crypto", + "rawValue": "crypto", + "raw": "\"crypto\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/95/expected.json b/test/fixtures/harmony/uncategorised/95/expected.json index db48a2eb34..1d3bde55e3 100644 --- a/test/fixtures/harmony/uncategorised/95/expected.json +++ b/test/fixtures/harmony/uncategorised/95/expected.json @@ -1,5 +1,7 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 56, "loc": { "start": { "line": 1, @@ -10,34 +12,53 @@ "column": 56 } }, - "body": [ - { - "type": "ImportDeclaration", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } + "range": [ + 0, + 56 + ], + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } + "end": { + "line": 1, + "column": 56 + } + }, + "range": [ + 0, + 56 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "local": { - "type": "Identifier", + "end": { + "line": 1, + "column": 56 + } + }, + "range": [ + 0, + 56 + ], + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 7, + "end": 13, "loc": { "start": { "line": 1, @@ -48,23 +69,35 @@ "column": 13 } }, - "name": "crypto" - } - }, - { - "type": "ImportSpecifier", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 + "range": [ + 7, + 13 + ], + "local": { + "type": "Identifier", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 7, + 13 + ], + "name": "crypto" } }, - "imported": { - "type": "Identifier", + { + "type": "ImportSpecifier", + "start": 17, + "end": 24, "loc": { "start": { "line": 1, @@ -75,80 +108,134 @@ "column": 24 } }, - "name": "decrypt" - }, - "local": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 17 + "range": [ + 17, + 24 + ], + "imported": { + "type": "Identifier", + "start": 17, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 24 + } }, - "end": { - "line": 1, - "column": 24 - } + "range": [ + 17, + 24 + ], + "name": "decrypt" }, - "name": "decrypt" - } - }, - { - "type": "ImportSpecifier", - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 40 + "local": { + "type": "Identifier", + "start": 17, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 17, + 24 + ], + "name": "decrypt" } }, - "imported": { - "type": "Identifier", + { + "type": "ImportSpecifier", + "start": 26, + "end": 40, "loc": { "start": { "line": 1, "column": 26 }, - "end": { - "line": 1, - "column": 33 - } - }, - "name": "encrypt" - }, - "local": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 37 - }, "end": { "line": 1, "column": 40 } }, - "name": "enc" + "range": [ + 26, + 40 + ], + "imported": { + "type": "Identifier", + "start": 26, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 26, + 33 + ], + "name": "encrypt" + }, + "local": { + "type": "Identifier", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 37, + 40 + ], + "name": "enc" + } } - } - ], - "source": { - "type": "Literal", - "loc": { - "start": { - "line": 1, - "column": 48 + ], + "source": { + "type": "Literal", + "start": 48, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 56 + } }, - "end": { - "line": 1, - "column": 56 - } - }, - "value": "crypto", - "raw": "\"crypto\"" + "range": [ + 48, + 56 + ], + "value": "crypto", + "rawValue": "crypto", + "raw": "\"crypto\"" + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/97/expected.json b/test/fixtures/harmony/uncategorised/97/expected.json index 169d805b74..41b4cd8db8 100644 --- a/test/fixtures/harmony/uncategorised/97/expected.json +++ b/test/fixtures/harmony/uncategorised/97/expected.json @@ -1,78 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ImportDeclaration", - "specifiers": [ - { - "type": "ImportSpecifier", - "imported": { - "type": "Identifier", - "name": "null", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "local": { - "type": "Identifier", - "name": "nil", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 20 - } - } - } - ], - "source": { - "type": "Literal", - "value": "bar", - "raw": "\"bar\"", - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - } - } - ], + "type": "File", + "start": 0, + "end": 33, "loc": { "start": { "line": 1, @@ -82,5 +11,133 @@ "line": 1, "column": 33 } + }, + "range": [ + 0, + 33 + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 0, + 33 + ], + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 9, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 9, + 20 + ], + "imported": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 9, + 13 + ], + "name": "null" + }, + "local": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 17, + 20 + ], + "name": "nil" + } + } + ], + "source": { + "type": "Literal", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "range": [ + 28, + 33 + ], + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/98/expected.json b/test/fixtures/harmony/uncategorised/98/expected.json index e2d42e104c..3699f973b8 100644 --- a/test/fixtures/harmony/uncategorised/98/expected.json +++ b/test/fixtures/harmony/uncategorised/98/expected.json @@ -1,5 +1,7 @@ { - "type": "Program", + "type": "File", + "start": 0, + "end": 32, "loc": { "start": { "line": 1, @@ -10,63 +12,112 @@ "column": 32 } }, - "body": [ - { - "type": "ImportDeclaration", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } + "range": [ + 0, + 32 + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "local": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "name": "crypto" - } - } - ], - "source": { - "type": "Literal", + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 0, + 32 + ], + "sourceType": "module", + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 32, "loc": { "start": { "line": 1, - "column": 24 + "column": 0 }, "end": { "line": 1, "column": 32 } }, - "value": "crypto", - "raw": "\"crypto\"" + "range": [ + 0, + 32 + ], + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "start": 7, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 7, + 18 + ], + "local": { + "type": "Identifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 12, + 18 + ], + "name": "crypto" + } + } + ], + "source": { + "type": "Literal", + "start": 24, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 24, + 32 + ], + "value": "crypto", + "rawValue": "crypto", + "raw": "\"crypto\"" + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/harmony/uncategorised/99/expected.json b/test/fixtures/harmony/uncategorised/99/expected.json index 1d7d38a5e9..8782aac7a5 100644 --- a/test/fixtures/harmony/uncategorised/99/expected.json +++ b/test/fixtures/harmony/uncategorised/99/expected.json @@ -1,93 +1,7 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "FunctionExpression", - "id": null, - "params": [], - "body": { - "type": "BlockStatement", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "YieldExpression", - "argument": { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "delegate": false, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "generator": true, - "expression": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - } - } - ], + "type": "File", + "start": 0, + "end": 26, "loc": { "start": { "line": 1, @@ -97,5 +11,154 @@ "line": 1, "column": 26 } + }, + "range": [ + 0, + 26 + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "sourceType": "module", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 0, + 26 + ], + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 1, + 25 + ], + "id": null, + "generator": true, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 14, + 25 + ], + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 16, + 23 + ], + "expression": { + "type": "YieldExpression", + "start": 16, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 16, + 23 + ], + "delegate": false, + "argument": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ], + "name": "v" + } + } + } + ] + }, + "parenthesizedExpression": true + } + } + ] } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/1/expected.json b/test/fixtures/jsx/basic/1/expected.json index 5dfc8a122b..3a2193a81c 100644 --- a/test/fixtures/jsx/basic/1/expected.json +++ b/test/fixtures/jsx/basic/1/expected.json @@ -1,53 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 1, - 2 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "selfClosing": true, - "attributes": [], - "range": [ - 0, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "closingElement": null, - "children": [], - "range": [ - 0, - 5 - ], + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -57,22 +49,74 @@ "line": 1, "column": 5 } - } - }, - "range": [ - 0, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 5 + "range": [ + 0, + 5 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/10/expected.json b/test/fixtures/jsx/basic/10/expected.json index 6268763d8d..98f937273f 100644 --- a/test/fixtures/jsx/basic/10/expected.json +++ b/test/fixtures/jsx/basic/10/expected.json @@ -1,122 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 1, - 2 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "selfClosing": false, - "attributes": [], - "range": [ - 0, - 3 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "closingElement": { - "type": "JSXClosingElement", - "name": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 30, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "range": [ - 28, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "children": [ - { - "type": "JSXExpressionContainer", - "expression": { - "type": "JSXEmptyExpression", - "range": [ - 4, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "range": [ - 3, - 28 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 28 - } - } - } - ], - "range": [ - 0, - 32 - ], + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 0, + 32 + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 0, + 32 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, "loc": { "start": { "line": 1, @@ -126,22 +49,197 @@ "line": 1, "column": 32 } - } - }, - "range": [ - 0, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 32 + "range": [ + 0, + 32 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 0, + 32 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 28, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 28, + 32 + ], + "name": { + "type": "JSXIdentifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 30, + 31 + ], + "name": "a", + "leadingComments": null + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " this is a comment ", + "start": 4, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 4, + 27 + ] + } + ] + }, + "children": [ + { + "type": "JSXExpressionContainer", + "start": 3, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 3, + 28 + ], + "expression": { + "type": "JSXEmptyExpression", + "start": 4, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 4, + 27 + ], + "leadingComments": null, + "innerComments": [ + { + "type": "CommentBlock", + "value": " this is a comment ", + "start": 4, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 4, + 27 + ] + } + ] + } + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/11/expected.json b/test/fixtures/jsx/basic/11/expected.json index a6074af1fa..0bac0d881d 100644 --- a/test/fixtures/jsx/basic/11/expected.json +++ b/test/fixtures/jsx/basic/11/expected.json @@ -1,107 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "div", - "range": [ - 1, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "selfClosing": false, - "attributes": [], - "range": [ - 0, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "closingElement": { - "type": "JSXClosingElement", - "name": { - "type": "JSXIdentifier", - "name": "div", - "range": [ - 20, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 18, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "children": [ - { - "type": "Literal", - "value": "@test content", - "raw": "@test content", - "range": [ - 5, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - ], - "range": [ - 0, - 24 - ], + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, "loc": { "start": { "line": 1, @@ -111,22 +49,135 @@ "line": 1, "column": 24 } - } - }, - "range": [ - 0, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 24 + "range": [ + 0, + 24 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 18, + 24 + ], + "name": { + "type": "JSXIdentifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 20, + 23 + ], + "name": "div" + } + }, + "children": [ + { + "type": "Literal", + "start": 5, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 5, + 18 + ], + "value": "@test content", + "rawValue": "@test content", + "raw": "@test content" + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/12/expected.json b/test/fixtures/jsx/basic/12/expected.json index 9a74fe38b5..2b4fa9e4e5 100644 --- a/test/fixtures/jsx/basic/12/expected.json +++ b/test/fixtures/jsx/basic/12/expected.json @@ -1,163 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "div", - "range": [ - 1, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "selfClosing": false, - "attributes": [], - "range": [ - 0, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "closingElement": { - "type": "JSXClosingElement", - "name": { - "type": "JSXIdentifier", - "name": "div", - "range": [ - 37, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "range": [ - 35, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - } - }, - "children": [ - { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "br", - "range": [ - 6, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "selfClosing": true, - "attributes": [], - "range": [ - 5, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "closingElement": null, - "children": [], - "range": [ - 5, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - { - "type": "Literal", - "value": "7x invalid-js-identifier", - "raw": "7x invalid-js-identifier", - "range": [ - 11, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 35 - } - } - } - ], - "range": [ - 0, - 41 - ], + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 41, "loc": { "start": { "line": 1, @@ -167,22 +49,197 @@ "line": 1, "column": 41 } - } - }, - "range": [ - 0, - 41 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 41 + "range": [ + 0, + 41 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 0, + 41 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 35, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 35, + 41 + ], + "name": { + "type": "JSXIdentifier", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 37, + 40 + ], + "name": "div" + } + }, + "children": [ + { + "type": "JSXElement", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 5, + 11 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 5, + 11 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 6, + 8 + ], + "name": "br" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] + }, + { + "type": "Literal", + "start": 11, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 11, + 35 + ], + "value": "7x invalid-js-identifier", + "rawValue": "7x invalid-js-identifier", + "raw": "7x invalid-js-identifier" + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/13/expected.json b/test/fixtures/jsx/basic/13/expected.json index 6459ca9d13..82d3b9b378 100644 --- a/test/fixtures/jsx/basic/13/expected.json +++ b/test/fixtures/jsx/basic/13/expected.json @@ -1,290 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "LeftRight", - "range": [ - 1, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "selfClosing": true, - "attributes": [ - { - "type": "JSXAttribute", - "name": { - "type": "JSXIdentifier", - "name": "left", - "range": [ - 11, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "value": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 17, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "selfClosing": true, - "attributes": [], - "range": [ - 16, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "closingElement": null, - "children": [], - "range": [ - 16, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "range": [ - 11, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - { - "type": "JSXAttribute", - "name": { - "type": "JSXIdentifier", - "name": "right", - "range": [ - 22, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "value": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "b", - "range": [ - 29, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "selfClosing": false, - "attributes": [], - "range": [ - 28, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "closingElement": { - "type": "JSXClosingElement", - "name": { - "type": "JSXIdentifier", - "name": "b", - "range": [ - 52, - 53 - ], - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 53 - } - } - }, - "range": [ - 50, - 54 - ], - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 54 - } - } - }, - "children": [ - { - "type": "Literal", - "value": "monkeys /> gorillas", - "raw": "monkeys /> gorillas", - "range": [ - 31, - 50 - ], - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 50 - } - } - } - ], - "range": [ - 28, - 54 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 54 - } - } - }, - "range": [ - 22, - 54 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 54 - } - } - } - ], - "range": [ - 0, - 57 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - } - }, - "closingElement": null, - "children": [], - "range": [ - 0, - 57 - ], + "type": "File", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "range": [ + 0, + 57 + ], + "program": { + "type": "Program", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "range": [ + 0, + 57 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 57, "loc": { "start": { "line": 1, @@ -294,22 +49,338 @@ "line": 1, "column": 57 } - } - }, - "range": [ - 0, - 57 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 57 + "range": [ + 0, + 57 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "range": [ + 0, + 57 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "range": [ + 0, + 57 + ], + "attributes": [ + { + "type": "JSXAttribute", + "start": 11, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 11, + 21 + ], + "name": { + "type": "JSXIdentifier", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 11, + 15 + ], + "name": "left" + }, + "value": { + "type": "JSXElement", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 16, + 21 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 16, + 21 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "name": "a" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] + } + }, + { + "type": "JSXAttribute", + "start": 22, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 22, + 54 + ], + "name": { + "type": "JSXIdentifier", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 22, + 27 + ], + "name": "right" + }, + "value": { + "type": "JSXElement", + "start": 28, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 28, + 54 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 28, + 31 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 29, + 30 + ], + "name": "b" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 50, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "range": [ + 50, + 54 + ], + "name": { + "type": "JSXIdentifier", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 52, + 53 + ], + "name": "b" + } + }, + "children": [ + { + "type": "Literal", + "start": 31, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "range": [ + 31, + 50 + ], + "value": "monkeys /> gorillas", + "rawValue": "monkeys /> gorillas", + "raw": "monkeys /> gorillas" + } + ] + } + } + ], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 1, + 10 + ], + "name": "LeftRight" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/14/expected.json b/test/fixtures/jsx/basic/14/expected.json index 108a63fc28..b486cc7a56 100644 --- a/test/fixtures/jsx/basic/14/expected.json +++ b/test/fixtures/jsx/basic/14/expected.json @@ -1,157 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 1, - 2 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "property": { - "type": "JSXIdentifier", - "name": "b", - "range": [ - 3, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "range": [ - 1, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "selfClosing": false, - "attributes": [], - "range": [ - 0, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "closingElement": { - "type": "JSXClosingElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 7, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "property": { - "type": "JSXIdentifier", - "name": "b", - "range": [ - 9, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "range": [ - 7, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "range": [ - 5, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "children": [], - "range": [ - 0, - 11 - ], + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -161,22 +49,190 @@ "line": 1, "column": 11 } - } - }, - "range": [ - 0, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 11 + "range": [ + 0, + 11 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ], + "attributes": [], + "name": { + "type": "JSXMemberExpression", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "object": { + "type": "JSXIdentifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + "property": { + "type": "JSXIdentifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "b" + } + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 5, + 11 + ], + "name": { + "type": "JSXMemberExpression", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 7, + 10 + ], + "object": { + "type": "JSXIdentifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "a" + }, + "property": { + "type": "JSXIdentifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "b" + } + } + }, + "children": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/15/expected.json b/test/fixtures/jsx/basic/15/expected.json index dee2bec60c..a268e9b971 100644 --- a/test/fixtures/jsx/basic/15/expected.json +++ b/test/fixtures/jsx/basic/15/expected.json @@ -1,227 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "JSXMemberExpression", - "object": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 1, - 2 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "property": { - "type": "JSXIdentifier", - "name": "b", - "range": [ - 3, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "range": [ - 1, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "property": { - "type": "JSXIdentifier", - "name": "c", - "range": [ - 5, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "range": [ - 1, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "selfClosing": false, - "attributes": [], - "range": [ - 0, - 7 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "closingElement": { - "type": "JSXClosingElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "JSXMemberExpression", - "object": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 9, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "property": { - "type": "JSXIdentifier", - "name": "b", - "range": [ - 11, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "range": [ - 9, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "property": { - "type": "JSXIdentifier", - "name": "c", - "range": [ - 13, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 9, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 7, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "children": [], - "range": [ - 0, - 15 - ], + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, @@ -231,22 +49,268 @@ "line": 1, "column": 15 } - } - }, - "range": [ - 0, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 15 + "range": [ + 0, + 15 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 0, + 7 + ], + "attributes": [], + "name": { + "type": "JSXMemberExpression", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 1, + 6 + ], + "object": { + "type": "JSXMemberExpression", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "object": { + "type": "JSXIdentifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + "property": { + "type": "JSXIdentifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "b" + } + }, + "property": { + "type": "JSXIdentifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "c" + } + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 7, + 15 + ], + "name": { + "type": "JSXMemberExpression", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 9, + 14 + ], + "object": { + "type": "JSXMemberExpression", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 9, + 12 + ], + "object": { + "type": "JSXIdentifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "a" + }, + "property": { + "type": "JSXIdentifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "b" + } + }, + "property": { + "type": "JSXIdentifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ], + "name": "c" + } + } + }, + "children": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/16/expected.json b/test/fixtures/jsx/basic/16/expected.json index 64fe2612d4..45a11ca61c 100644 --- a/test/fixtures/jsx/basic/16/expected.json +++ b/test/fixtures/jsx/basic/16/expected.json @@ -1,39 +1,81 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "div", - "range": [ - 2, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - } + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 0, + 14 + ], + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "selfClosing": true, - "attributes": [], - "range": [ - 1, - 8 - ], + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 0, + 13 + ], + "left": { + "type": "JSXElement", + "start": 1, + "end": 8, "loc": { "start": { "line": 1, @@ -43,72 +85,79 @@ "line": 1, "column": 8 } - } - }, - "closingElement": null, - "children": [], - "range": [ - 1, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 1 }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "right": { - "type": "Identifier", - "name": "x", - "range": [ - 12, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 12 + "range": [ + 1, + 8 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 1, + 8 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 2, + 5 + ], + "name": "div" + }, + "selfClosing": true }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "range": [ - 0, - 13 - ], - "loc": { - "start": { - "line": 1, - "column": 0 + "closingElement": null, + "children": [], + "parenthesizedExpression": true }, - "end": { - "line": 1, - "column": 13 + "operator": "<", + "right": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "x" } } - }, - "range": [ - 0, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/17/expected.json b/test/fixtures/jsx/basic/17/expected.json index 7223dd30ef..29426a6bd6 100644 --- a/test/fixtures/jsx/basic/17/expected.json +++ b/test/fixtures/jsx/basic/17/expected.json @@ -1,89 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "div", - "range": [ - 1, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "selfClosing": true, - "attributes": [ - { - "type": "JSXSpreadAttribute", - "argument": { - "type": "Identifier", - "name": "props", - "range": [ - 9, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 5, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - } - } - ], - "range": [ - 0, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "closingElement": null, - "children": [], - "range": [ - 0, - 18 - ], + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, "loc": { "start": { "line": 1, @@ -93,22 +49,114 @@ "line": 1, "column": 18 } - } - }, - "range": [ - 0, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 18 + "range": [ + 0, + 18 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "attributes": [ + { + "type": "JSXSpreadAttribute", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 5, + 15 + ], + "argument": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 9, + 14 + ], + "name": "props" + } + } + ], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "name": "div" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/18/expected.json b/test/fixtures/jsx/basic/18/expected.json index 93789c5ed7..de54d64d2a 100644 --- a/test/fixtures/jsx/basic/18/expected.json +++ b/test/fixtures/jsx/basic/18/expected.json @@ -1,143 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "div", - "range": [ - 1, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "selfClosing": true, - "attributes": [ - { - "type": "JSXSpreadAttribute", - "argument": { - "type": "Identifier", - "name": "props", - "range": [ - 9, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 5, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - { - "type": "JSXAttribute", - "name": { - "type": "JSXIdentifier", - "name": "post", - "range": [ - 16, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "value": { - "type": "Literal", - "value": "attribute", - "raw": "\"attribute\"", - "range": [ - 21, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "range": [ - 16, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "range": [ - 0, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "closingElement": null, - "children": [], - "range": [ - 0, - 35 - ], + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 35, "loc": { "start": { "line": 1, @@ -147,22 +49,175 @@ "line": 1, "column": 35 } - } - }, - "range": [ - 0, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 35 + "range": [ + 0, + 35 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 0, + 35 + ], + "attributes": [ + { + "type": "JSXSpreadAttribute", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 5, + 15 + ], + "argument": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 9, + 14 + ], + "name": "props" + } + }, + { + "type": "JSXAttribute", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 16, + 32 + ], + "name": { + "type": "JSXIdentifier", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 16, + 20 + ], + "name": "post" + }, + "value": { + "type": "Literal", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 21, + 32 + ], + "value": "attribute", + "rawValue": "attribute", + "raw": "\"attribute\"" + } + } + ], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "name": "div" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/19/expected.json b/test/fixtures/jsx/basic/19/expected.json index e09125f327..0ff17927c6 100644 --- a/test/fixtures/jsx/basic/19/expected.json +++ b/test/fixtures/jsx/basic/19/expected.json @@ -1,231 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "div", - "range": [ - 1, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "selfClosing": false, - "attributes": [ - { - "type": "JSXAttribute", - "name": { - "type": "JSXIdentifier", - "name": "pre", - "range": [ - 5, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "value": { - "type": "Literal", - "value": "leading", - "raw": "\"leading\"", - "range": [ - 9, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "range": [ - 5, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - { - "type": "JSXAttribute", - "name": { - "type": "JSXIdentifier", - "name": "pre2", - "range": [ - 19, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "value": { - "type": "Literal", - "value": "attribute", - "raw": "\"attribute\"", - "range": [ - 24, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "range": [ - 19, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - { - "type": "JSXSpreadAttribute", - "argument": { - "type": "Identifier", - "name": "props", - "range": [ - 40, - 45 - ], - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 45 - } - } - }, - "range": [ - 36, - 46 - ], - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 46 - } - } - } - ], - "range": [ - 0, - 47 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - } - }, - "closingElement": { - "type": "JSXClosingElement", - "name": { - "type": "JSXIdentifier", - "name": "div", - "range": [ - 49, - 52 - ], - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 52 - } - } - }, - "range": [ - 47, - 53 - ], - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 53 - } - } - }, - "children": [], - "range": [ - 0, - 53 - ], + "type": "File", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 0, + 53 + ], + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 0, + 53 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 53, "loc": { "start": { "line": 1, @@ -235,22 +49,274 @@ "line": 1, "column": 53 } - } - }, - "range": [ - 0, - 53 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 53 + "range": [ + 0, + 53 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 0, + 53 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 0, + 47 + ], + "attributes": [ + { + "type": "JSXAttribute", + "start": 5, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 5, + 18 + ], + "name": { + "type": "JSXIdentifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 5, + 8 + ], + "name": "pre" + }, + "value": { + "type": "Literal", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 9, + 18 + ], + "value": "leading", + "rawValue": "leading", + "raw": "\"leading\"" + } + }, + { + "type": "JSXAttribute", + "start": 19, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 19, + 35 + ], + "name": { + "type": "JSXIdentifier", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 19, + 23 + ], + "name": "pre2" + }, + "value": { + "type": "Literal", + "start": 24, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 24, + 35 + ], + "value": "attribute", + "rawValue": "attribute", + "raw": "\"attribute\"" + } + }, + { + "type": "JSXSpreadAttribute", + "start": 36, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "range": [ + 36, + 46 + ], + "argument": { + "type": "Identifier", + "start": 40, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "range": [ + 40, + 45 + ], + "name": "props" + } + } + ], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 47, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "range": [ + 47, + 53 + ], + "name": { + "type": "JSXIdentifier", + "start": 49, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 49, + 52 + ], + "name": "div" + } + }, + "children": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/2/expected.json b/test/fixtures/jsx/basic/2/expected.json index f2b1541a1a..e1e47a2039 100644 --- a/test/fixtures/jsx/basic/2/expected.json +++ b/test/fixtures/jsx/basic/2/expected.json @@ -1,160 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXNamespacedName", - "namespace": { - "type": "JSXIdentifier", - "name": "n", - "range": [ - 1, - 2 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "name": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 3, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "range": [ - 1, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "selfClosing": true, - "attributes": [ - { - "type": "JSXAttribute", - "name": { - "type": "JSXNamespacedName", - "namespace": { - "type": "JSXIdentifier", - "name": "n", - "range": [ - 5, - 6 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "name": { - "type": "JSXIdentifier", - "name": "v", - "range": [ - 7, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "range": [ - 5, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "value": null, - "range": [ - 5, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - } - } - ], - "range": [ - 0, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "closingElement": null, - "children": [], - "range": [ - 0, - 11 - ], + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -164,22 +49,193 @@ "line": 1, "column": 11 } - } - }, - "range": [ - 0, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 11 + "range": [ + 0, + 11 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "attributes": [ + { + "type": "JSXAttribute", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 5, + 8 + ], + "name": { + "type": "JSXNamespacedName", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 5, + 8 + ], + "namespace": { + "type": "JSXIdentifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "range": [ + 5, + 6 + ], + "name": "n" + }, + "name": { + "type": "JSXIdentifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "v" + } + }, + "value": null + } + ], + "name": { + "type": "JSXNamespacedName", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "namespace": { + "type": "JSXIdentifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "n" + }, + "name": { + "type": "JSXIdentifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "a" + } + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/20/expected.json b/test/fixtures/jsx/basic/20/expected.json index f3b8e69819..68238754b6 100644 --- a/test/fixtures/jsx/basic/20/expected.json +++ b/test/fixtures/jsx/basic/20/expected.json @@ -1,26 +1,43 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } + "type": "File", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 0, + 52 + ], + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "range": [ - 0, - 52 - ], - "expression": { - "type": "JSXElement", + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 0, + 52 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", "start": 0, "end": 52, "loc": { @@ -37,10 +54,10 @@ 0, 52 ], - "openingElement": { - "type": "JSXOpeningElement", + "expression": { + "type": "JSXElement", "start": 0, - "end": 31, + "end": 52, "loc": { "start": { "line": 1, @@ -48,92 +65,92 @@ }, "end": { "line": 1, - "column": 31 + "column": 52 } }, "range": [ 0, - 31 + 52 ], - "attributes": [ - { - "type": "JSXAttribute", - "start": 3, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 16 - } + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "range": [ - 3, - 16 - ], - "name": { - "type": "JSXIdentifier", + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "attributes": [ + { + "type": "JSXAttribute", "start": 3, - "end": 5, + "end": 16, "loc": { "start": { "line": 1, "column": 3 }, - "end": { - "line": 1, - "column": 5 - } - }, - "range": [ - 3, - 5 - ], - "name": "aa" - }, - "value": { - "type": "JSXExpressionContainer", - "start": 6, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 6 - }, "end": { "line": 1, "column": 16 } }, "range": [ - 6, + 3, 16 ], - "expression": { - "type": "MemberExpression", - "start": 7, - "end": 15, + "name": { + "type": "JSXIdentifier", + "start": 3, + "end": 5, "loc": { "start": { "line": 1, - "column": 7 + "column": 3 }, "end": { "line": 1, - "column": 15 + "column": 5 } }, "range": [ - 7, - 15 + 3, + 5 ], - "object": { + "name": "aa" + }, + "value": { + "type": "JSXExpressionContainer", + "start": 6, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 6, + 16 + ], + "expression": { "type": "MemberExpression", "start": 7, - "end": 12, + "end": 15, "loc": { "start": { "line": 1, @@ -141,157 +158,157 @@ }, "end": { "line": 1, - "column": 12 + "column": 15 } }, "range": [ 7, - 12 + 15 ], "object": { - "type": "Identifier", + "type": "MemberExpression", "start": 7, - "end": 9, + "end": 12, "loc": { "start": { "line": 1, "column": 7 }, - "end": { - "line": 1, - "column": 9 - } - }, - "range": [ - 7, - 9 - ], - "name": "aa" - }, - "property": { - "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, "end": { "line": 1, "column": 12 } }, "range": [ - 10, + 7, 12 ], - "name": "bb" + "object": { + "type": "Identifier", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 7, + 9 + ], + "name": "aa" + }, + "property": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 10, + 12 + ], + "name": "bb" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 13, + 15 + ], + "name": "cc" }, "computed": false - }, - "property": { - "type": "Identifier", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "range": [ - 13, - 15 - ], - "name": "cc" - }, - "computed": false - } - } - }, - { - "type": "JSXAttribute", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 + } } }, - "range": [ - 17, - 30 - ], - "name": { - "type": "JSXIdentifier", + { + "type": "JSXAttribute", "start": 17, - "end": 19, + "end": 30, "loc": { "start": { "line": 1, "column": 17 }, - "end": { - "line": 1, - "column": 19 - } - }, - "range": [ - 17, - 19 - ], - "name": "bb" - }, - "value": { - "type": "JSXExpressionContainer", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, "end": { "line": 1, "column": 30 } }, "range": [ - 20, + 17, 30 ], - "expression": { - "type": "MemberExpression", - "start": 21, - "end": 29, + "name": { + "type": "JSXIdentifier", + "start": 17, + "end": 19, "loc": { "start": { "line": 1, - "column": 21 + "column": 17 }, "end": { "line": 1, - "column": 29 + "column": 19 } }, "range": [ - 21, - 29 + 17, + 19 ], - "object": { + "name": "bb" + }, + "value": { + "type": "JSXExpressionContainer", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 20, + 30 + ], + "expression": { "type": "MemberExpression", "start": 21, - "end": 26, + "end": 29, "loc": { "start": { "line": 1, @@ -299,324 +316,343 @@ }, "end": { "line": 1, - "column": 26 + "column": 29 } }, "range": [ 21, - 26 + 29 ], "object": { - "type": "Identifier", + "type": "MemberExpression", "start": 21, - "end": 23, + "end": 26, "loc": { "start": { "line": 1, "column": 21 }, - "end": { - "line": 1, - "column": 23 - } - }, - "range": [ - 21, - 23 - ], - "name": "bb" - }, - "property": { - "type": "Identifier", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, "end": { "line": 1, "column": 26 } }, "range": [ - 24, + 21, 26 ], - "name": "cc" + "object": { + "type": "Identifier", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 21, + 23 + ], + "name": "bb" + }, + "property": { + "type": "Identifier", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 24, + 26 + ], + "name": "cc" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 27, + 29 + ], + "name": "dd" }, "computed": false - }, - "property": { - "type": "Identifier", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "range": [ - 27, - 29 - ], - "name": "dd" - }, - "computed": false + } } } - } - ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - }, - "range": [ - 1, - 2 ], - "name": "A" - }, - "selfClosing": false - }, - "closingElement": { - "type": "JSXClosingElement", - "start": 48, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 48 + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "A" }, - "end": { - "line": 1, - "column": 52 - } + "selfClosing": false }, - "range": [ - 48, - 52 - ], - "name": { - "type": "JSXIdentifier", - "start": 50, - "end": 51, + "closingElement": { + "type": "JSXClosingElement", + "start": 48, + "end": 52, "loc": { "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 51 - } - }, - "range": [ - 50, - 51 - ], - "name": "A" - } - }, - "children": [ - { - "type": "JSXElement", - "start": 31, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { "line": 1, "column": 48 + }, + "end": { + "line": 1, + "column": 52 } }, "range": [ - 31, - 48 + 48, + 52 ], - "openingElement": { - "type": "JSXOpeningElement", + "name": { + "type": "JSXIdentifier", + "start": 50, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 50, + 51 + ], + "name": "A" + } + }, + "children": [ + { + "type": "JSXElement", "start": 31, - "end": 36, + "end": 48, "loc": { "start": { "line": 1, "column": 31 }, - "end": { - "line": 1, - "column": 36 - } - }, - "range": [ - 31, - 36 - ], - "attributes": [], - "name": { - "type": "JSXIdentifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - } - }, - "range": [ - 32, - 35 - ], - "name": "div" - }, - "selfClosing": false - }, - "closingElement": { - "type": "JSXClosingElement", - "start": 42, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 42 - }, "end": { "line": 1, "column": 48 } }, "range": [ - 42, + 31, 48 ], - "name": { - "type": "JSXIdentifier", - "start": 44, - "end": 47, + "openingElement": { + "type": "JSXOpeningElement", + "start": 31, + "end": 36, "loc": { "start": { "line": 1, - "column": 44 + "column": 31 }, "end": { - "line": 1, - "column": 47 - } - }, - "range": [ - 44, - 47 - ], - "name": "div" - } - }, - "children": [ - { - "type": "JSXExpressionContainer", - "start": 36, - "end": 42, - "loc": { - "start": { "line": 1, "column": 36 - }, - "end": { - "line": 1, - "column": 42 } }, "range": [ - 36, - 42 + 31, + 36 ], - "expression": { - "type": "MemberExpression", - "start": 37, - "end": 41, + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 32, + "end": 35, "loc": { "start": { "line": 1, - "column": 37 + "column": 32 }, "end": { "line": 1, - "column": 41 + "column": 35 } }, "range": [ - 37, - 41 + 32, + 35 ], - "object": { - "type": "Identifier", + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 42, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 42, + 48 + ], + "name": { + "type": "JSXIdentifier", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 44, + 47 + ], + "name": "div" + } + }, + "children": [ + { + "type": "JSXExpressionContainer", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 36, + 42 + ], + "expression": { + "type": "MemberExpression", "start": 37, - "end": 39, + "end": 41, "loc": { "start": { "line": 1, "column": 37 }, - "end": { - "line": 1, - "column": 39 - } - }, - "range": [ - 37, - 39 - ], - "name": "aa" - }, - "property": { - "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, "end": { "line": 1, "column": 41 } }, "range": [ - 40, + 37, 41 ], - "name": "b" - }, - "computed": false + "object": { + "type": "Identifier", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 37, + 39 + ], + "name": "aa" + }, + "property": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 40, + 41 + ], + "name": "b" + }, + "computed": false + } } - } - ] - } - ] + ] + } + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/3/expected.json b/test/fixtures/jsx/basic/3/expected.json index 3dec8b1f74..a3d398a0a5 100644 --- a/test/fixtures/jsx/basic/3/expected.json +++ b/test/fixtures/jsx/basic/3/expected.json @@ -1,398 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 1, - 2 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "selfClosing": false, - "attributes": [ - { - "type": "JSXAttribute", - "name": { - "type": "JSXNamespacedName", - "namespace": { - "type": "JSXIdentifier", - "name": "n", - "range": [ - 3, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "name": { - "type": "JSXIdentifier", - "name": "foo", - "range": [ - 5, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "range": [ - 3, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "value": { - "type": "Literal", - "value": "bar", - "raw": "\"bar\"", - "range": [ - 9, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "range": [ - 3, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 14 - } - } - } - ], - "range": [ - 0, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "closingElement": { - "type": "JSXClosingElement", - "name": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 38, - 39 - ], - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - } - } - }, - "range": [ - 36, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 40 - } - } - }, - "children": [ - { - "type": "Literal", - "value": " ", - "raw": " ", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "JSXExpressionContainer", - "expression": { - "type": "Identifier", - "name": "value", - "range": [ - 17, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "range": [ - 16, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - { - "type": "Literal", - "value": " ", - "raw": " ", - "range": [ - 23, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "b", - "range": [ - 25, - 26 - ], - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - } - }, - "selfClosing": false, - "attributes": [], - "range": [ - 24, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "closingElement": { - "type": "JSXClosingElement", - "name": { - "type": "JSXIdentifier", - "name": "b", - "range": [ - 34, - 35 - ], - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - } - }, - "range": [ - 32, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "children": [ - { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "c", - "range": [ - 28, - 29 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - } - }, - "selfClosing": true, - "attributes": [], - "range": [ - 27, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - } - }, - "closingElement": null, - "children": [], - "range": [ - 27, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - } - } - ], - "range": [ - 24, - 36 - ], - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - ], - "range": [ - 0, - 40 - ], + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 40, "loc": { "start": { "line": 1, @@ -402,22 +49,460 @@ "line": 1, "column": 40 } - } - }, - "range": [ - 0, - 40 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 40 + "range": [ + 0, + 40 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 0, + 15 + ], + "attributes": [ + { + "type": "JSXAttribute", + "start": 3, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 3, + 14 + ], + "name": { + "type": "JSXNamespacedName", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 3, + 8 + ], + "namespace": { + "type": "JSXIdentifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "n" + }, + "name": { + "type": "JSXIdentifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 5, + 8 + ], + "name": "foo" + } + }, + "value": { + "type": "Literal", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 9, + 14 + ], + "value": "bar", + "rawValue": "bar", + "raw": "\"bar\"" + } + } + ], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 36, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 36, + 40 + ], + "name": { + "type": "JSXIdentifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 38, + 39 + ], + "name": "a" + } + }, + "children": [ + { + "type": "Literal", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ], + "value": " ", + "rawValue": " ", + "raw": " " + }, + { + "type": "JSXExpressionContainer", + "start": 16, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 16, + 23 + ], + "expression": { + "type": "Identifier", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 17, + 22 + ], + "name": "value" + } + }, + { + "type": "Literal", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 23, + 24 + ], + "value": " ", + "rawValue": " ", + "raw": " " + }, + { + "type": "JSXElement", + "start": 24, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 24, + 36 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 24, + 27 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 25, + 26 + ], + "name": "b" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 32, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 32, + 36 + ], + "name": { + "type": "JSXIdentifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 34, + 35 + ], + "name": "b" + } + }, + "children": [ + { + "type": "JSXElement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 27, + 32 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 27, + 32 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 28, + 29 + ], + "name": "c" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] + } + ] + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/4/expected.json b/test/fixtures/jsx/basic/4/expected.json index edfc8b12dd..ce3a33801f 100644 --- a/test/fixtures/jsx/basic/4/expected.json +++ b/test/fixtures/jsx/basic/4/expected.json @@ -1,142 +1,386 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 1, - 2 - ] + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "selfClosing": true, - "attributes": [ - { - "type": "JSXAttribute", - "name": { - "type": "JSXIdentifier", - "name": "b", - "range": [ - 3, - 4 - ] - }, - "value": { - "type": "JSXExpressionContainer", - "expression": { - "type": "Literal", - "value": " ", - "raw": "\" \"", - "range": [ - 6, - 9 - ] - }, - "range": [ - 5, - 10 - ] - }, - "range": [ - 3, - 10 - ] - }, - { - "type": "JSXAttribute", - "name": { - "type": "JSXIdentifier", - "name": "c", - "range": [ - 11, - 12 - ] - }, - "value": { - "type": "Literal", - "value": " ", - "raw": "\" \"", - "range": [ - 13, - 16 - ] - }, - "range": [ - 11, - 16 - ] - }, - { - "type": "JSXAttribute", - "name": { - "type": "JSXIdentifier", - "name": "d", - "range": [ - 17, - 18 - ] - }, - "value": { - "type": "Literal", - "value": "&", - "raw": "\"&\"", - "range": [ - 19, - 26 - ] - }, - "range": [ - 17, - 26 - ] - }, - { - "type": "JSXAttribute", - "name": { - "type": "JSXIdentifier", - "name": "e", - "range": [ - 27, - 28 - ] - }, - "value": { - "type": "Literal", - "value": "&r;", - "raw": "\"&r;\"", - "range": [ - 29, - 37 - ] - }, - "range": [ - 27, - 37 - ] - } - ], - "range": [ - 0, - 40 - ] + "end": { + "line": 1, + "column": 40 + } }, - "closingElement": null, - "children": [], "range": [ 0, 40 - ] - }, - "range": [ - 0, - 40 - ] - } - ] + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "attributes": [ + { + "type": "JSXAttribute", + "start": 3, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 3, + 10 + ], + "name": { + "type": "JSXIdentifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "b" + }, + "value": { + "type": "JSXExpressionContainer", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 5, + 10 + ], + "expression": { + "type": "Literal", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 6, + 9 + ], + "value": " ", + "rawValue": " ", + "raw": "\" \"" + } + } + }, + { + "type": "JSXAttribute", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 11, + 16 + ], + "name": { + "type": "JSXIdentifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "c" + }, + "value": { + "type": "Literal", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 13, + 16 + ], + "value": " ", + "rawValue": " ", + "raw": "\" \"" + } + }, + { + "type": "JSXAttribute", + "start": 17, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 17, + 26 + ], + "name": { + "type": "JSXIdentifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 17, + 18 + ], + "name": "d" + }, + "value": { + "type": "Literal", + "start": 19, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 19, + 26 + ], + "value": "&", + "rawValue": "&", + "raw": "\"&\"" + } + }, + { + "type": "JSXAttribute", + "start": 27, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 27, + 37 + ], + "name": { + "type": "JSXIdentifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 27, + 28 + ], + "name": "e" + }, + "value": { + "type": "Literal", + "start": 29, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 29, + 37 + ], + "value": "&r;", + "rawValue": "&r;", + "raw": "\"&r;\"" + } + } + ], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/5/expected.json b/test/fixtures/jsx/basic/5/expected.json index 0995c19384..dfd84d6ca5 100644 --- a/test/fixtures/jsx/basic/5/expected.json +++ b/test/fixtures/jsx/basic/5/expected.json @@ -1,53 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 1, - 2 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "selfClosing": true, - "attributes": [], - "range": [ - 0, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - } - }, - "closingElement": null, - "children": [], - "range": [ - 0, - 5 - ], + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "range": [ + 0, + 5 + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "range": [ + 0, + 5 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, "loc": { "start": { "line": 1, @@ -57,22 +49,74 @@ "line": 2, "column": 2 } - } - }, - "range": [ - 0, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 2, - "column": 2 + "range": [ + 0, + 5 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "range": [ + 0, + 5 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "range": [ + 0, + 5 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/6/expected.json b/test/fixtures/jsx/basic/6/expected.json index 30875cf987..d3c61bcd85 100644 --- a/test/fixtures/jsx/basic/6/expected.json +++ b/test/fixtures/jsx/basic/6/expected.json @@ -1,87 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "日本語", - "range": [ - 1, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "selfClosing": false, - "attributes": [], - "range": [ - 0, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - "closingElement": { - "type": "JSXClosingElement", - "name": { - "type": "JSXIdentifier", - "name": "日本語", - "range": [ - 7, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "range": [ - 5, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - "children": [], - "range": [ - 0, - 11 - ], + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, "loc": { "start": { "line": 1, @@ -91,22 +49,112 @@ "line": 1, "column": 11 } - } - }, - "range": [ - 0, - 11 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 11 + "range": [ + 0, + 11 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 0, + 11 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "name": "日本語" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 5, + 11 + ], + "name": { + "type": "JSXIdentifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 7, + 10 + ], + "name": "日本語" + } + }, + "children": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/7/expected.json b/test/fixtures/jsx/basic/7/expected.json index 27bfb17aaf..bd57b454d3 100644 --- a/test/fixtures/jsx/basic/7/expected.json +++ b/test/fixtures/jsx/basic/7/expected.json @@ -1,162 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "AbC-def", - "range": [ - 1, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "selfClosing": false, - "attributes": [ - { - "type": "JSXAttribute", - "name": { - "type": "JSXIdentifier", - "name": "test", - "range": [ - 11, - 15 - ], - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "value": { - "type": "Literal", - "value": "&&", - "raw": "\"&&\"", - "range": [ - 16, - 31 - ], - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 22 - } - } - }, - "range": [ - 11, - 31 - ], - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 22 - } - } - } - ], - "range": [ - 0, - 32 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - } - }, - "closingElement": { - "type": "JSXClosingElement", - "name": { - "type": "JSXIdentifier", - "name": "AbC-def", - "range": [ - 43, - 50 - ], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 9 - } - } - }, - "range": [ - 41, - 51 - ], - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 10 - } - } - }, - "children": [ - { - "type": "Literal", - "value": "\nbar\nbaz\n", - "raw": "\nbar\nbaz\n", - "range": [ - 32, - 41 - ], - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 5, - "column": 0 - } - } - } - ], - "range": [ - 0, - 51 - ], + "type": "File", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 0, + 51 + ], + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 0, + 51 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 51, "loc": { "start": { "line": 1, @@ -166,22 +49,197 @@ "line": 5, "column": 10 } - } - }, - "range": [ - 0, - 51 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 5, - "column": 10 + "range": [ + 0, + 51 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 0, + 51 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "range": [ + 0, + 32 + ], + "attributes": [ + { + "type": "JSXAttribute", + "start": 11, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "range": [ + 11, + 31 + ], + "name": { + "type": "JSXIdentifier", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "range": [ + 11, + 15 + ], + "name": "test" + }, + "value": { + "type": "Literal", + "start": 16, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "range": [ + 16, + 31 + ], + "value": "&&", + "rawValue": "&&", + "raw": "\"&&\"" + } + } + ], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 1, + 8 + ], + "name": "AbC-def" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 41, + "end": 51, + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 41, + 51 + ], + "name": { + "type": "JSXIdentifier", + "start": 43, + "end": 50, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 43, + 50 + ], + "name": "AbC-def" + } + }, + "children": [ + { + "type": "Literal", + "start": 32, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 5, + "column": 0 + } + }, + "range": [ + 32, + 41 + ], + "value": "\nbar\nbaz\n", + "rawValue": "\nbar\nbaz\n", + "raw": "\nbar\nbaz\n" + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/8/expected.json b/test/fixtures/jsx/basic/8/expected.json index c6765f33e8..72157391f6 100644 --- a/test/fixtures/jsx/basic/8/expected.json +++ b/test/fixtures/jsx/basic/8/expected.json @@ -1,253 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 1, - 2 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "selfClosing": true, - "attributes": [ - { - "type": "JSXAttribute", - "name": { - "type": "JSXIdentifier", - "name": "b", - "range": [ - 3, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "value": { - "type": "JSXExpressionContainer", - "expression": { - "type": "ConditionalExpression", - "test": { - "type": "Identifier", - "name": "x", - "range": [ - 6, - 7 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } - }, - "consequent": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "c", - "range": [ - 11, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "selfClosing": true, - "attributes": [], - "range": [ - 10, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "closingElement": null, - "children": [], - "range": [ - 10, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "alternate": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "d", - "range": [ - 19, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - "selfClosing": true, - "attributes": [], - "range": [ - 18, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "closingElement": null, - "children": [], - "range": [ - 18, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 6, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 23 - } - } - }, - "range": [ - 5, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 24 - } - } - }, - "range": [ - 3, - 24 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 24 - } - } - } - ], - "range": [ - 0, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "closingElement": null, - "children": [], - "range": [ - 0, - 27 - ], + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, "loc": { "start": { "line": 1, @@ -257,22 +49,296 @@ "line": 1, "column": 27 } - } - }, - "range": [ - 0, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 27 + "range": [ + 0, + 27 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "range": [ + 0, + 27 + ], + "attributes": [ + { + "type": "JSXAttribute", + "start": 3, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 3, + 24 + ], + "name": { + "type": "JSXIdentifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 3, + 4 + ], + "name": "b" + }, + "value": { + "type": "JSXExpressionContainer", + "start": 5, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 5, + 24 + ], + "expression": { + "type": "ConditionalExpression", + "start": 6, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 6, + 23 + ], + "test": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "x" + }, + "consequent": { + "type": "JSXElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 10, + 15 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 10, + 15 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 11, + 12 + ], + "name": "c" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] + }, + "alternate": { + "type": "JSXElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 18, + 23 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 18, + 23 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ], + "name": "d" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] + } + } + } + } + ], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/9/expected.json b/test/fixtures/jsx/basic/9/expected.json index 31069e3122..cdb79c2c97 100644 --- a/test/fixtures/jsx/basic/9/expected.json +++ b/test/fixtures/jsx/basic/9/expected.json @@ -1,122 +1,45 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "JSXElement", - "openingElement": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 1, - 2 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - "selfClosing": false, - "attributes": [], - "range": [ - 0, - 3 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "closingElement": { - "type": "JSXClosingElement", - "name": { - "type": "JSXIdentifier", - "name": "a", - "range": [ - 7, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "range": [ - 5, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "children": [ - { - "type": "JSXExpressionContainer", - "expression": { - "type": "JSXEmptyExpression", - "range": [ - 4, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - "range": [ - 3, - 5 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 5 - } - } - } - ], - "range": [ - 0, - 9 - ], + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 0, + 9 + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 0, + 9 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, @@ -126,22 +49,151 @@ "line": 1, "column": 9 } - } - }, - "range": [ - 0, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 9 + "range": [ + 0, + 9 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 0, + 9 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "a" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 5, + 9 + ], + "name": { + "type": "JSXIdentifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 7, + 8 + ], + "name": "a" + } + }, + "children": [ + { + "type": "JSXExpressionContainer", + "start": 3, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 3, + 5 + ], + "expression": { + "type": "JSXEmptyExpression", + "start": 4, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 4, + 4 + ] + } + } + ] } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/regression/1/expected.json b/test/fixtures/jsx/regression/1/expected.json index 1e5685ffc5..6b2c0dd6ab 100644 --- a/test/fixtures/jsx/regression/1/expected.json +++ b/test/fixtures/jsx/regression/1/expected.json @@ -1,112 +1,390 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 40, - "expression": { - "type": "JSXElement", - "start": 0, - "end": 38, - "openingElement": { - "type": "JSXOpeningElement", - "start": 0, - "end": 3, - "attributes": [], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 2, - "name": "p" - }, - "selfClosing": false - }, - "closingElement": { - "type": "JSXClosingElement", - "start": 34, - "end": 38, - "name": { - "type": "JSXIdentifier", - "start": 36, - "end": 37, - "name": "p" - } - }, - "children": [ - { - "type": "Literal", - "start": 3, - "end": 7, - "value": "foo ", - "raw": "foo " - }, - { - "type": "JSXElement", - "start": 7, - "end": 30, - "openingElement": { - "type": "JSXOpeningElement", - "start": 7, - "end": 22, - "attributes": [ - { - "type": "JSXAttribute", - "start": 10, - "end": 21, - "name": { - "type": "JSXIdentifier", - "start": 10, - "end": 14, - "name": "href" - }, - "value": { - "type": "Literal", - "start": 15, - "end": 21, - "value": "test", - "raw": "\"test\"" - } - } - ], - "name": { - "type": "JSXIdentifier", - "start": 8, - "end": 9, - "name": "a" - }, - "selfClosing": false - }, - "closingElement": { - "type": "JSXClosingElement", - "start": 26, - "end": 30, - "name": { - "type": "JSXIdentifier", - "start": 28, - "end": 29, - "name": "a" - } - }, - "children": [ - { - "type": "Literal", - "start": 22, - "end": 26, - "value": " bar", - "raw": " bar" - } - ] - }, - { - "type": "Literal", - "start": 30, - "end": 34, - "value": " baz", - "raw": " baz" - } - ] - } + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 } - ] + }, + "range": [ + 0, + 40 + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "range": [ + 0, + 40 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 0, + 38 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "range": [ + 0, + 3 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "p" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 34, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "range": [ + 34, + 38 + ], + "name": { + "type": "JSXIdentifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "range": [ + 36, + 37 + ], + "name": "p" + } + }, + "children": [ + { + "type": "Literal", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 3, + 7 + ], + "value": "foo ", + "rawValue": "foo ", + "raw": "foo " + }, + { + "type": "JSXElement", + "start": 7, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 7, + 30 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 7, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 7, + 22 + ], + "attributes": [ + { + "type": "JSXAttribute", + "start": 10, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 10, + 21 + ], + "name": { + "type": "JSXIdentifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 10, + 14 + ], + "name": "href" + }, + "value": { + "type": "Literal", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 15, + 21 + ], + "value": "test", + "rawValue": "test", + "raw": "\"test\"" + } + } + ], + "name": { + "type": "JSXIdentifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "a" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 26, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 26, + 30 + ], + "name": { + "type": "JSXIdentifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 28, + 29 + ], + "name": "a" + } + }, + "children": [ + { + "type": "Literal", + "start": 22, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 22, + 26 + ], + "value": " bar", + "rawValue": " bar", + "raw": " bar" + } + ] + }, + { + "type": "Literal", + "start": 30, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "range": [ + 30, + 34 + ], + "value": " baz", + "rawValue": " baz", + "raw": " baz" + } + ] + } + } + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/regression/2/expected.json b/test/fixtures/jsx/regression/2/expected.json index 3f651ccb3b..d30c0e52c2 100644 --- a/test/fixtures/jsx/regression/2/expected.json +++ b/test/fixtures/jsx/regression/2/expected.json @@ -1,78 +1,282 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 30, - "expression": { - "type": "JSXElement", + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", "start": 0, "end": 30, - "openingElement": { - "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "attributes": [], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 4, - "name": "div" + "loc": { + "start": { + "line": 1, + "column": 0 }, - "selfClosing": false - }, - "closingElement": { - "type": "JSXClosingElement", - "start": 24, - "end": 30, - "name": { - "type": "JSXIdentifier", - "start": 26, - "end": 29, - "name": "div" + "end": { + "line": 1, + "column": 30 } }, - "children": [ - { - "type": "JSXExpressionContainer", - "start": 5, - "end": 24, - "expression": { - "type": "JSXElement", - "start": 6, - "end": 23, - "openingElement": { - "type": "JSXOpeningElement", + "range": [ + 0, + 30 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 0, + 30 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 24, + 30 + ], + "name": { + "type": "JSXIdentifier", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 26, + 29 + ], + "name": "div" + } + }, + "children": [ + { + "type": "JSXExpressionContainer", + "start": 5, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 5, + 24 + ], + "expression": { + "type": "JSXElement", "start": 6, "end": 23, - "attributes": [ - { - "type": "JSXSpreadAttribute", - "start": 11, - "end": 20, - "argument": { - "type": "Identifier", - "start": 15, - "end": 19, - "name": "test" - } + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 23 } - ], - "name": { - "type": "JSXIdentifier", - "start": 7, - "end": 10, - "name": "div" }, - "selfClosing": true - }, - "closingElement": null, - "children": [] + "range": [ + 6, + 23 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 6, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 6, + 23 + ], + "attributes": [ + { + "type": "JSXSpreadAttribute", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 11, + 20 + ], + "argument": { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 15, + 19 + ], + "name": "test" + } + } + ], + "name": { + "type": "JSXIdentifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 7, + 10 + ], + "name": "div" + }, + "selfClosing": true + }, + "closingElement": null, + "children": [] + } } - } - ] + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/regression/3/expected.json b/test/fixtures/jsx/regression/3/expected.json index 812fc1dcc1..2ed72cf99c 100644 --- a/test/fixtures/jsx/regression/3/expected.json +++ b/test/fixtures/jsx/regression/3/expected.json @@ -1,74 +1,264 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 18, - "expression": { - "type": "JSXElement", + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 0, + 18 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", "start": 0, "end": 18, - "openingElement": { - "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "attributes": [], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 4, - "name": "div" + "loc": { + "start": { + "line": 1, + "column": 0 }, - "selfClosing": false + "end": { + "line": 1, + "column": 18 + } }, - "closingElement": { - "type": "JSXClosingElement", - "start": 12, + "range": [ + 0, + 18 + ], + "expression": { + "type": "JSXElement", + "start": 0, "end": 18, - "name": { - "type": "JSXIdentifier", - "start": 14, - "end": 17, - "name": "div" - } - }, - "children": [ - { - "type": "JSXExpressionContainer", - "start": 5, - "end": 12, - "expression": { - "type": "ObjectExpression", - "start": 7, - "end": 10, - "properties": [ - { - "type": "Property", - "start": 8, - "end": 9, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 8, - "end": 9, - "name": "a" - }, - "kind": "init", - "value": { - "type": "Identifier", - "start": 8, - "end": 9, - "name": "a" - } - } - ] + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 } - } - ] + }, + "range": [ + 0, + 18 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 12, + 18 + ], + "name": { + "type": "JSXIdentifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 14, + 17 + ], + "name": "div" + } + }, + "children": [ + { + "type": "JSXExpressionContainer", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 5, + 12 + ], + "expression": { + "type": "ObjectExpression", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 7, + 10 + ], + "properties": [ + { + "type": "Property", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "a" + }, + "kind": "init", + "value": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "name": "a" + } + } + ] + } + } + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/regression/4/expected.json b/test/fixtures/jsx/regression/4/expected.json index a2231e8029..b2a8314854 100644 --- a/test/fixtures/jsx/regression/4/expected.json +++ b/test/fixtures/jsx/regression/4/expected.json @@ -1,48 +1,183 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 16, - "expression": { - "type": "JSXElement", + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", "start": 0, "end": 16, - "openingElement": { - "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "attributes": [], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 4, - "name": "div" + "loc": { + "start": { + "line": 1, + "column": 0 }, - "selfClosing": false + "end": { + "line": 1, + "column": 16 + } }, - "closingElement": { - "type": "JSXClosingElement", - "start": 10, + "range": [ + 0, + 16 + ], + "expression": { + "type": "JSXElement", + "start": 0, "end": 16, - "name": { - "type": "JSXIdentifier", - "start": 12, - "end": 15, - "name": "div" - } - }, - "children": [ - { - "type": "Literal", - "start": 5, - "end": 10, - "value": "/text", - "raw": "/text" - } - ] + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 10, + 16 + ], + "name": { + "type": "JSXIdentifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 12, + 15 + ], + "name": "div" + } + }, + "children": [ + { + "type": "Literal", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 5, + 10 + ], + "value": "/text", + "rawValue": "/text", + "raw": "/text" + } + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/regression/5/expected.json b/test/fixtures/jsx/regression/5/expected.json index 239df4c6e1..54f41461ff 100644 --- a/test/fixtures/jsx/regression/5/expected.json +++ b/test/fixtures/jsx/regression/5/expected.json @@ -1,111 +1,239 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 17, - "expression": { - "type": "JSXElement", + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", "start": 0, "end": 17, - "openingElement": { - "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "attributes": [], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 4, - "name": "div" + "loc": { + "start": { + "line": 1, + "column": 0 }, - "selfClosing": false - }, - "closingElement": { - "type": "JSXClosingElement", - "start": 11, - "end": 17, - "name": { - "type": "JSXIdentifier", - "start": 13, - "end": 16, - "name": "div" + "end": { + "line": 1, + "column": 17 } }, - "children": [ - { - "type": "JSXExpressionContainer", - "expression": { - "type": "Identifier", - "name": "a", - "range": [ - 6, - 7 - ], - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } + "range": [ + 0, + 17 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "range": [ - 5, - 8 - ], + "end": { + "line": 1, + "column": 17 + } + }, + "range": [ + 0, + 17 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 5, "loc": { "start": { + "line": 1, + "column": 0 + }, + "end": { "line": 1, "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - { - "type": "JSXExpressionContainer", - "expression": { - "type": "Identifier", - "name": "b", - "range": [ - 9, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } } }, "range": [ - 8, - 11 + 0, + 5 ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 11, + "end": 17, "loc": { "start": { "line": 1, - "column": 8 + "column": 11 }, "end": { "line": 1, - "column": 11 + "column": 17 + } + }, + "range": [ + 11, + 17 + ], + "name": { + "type": "JSXIdentifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 13, + 16 + ], + "name": "div" + } + }, + "children": [ + { + "type": "JSXExpressionContainer", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 5, + 8 + ], + "expression": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "a" + } + }, + { + "type": "JSXExpressionContainer", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 8, + 11 + ], + "expression": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 9, + 10 + ], + "name": "b" } } - } - ] + ] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/regression/6/expected.json b/test/fixtures/jsx/regression/6/expected.json index cf1d7809e5..92ee17304c 100644 --- a/test/fixtures/jsx/regression/6/expected.json +++ b/test/fixtures/jsx/regression/6/expected.json @@ -1,77 +1,223 @@ { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "range": [ - 0, - 32 - ], - "expression": { - "type": "JSXElement", + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 0, + 32 + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "range": [ + 0, + 32 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, "range": [ 0, 32 ], - "openingElement": { - "type": "JSXOpeningElement", + "expression": { + "type": "JSXElement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, "range": [ 0, 32 ], - "attributes": [ - { - "type": "JSXAttribute", - "range": [ - 5, - 18 - ], - "name": { - "type": "JSXIdentifier", - "range": [ - 5, - 8 - ], - "name": "pre" + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "value": { - "type": "Literal", - "range": [ - 9, - 18 - ], - "value": "leading" + "end": { + "line": 1, + "column": 32 } }, - { - "type": "JSXSpreadAttribute", - "range": [ - 19, - 29 - ], - "argument": { - "type": "Identifier", - "range": [ - 23, - 28 - ], - "name": "props" - } - } - ], - "name": { - "type": "JSXIdentifier", "range": [ - 1, - 4 + 0, + 32 ], - "name": "div" + "attributes": [ + { + "type": "JSXAttribute", + "start": 5, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 5, + 18 + ], + "name": { + "type": "JSXIdentifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "range": [ + 5, + 8 + ], + "name": "pre" + }, + "value": { + "type": "Literal", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 9, + 18 + ], + "value": "leading", + "rawValue": "leading", + "raw": "\"leading\"" + } + }, + { + "type": "JSXSpreadAttribute", + "start": 19, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 19, + 29 + ], + "argument": { + "type": "Identifier", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "range": [ + 23, + 28 + ], + "name": "props" + } + } + ], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "name": "div" + }, + "selfClosing": true }, - "selfClosing": true - }, - "closingElement": null, - "children": [] + "closingElement": null, + "children": [] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/regression/7/expected.json b/test/fixtures/jsx/regression/7/expected.json index 64c7b5f273..0070fec24a 100644 --- a/test/fixtures/jsx/regression/7/expected.json +++ b/test/fixtures/jsx/regression/7/expected.json @@ -1,5 +1,5 @@ { - "type": "Program", + "type": "File", "start": 0, "end": 62, "loc": { @@ -16,28 +16,28 @@ 0, 62 ], - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } + "program": { + "type": "Program", + "start": 0, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "range": [ - 0, - 62 - ], - "expression": { - "type": "JSXElement", + "end": { + "line": 3, + "column": 17 + } + }, + "range": [ + 0, + 62 + ], + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", "start": 0, "end": 62, "loc": { @@ -54,8 +54,8 @@ 0, 62 ], - "openingElement": { - "type": "JSXOpeningElement", + "expression": { + "type": "JSXElement", "start": 0, "end": 62, "loc": { @@ -72,53 +72,33 @@ 0, 62 ], - "attributes": [ - { - "type": "JSXAttribute", - "start": 6, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 3, - "column": 15 - } + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "range": [ - 6, - 60 - ], - "name": { - "type": "JSXIdentifier", + "end": { + "line": 3, + "column": 17 + } + }, + "range": [ + 0, + 62 + ], + "attributes": [ + { + "type": "JSXAttribute", "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 6, - 7 - ], - "name": "d" - }, - "value": { - "type": "Literal", - "start": 8, "end": 60, "loc": { "start": { "line": 1, - "column": 8 + "column": 6 }, "end": { "line": 3, @@ -126,40 +106,79 @@ } }, "range": [ - 8, + 6, 60 ], - "value": "M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z", - "rawValue": "M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z", - "raw": "\"M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z\"" + "name": { + "type": "JSXIdentifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "d" + }, + "value": { + "type": "Literal", + "start": 8, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "range": [ + 8, + 60 + ], + "value": "M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z", + "rawValue": "M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z", + "raw": "\"M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z\"" + } } - } - ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "range": [ - 1, - 5 ], - "name": "path" + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 1, + 5 + ], + "name": "path" + }, + "selfClosing": true }, - "selfClosing": true - }, - "closingElement": null, - "children": [] + "closingElement": null, + "children": [] + } } - } - ] + ] + } } \ No newline at end of file diff --git a/test/index.js b/test/index.js index f67dfbbc53..4502a1199e 100644 --- a/test/index.js +++ b/test/index.js @@ -23,7 +23,7 @@ function runTest(test) { opts.locations = true; try { - var ast = parse(test.actual.code, opts).program; + var ast = parse(test.actual.code, opts); } catch (err) { if (opts.throws) { if (err.message === opts.throws) { @@ -42,6 +42,7 @@ function runTest(test) { } else { var mis = misMatch(JSON.parse(test.expect.code), ast); if (mis) { + //delete ast.tokens; //require("fs").writeFileSync(test.expect.loc, JSON.stringify(ast, null, " ")); throw new Error(mis); }