함수 재부팅은 컴파일러와 관계가 있습니다

765 단어
기인
jsx 코드를 먼저 볼게요.
class Point {
    var x = 0;
    var y = 0;

    function constructor() {
    }

    function constructor(x : number, y : number) {
        this.set(x, y);
    }

    function constructor(other : Point) {
        this.set(other);
    }

    function set(x : number, y : number) : void {
        this.x = x;
        this.y = y;
    }

    function set(other : Point) : void {
        this.set(other.x, other.y);
    }
}

그중에는 다음과 같은 말이 있다.
The Point#set() functions are also overloaded and the compiler know how to call the correct one.
그 중에서 컴파일러는 어떤 방법을 사용하는지 알 수 있다고 했다.
Inspire the curiosity
이것은 나로 하여금 컴파일 원리와 jsx의 컴파일 실현에 대한 호기심을 불러일으켰다
참고 문헌
https://jsx.github.io/doc/tutorial.html

좋은 웹페이지 즐겨찾기