1TypeError: Right-hand side of instanceof expression must represent a type. [instanceof_etsobject_jsvalue.sts:23:12] 2{ 3 "type": "Program", 4 "statements": [ 5 { 6 "type": "ClassDeclaration", 7 "definition": { 8 "id": { 9 "type": "Identifier", 10 "name": "ETSGLOBAL", 11 "decorators": [], 12 "loc": { 13 "start": { 14 "line": 1, 15 "column": 1 16 }, 17 "end": { 18 "line": 1, 19 "column": 1 20 } 21 } 22 }, 23 "superClass": null, 24 "implements": [], 25 "body": [ 26 { 27 "type": "MethodDefinition", 28 "key": { 29 "type": "Identifier", 30 "name": "_$init$_", 31 "decorators": [], 32 "loc": { 33 "start": { 34 "line": 1, 35 "column": 1 36 }, 37 "end": { 38 "line": 1, 39 "column": 1 40 } 41 } 42 }, 43 "kind": "method", 44 "accessibility": "public", 45 "static": true, 46 "optional": false, 47 "computed": false, 48 "value": { 49 "type": "FunctionExpression", 50 "function": { 51 "type": "ScriptFunction", 52 "id": { 53 "type": "Identifier", 54 "name": "_$init$_", 55 "decorators": [], 56 "loc": { 57 "start": { 58 "line": 1, 59 "column": 1 60 }, 61 "end": { 62 "line": 1, 63 "column": 1 64 } 65 } 66 }, 67 "generator": false, 68 "async": false, 69 "expression": false, 70 "params": [], 71 "body": { 72 "type": "BlockStatement", 73 "statements": [], 74 "loc": { 75 "start": { 76 "line": 1, 77 "column": 1 78 }, 79 "end": { 80 "line": 1, 81 "column": 1 82 } 83 } 84 }, 85 "loc": { 86 "start": { 87 "line": 1, 88 "column": 1 89 }, 90 "end": { 91 "line": 1, 92 "column": 1 93 } 94 } 95 }, 96 "loc": { 97 "start": { 98 "line": 1, 99 "column": 1 100 }, 101 "end": { 102 "line": 1, 103 "column": 1 104 } 105 } 106 }, 107 "overloads": [], 108 "decorators": [], 109 "loc": { 110 "start": { 111 "line": 1, 112 "column": 1 113 }, 114 "end": { 115 "line": 1, 116 "column": 1 117 } 118 } 119 }, 120 { 121 "type": "MethodDefinition", 122 "key": { 123 "type": "Identifier", 124 "name": "fn", 125 "decorators": [], 126 "loc": { 127 "start": { 128 "line": 22, 129 "column": 10 130 }, 131 "end": { 132 "line": 22, 133 "column": 12 134 } 135 } 136 }, 137 "kind": "method", 138 "accessibility": "public", 139 "static": true, 140 "optional": false, 141 "computed": false, 142 "value": { 143 "type": "FunctionExpression", 144 "function": { 145 "type": "ScriptFunction", 146 "id": { 147 "type": "Identifier", 148 "name": "fn", 149 "decorators": [], 150 "loc": { 151 "start": { 152 "line": 22, 153 "column": 10 154 }, 155 "end": { 156 "line": 22, 157 "column": 12 158 } 159 } 160 }, 161 "generator": false, 162 "async": false, 163 "expression": false, 164 "params": [ 165 { 166 "type": "ETSParameterExpression", 167 "name": { 168 "type": "Identifier", 169 "name": "o", 170 "typeAnnotation": { 171 "type": "ETSTypeReference", 172 "part": { 173 "type": "ETSTypeReferencePart", 174 "name": { 175 "type": "Identifier", 176 "name": "A", 177 "decorators": [], 178 "loc": { 179 "start": { 180 "line": 22, 181 "column": 16 182 }, 183 "end": { 184 "line": 22, 185 "column": 17 186 } 187 } 188 }, 189 "loc": { 190 "start": { 191 "line": 22, 192 "column": 16 193 }, 194 "end": { 195 "line": 22, 196 "column": 18 197 } 198 } 199 }, 200 "loc": { 201 "start": { 202 "line": 22, 203 "column": 16 204 }, 205 "end": { 206 "line": 22, 207 "column": 18 208 } 209 } 210 }, 211 "decorators": [], 212 "loc": { 213 "start": { 214 "line": 22, 215 "column": 13 216 }, 217 "end": { 218 "line": 22, 219 "column": 18 220 } 221 } 222 }, 223 "loc": { 224 "start": { 225 "line": 22, 226 "column": 13 227 }, 228 "end": { 229 "line": 22, 230 "column": 18 231 } 232 } 233 } 234 ], 235 "returnType": { 236 "type": "ETSPrimitiveType", 237 "loc": { 238 "start": { 239 "line": 22, 240 "column": 20 241 }, 242 "end": { 243 "line": 22, 244 "column": 27 245 } 246 } 247 }, 248 "body": { 249 "type": "BlockStatement", 250 "statements": [ 251 { 252 "type": "ReturnStatement", 253 "argument": { 254 "type": "BinaryExpression", 255 "operator": "instanceof", 256 "left": { 257 "type": "Identifier", 258 "name": "o", 259 "decorators": [], 260 "loc": { 261 "start": { 262 "line": 23, 263 "column": 12 264 }, 265 "end": { 266 "line": 23, 267 "column": 13 268 } 269 } 270 }, 271 "right": { 272 "type": "ETSTypeReference", 273 "part": { 274 "type": "ETSTypeReferencePart", 275 "name": { 276 "type": "Identifier", 277 "name": "JSValue", 278 "decorators": [], 279 "loc": { 280 "start": { 281 "line": 23, 282 "column": 25 283 }, 284 "end": { 285 "line": 23, 286 "column": 32 287 } 288 } 289 }, 290 "loc": { 291 "start": { 292 "line": 23, 293 "column": 25 294 }, 295 "end": { 296 "line": 23, 297 "column": 33 298 } 299 } 300 }, 301 "loc": { 302 "start": { 303 "line": 23, 304 "column": 25 305 }, 306 "end": { 307 "line": 23, 308 "column": 33 309 } 310 } 311 }, 312 "loc": { 313 "start": { 314 "line": 23, 315 "column": 12 316 }, 317 "end": { 318 "line": 23, 319 "column": 33 320 } 321 } 322 }, 323 "loc": { 324 "start": { 325 "line": 23, 326 "column": 5 327 }, 328 "end": { 329 "line": 23, 330 "column": 33 331 } 332 } 333 } 334 ], 335 "loc": { 336 "start": { 337 "line": 22, 338 "column": 28 339 }, 340 "end": { 341 "line": 24, 342 "column": 2 343 } 344 } 345 }, 346 "loc": { 347 "start": { 348 "line": 22, 349 "column": 12 350 }, 351 "end": { 352 "line": 24, 353 "column": 2 354 } 355 } 356 }, 357 "loc": { 358 "start": { 359 "line": 22, 360 "column": 12 361 }, 362 "end": { 363 "line": 24, 364 "column": 2 365 } 366 } 367 }, 368 "overloads": [], 369 "decorators": [], 370 "loc": { 371 "start": { 372 "line": 22, 373 "column": 1 374 }, 375 "end": { 376 "line": 24, 377 "column": 2 378 } 379 } 380 } 381 ], 382 "loc": { 383 "start": { 384 "line": 1, 385 "column": 1 386 }, 387 "end": { 388 "line": 1, 389 "column": 1 390 } 391 } 392 }, 393 "loc": { 394 "start": { 395 "line": 1, 396 "column": 1 397 }, 398 "end": { 399 "line": 1, 400 "column": 1 401 } 402 } 403 }, 404 { 405 "type": "ClassDeclaration", 406 "definition": { 407 "id": { 408 "type": "Identifier", 409 "name": "A", 410 "decorators": [], 411 "loc": { 412 "start": { 413 "line": 20, 414 "column": 7 415 }, 416 "end": { 417 "line": 20, 418 "column": 8 419 } 420 } 421 }, 422 "superClass": null, 423 "implements": [], 424 "body": [ 425 { 426 "type": "MethodDefinition", 427 "key": { 428 "type": "Identifier", 429 "name": "constructor", 430 "decorators": [], 431 "loc": { 432 "start": { 433 "line": 1, 434 "column": 1 435 }, 436 "end": { 437 "line": 1, 438 "column": 1 439 } 440 } 441 }, 442 "kind": "constructor", 443 "static": false, 444 "optional": false, 445 "computed": false, 446 "value": { 447 "type": "FunctionExpression", 448 "function": { 449 "type": "ScriptFunction", 450 "id": { 451 "type": "Identifier", 452 "name": "constructor", 453 "decorators": [], 454 "loc": { 455 "start": { 456 "line": 1, 457 "column": 1 458 }, 459 "end": { 460 "line": 1, 461 "column": 1 462 } 463 } 464 }, 465 "generator": false, 466 "async": false, 467 "expression": false, 468 "params": [], 469 "body": { 470 "type": "BlockStatement", 471 "statements": [], 472 "loc": { 473 "start": { 474 "line": 1, 475 "column": 1 476 }, 477 "end": { 478 "line": 1, 479 "column": 1 480 } 481 } 482 }, 483 "loc": { 484 "start": { 485 "line": 1, 486 "column": 1 487 }, 488 "end": { 489 "line": 1, 490 "column": 1 491 } 492 } 493 }, 494 "loc": { 495 "start": { 496 "line": 1, 497 "column": 1 498 }, 499 "end": { 500 "line": 1, 501 "column": 1 502 } 503 } 504 }, 505 "overloads": [], 506 "decorators": [], 507 "loc": { 508 "start": { 509 "line": 20, 510 "column": 11 511 }, 512 "end": { 513 "line": 20, 514 "column": 11 515 } 516 } 517 } 518 ], 519 "loc": { 520 "start": { 521 "line": 20, 522 "column": 9 523 }, 524 "end": { 525 "line": 20, 526 "column": 11 527 } 528 } 529 }, 530 "loc": { 531 "start": { 532 "line": 20, 533 "column": 1 534 }, 535 "end": { 536 "line": 20, 537 "column": 11 538 } 539 } 540 } 541 ], 542 "loc": { 543 "start": { 544 "line": 1, 545 "column": 1 546 }, 547 "end": { 548 "line": 25, 549 "column": 1 550 } 551 } 552} 553