1TypeError: Right-hand side of instanceof expression must represent a type. [instanceof_object_jsvalue.sts:21: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": 20, 129 "column": 10 130 }, 131 "end": { 132 "line": 20, 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": 20, 153 "column": 10 154 }, 155 "end": { 156 "line": 20, 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": "Object", 177 "decorators": [], 178 "loc": { 179 "start": { 180 "line": 20, 181 "column": 16 182 }, 183 "end": { 184 "line": 20, 185 "column": 22 186 } 187 } 188 }, 189 "loc": { 190 "start": { 191 "line": 20, 192 "column": 16 193 }, 194 "end": { 195 "line": 20, 196 "column": 23 197 } 198 } 199 }, 200 "loc": { 201 "start": { 202 "line": 20, 203 "column": 16 204 }, 205 "end": { 206 "line": 20, 207 "column": 23 208 } 209 } 210 }, 211 "decorators": [], 212 "loc": { 213 "start": { 214 "line": 20, 215 "column": 13 216 }, 217 "end": { 218 "line": 20, 219 "column": 23 220 } 221 } 222 }, 223 "loc": { 224 "start": { 225 "line": 20, 226 "column": 13 227 }, 228 "end": { 229 "line": 20, 230 "column": 23 231 } 232 } 233 } 234 ], 235 "returnType": { 236 "type": "ETSPrimitiveType", 237 "loc": { 238 "start": { 239 "line": 20, 240 "column": 25 241 }, 242 "end": { 243 "line": 20, 244 "column": 32 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": 21, 263 "column": 12 264 }, 265 "end": { 266 "line": 21, 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": 21, 282 "column": 25 283 }, 284 "end": { 285 "line": 21, 286 "column": 32 287 } 288 } 289 }, 290 "loc": { 291 "start": { 292 "line": 21, 293 "column": 25 294 }, 295 "end": { 296 "line": 21, 297 "column": 33 298 } 299 } 300 }, 301 "loc": { 302 "start": { 303 "line": 21, 304 "column": 25 305 }, 306 "end": { 307 "line": 21, 308 "column": 33 309 } 310 } 311 }, 312 "loc": { 313 "start": { 314 "line": 21, 315 "column": 12 316 }, 317 "end": { 318 "line": 21, 319 "column": 33 320 } 321 } 322 }, 323 "loc": { 324 "start": { 325 "line": 21, 326 "column": 5 327 }, 328 "end": { 329 "line": 21, 330 "column": 33 331 } 332 } 333 } 334 ], 335 "loc": { 336 "start": { 337 "line": 20, 338 "column": 33 339 }, 340 "end": { 341 "line": 22, 342 "column": 2 343 } 344 } 345 }, 346 "loc": { 347 "start": { 348 "line": 20, 349 "column": 12 350 }, 351 "end": { 352 "line": 22, 353 "column": 2 354 } 355 } 356 }, 357 "loc": { 358 "start": { 359 "line": 20, 360 "column": 12 361 }, 362 "end": { 363 "line": 22, 364 "column": 2 365 } 366 } 367 }, 368 "overloads": [], 369 "decorators": [], 370 "loc": { 371 "start": { 372 "line": 20, 373 "column": 1 374 }, 375 "end": { 376 "line": 22, 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 "loc": { 406 "start": { 407 "line": 1, 408 "column": 1 409 }, 410 "end": { 411 "line": 23, 412 "column": 1 413 } 414 } 415} 416