2014-09-04 7 views
0

커피 파일을 잃어 버렸습니다. js 파일을 커피로 추적하려고하는데 js2coffee 사이트를 사용하여이 작업을 수행합니다 ... 그러나이 코드는 혼란 스럽습니다. t 나는 커피에 쓴 기억이것에 해당하는 coffeescript는 무엇입니까

function PersonalEdit() { 
    this.changeNR = __bind(this.changeNR, this); 
    this.changeDisability = __bind(this.changeDisability, this); 
    this.changeMaritalStatus = __bind(this.changeMaritalStatus, this); 
    return PersonalEdit.__super__.constructor.apply(this, arguments); 
    } 

나는 그들이 어떻게이 arrow.but 지방 생성됩니다 알고 __bind..I에 대해 무엇 생성자

constructor: -> 
     super 

에 기능을 다시 추적 할 수 있습니다 생성자에 ...

답변

1

이러한 바인딩은 클래스 메서드 정의에서 fat arrows =>에서 생성되었습니다.

class PersonalEdit 
    constructor: -> 
    super 

    changeNR: => 
    # ... 

    changeDisability: => 
    # ... 

    changeMaritalStatus: => 
    # ... 
+0

슈퍼 멋진 :

그래서 클래스는 다음과 같이 보였다. 감사 – coool

관련 문제