IIlya TrubachevAnnotations support
b9871822创建于 2024年9月11日历史提交
{
  "type": "Program",
  "statements": [
    {
      "type": "ClassDeclaration",
      "definition": {
        "id": {
          "type": "Identifier",
          "name": "async",
          "loc": {
            "start": {
              "line": 17,
              "column": 7
            },
            "end": {
              "line": 17,
              "column": 12
            }
          }
        },
        "typeParameters": {
          "type": "TSTypeParameterDeclaration",
          "params": [
            {
              "type": "TSTypeParameter",
              "name": {
                "type": "Identifier",
                "name": "T",
                "loc": {
                  "start": {
                    "line": 17,
                    "column": 13
                  },
                  "end": {
                    "line": 17,
                    "column": 14
                  }
                }
              },
              "in": false,
              "out": false,
              "loc": {
                "start": {
                  "line": 17,
                  "column": 13
                },
                "end": {
                  "line": 17,
                  "column": 15
                }
              }
            }
          ],
          "loc": {
            "start": {
              "line": 17,
              "column": 12
            },
            "end": {
              "line": 17,
              "column": 15
            }
          }
        },
        "superClass": null,
        "implements": [],
        "constructor": {
          "type": "MethodDefinition",
          "key": {
            "type": "Identifier",
            "name": "constructor",
            "loc": {
              "start": {
                "line": 19,
                "column": 5
              },
              "end": {
                "line": 19,
                "column": 16
              }
            }
          },
          "kind": "constructor",
          "static": false,
          "optional": false,
          "computed": false,
          "value": {
            "type": "FunctionExpression",
            "function": {
              "type": "ScriptFunction",
              "id": null,
              "generator": false,
              "async": false,
              "expression": false,
              "params": [
                {
                  "type": "Identifier",
                  "name": "name",
                  "typeAnnotation": {
                    "type": "TSTypeReference",
                    "typeName": {
                      "type": "Identifier",
                      "name": "T",
                      "loc": {
                        "start": {
                          "line": 19,
                          "column": 23
                        },
                        "end": {
                          "line": 19,
                          "column": 24
                        }
                      }
                    },
                    "loc": {
                      "start": {
                        "line": 19,
                        "column": 23
                      },
                      "end": {
                        "line": 19,
                        "column": 24
                      }
                    }
                  },
                  "loc": {
                    "start": {
                      "line": 19,
                      "column": 17
                    },
                    "end": {
                      "line": 19,
                      "column": 21
                    }
                  }
                }
              ],
              "body": {
                "type": "BlockStatement",
                "statements": [
                  {
                    "type": "ExpressionStatement",
                    "expression": {
                      "type": "AssignmentExpression",
                      "operator": "=",
                      "left": {
                        "type": "MemberExpression",
                        "object": {
                          "type": "ThisExpression",
                          "loc": {
                            "start": {
                              "line": 20,
                              "column": 8
                            },
                            "end": {
                              "line": 20,
                              "column": 12
                            }
                          }
                        },
                        "property": {
                          "type": "Identifier",
                          "name": "name",
                          "loc": {
                            "start": {
                              "line": 20,
                              "column": 13
                            },
                            "end": {
                              "line": 20,
                              "column": 17
                            }
                          }
                        },
                        "computed": false,
                        "optional": false,
                        "loc": {
                          "start": {
                            "line": 20,
                            "column": 8
                          },
                          "end": {
                            "line": 20,
                            "column": 17
                          }
                        }
                      },
                      "right": {
                        "type": "Identifier",
                        "name": "name",
                        "loc": {
                          "start": {
                            "line": 20,
                            "column": 20
                          },
                          "end": {
                            "line": 20,
                            "column": 24
                          }
                        }
                      },
                      "loc": {
                        "start": {
                          "line": 20,
                          "column": 8
                        },
                        "end": {
                          "line": 20,
                          "column": 24
                        }
                      }
                    },
                    "loc": {
                      "start": {
                        "line": 20,
                        "column": 8
                      },
                      "end": {
                        "line": 20,
                        "column": 25
                      }
                    }
                  }
                ],
                "loc": {
                  "start": {
                    "line": 19,
                    "column": 26
                  },
                  "end": {
                    "line": 21,
                    "column": 6
                  }
                }
              },
              "loc": {
                "start": {
                  "line": 19,
                  "column": 16
                },
                "end": {
                  "line": 21,
                  "column": 6
                }
              }
            },
            "loc": {
              "start": {
                "line": 19,
                "column": 16
              },
              "end": {
                "line": 21,
                "column": 6
              }
            }
          },
          "overloads": [],
          "decorators": [],
          "annotations": [],
          "loc": {
            "start": {
              "line": 19,
              "column": 5
            },
            "end": {
              "line": 21,
              "column": 6
            }
          }
        },
        "body": [
          {
            "type": "ClassProperty",
            "key": {
              "type": "Identifier",
              "name": "name",
              "loc": {
                "start": {
                  "line": 18,
                  "column": 5
                },
                "end": {
                  "line": 18,
                  "column": 9
                }
              }
            },
            "static": false,
            "readonly": false,
            "declare": false,
            "optional": false,
            "computed": false,
            "typeAnnotation": {
              "type": "TSTypeReference",
              "typeName": {
                "type": "Identifier",
                "name": "T",
                "loc": {
                  "start": {
                    "line": 18,
                    "column": 11
                  },
                  "end": {
                    "line": 18,
                    "column": 12
                  }
                }
              },
              "loc": {
                "start": {
                  "line": 18,
                  "column": 11
                },
                "end": {
                  "line": 18,
                  "column": 12
                }
              }
            },
            "decorators": [],
            "loc": {
              "start": {
                "line": 18,
                "column": 5
              },
              "end": {
                "line": 18,
                "column": 9
              }
            }
          },
          {
            "type": "MethodDefinition",
            "key": {
              "type": "Identifier",
              "name": "getName",
              "loc": {
                "start": {
                  "line": 22,
                  "column": 5
                },
                "end": {
                  "line": 22,
                  "column": 12
                }
              }
            },
            "kind": "method",
            "static": false,
            "optional": false,
            "computed": false,
            "value": {
              "type": "FunctionExpression",
              "function": {
                "type": "ScriptFunction",
                "id": null,
                "generator": false,
                "async": false,
                "expression": false,
                "params": [],
                "returnType": {
                  "type": "TSTypeReference",
                  "typeName": {
                    "type": "Identifier",
                    "name": "T",
                    "loc": {
                      "start": {
                        "line": 22,
                        "column": 16
                      },
                      "end": {
                        "line": 22,
                        "column": 17
                      }
                    }
                  },
                  "loc": {
                    "start": {
                      "line": 22,
                      "column": 16
                    },
                    "end": {
                      "line": 22,
                      "column": 17
                    }
                  }
                },
                "body": {
                  "type": "BlockStatement",
                  "statements": [
                    {
                      "type": "ReturnStatement",
                      "argument": {
                        "type": "MemberExpression",
                        "object": {
                          "type": "ThisExpression",
                          "loc": {
                            "start": {
                              "line": 23,
                              "column": 15
                            },
                            "end": {
                              "line": 23,
                              "column": 19
                            }
                          }
                        },
                        "property": {
                          "type": "Identifier",
                          "name": "name",
                          "loc": {
                            "start": {
                              "line": 23,
                              "column": 20
                            },
                            "end": {
                              "line": 23,
                              "column": 24
                            }
                          }
                        },
                        "computed": false,
                        "optional": false,
                        "loc": {
                          "start": {
                            "line": 23,
                            "column": 15
                          },
                          "end": {
                            "line": 23,
                            "column": 24
                          }
                        }
                      },
                      "loc": {
                        "start": {
                          "line": 23,
                          "column": 8
                        },
                        "end": {
                          "line": 23,
                          "column": 25
                        }
                      }
                    }
                  ],
                  "loc": {
                    "start": {
                      "line": 22,
                      "column": 18
                    },
                    "end": {
                      "line": 24,
                      "column": 6
                    }
                  }
                },
                "loc": {
                  "start": {
                    "line": 22,
                    "column": 12
                  },
                  "end": {
                    "line": 24,
                    "column": 6
                  }
                }
              },
              "loc": {
                "start": {
                  "line": 22,
                  "column": 12
                },
                "end": {
                  "line": 24,
                  "column": 6
                }
              }
            },
            "overloads": [],
            "decorators": [],
            "annotations": [],
            "loc": {
              "start": {
                "line": 22,
                "column": 5
              },
              "end": {
                "line": 24,
                "column": 6
              }
            }
          }
        ],
        "indexSignatures": [],
        "loc": {
          "start": {
            "line": 17,
            "column": 16
          },
          "end": {
            "line": 25,
            "column": 2
          }
        }
      },
      "decorators": [],
      "isAnnotationDeclaration": false,
      "loc": {
        "start": {
          "line": 17,
          "column": 1
        },
        "end": {
          "line": 25,
          "column": 2
        }
      }
    },
    {
      "type": "TSTypeAliasDeclaration",
      "id": {
        "type": "Identifier",
        "name": "xxx",
        "loc": {
          "start": {
            "line": 27,
            "column": 6
          },
          "end": {
            "line": 27,
            "column": 9
          }
        }
      },
      "typeAnnotation": {
        "type": "TSStringKeyword",
        "loc": {
          "start": {
            "line": 27,
            "column": 12
          },
          "end": {
            "line": 27,
            "column": 18
          }
        }
      },
      "loc": {
        "start": {
          "line": 27,
          "column": 1
        },
        "end": {
          "line": 27,
          "column": 19
        }
      }
    },
    {
      "type": "VariableDeclaration",
      "declarations": [
        {
          "type": "VariableDeclarator",
          "id": {
            "type": "Identifier",
            "name": "obj",
            "loc": {
              "start": {
                "line": 28,
                "column": 5
              },
              "end": {
                "line": 28,
                "column": 8
              }
            }
          },
          "init": {
            "type": "NewExpression",
            "callee": {
              "type": "Identifier",
              "name": "async",
              "loc": {
                "start": {
                  "line": 28,
                  "column": 15
                },
                "end": {
                  "line": 28,
                  "column": 20
                }
              }
            },
            "typeParameters": {
              "type": "TSTypeParameterInstantiation",
              "params": [
                {
                  "type": "TSTypeReference",
                  "typeName": {
                    "type": "Identifier",
                    "name": "xxx",
                    "loc": {
                      "start": {
                        "line": 28,
                        "column": 21
                      },
                      "end": {
                        "line": 28,
                        "column": 24
                      }
                    }
                  },
                  "loc": {
                    "start": {
                      "line": 28,
                      "column": 21
                    },
                    "end": {
                      "line": 28,
                      "column": 24
                    }
                  }
                }
              ],
              "loc": {
                "start": {
                  "line": 28,
                  "column": 20
                },
                "end": {
                  "line": 28,
                  "column": 25
                }
              }
            },
            "arguments": [
              {
                "type": "StringLiteral",
                "value": "Class_async",
                "loc": {
                  "start": {
                    "line": 28,
                    "column": 26
                  },
                  "end": {
                    "line": 28,
                    "column": 39
                  }
                }
              }
            ],
            "loc": {
              "start": {
                "line": 28,
                "column": 11
              },
              "end": {
                "line": 28,
                "column": 40
              }
            }
          },
          "loc": {
            "start": {
              "line": 28,
              "column": 5
            },
            "end": {
              "line": 28,
              "column": 40
            }
          }
        }
      ],
      "kind": "var",
      "loc": {
        "start": {
          "line": 28,
          "column": 1
        },
        "end": {
          "line": 28,
          "column": 41
        }
      }
    }
  ],
  "loc": {
    "start": {
      "line": 1,
      "column": 1
    },
    "end": {
      "line": 29,
      "column": 1
    }
  }
}