내가 그러나 I가 this
에 문제 데 바벨-polyfill/바벨 프리셋-es2017와 비동기 함수 방법을 사용하는 객체를 생성 비동기 객체 메소드 내측이 :는
let obj =() => {
return {
doAsync: async() => {
let thing = await longProcess()
return this.transform(thing)
},
transform: (thing) => {
return psuedoCodeTransform(thing)
}
}
}
let instance = obj()
instance.doAsync()
// TypeError: cannot read property 'transform' of undefined`.
에 설명이 뭔가 ES2017, babel-polyfill/regenerator 런 타임 잡았습니까?
이 화살표의 기능을 가진'async' /'await' 모든 것을 함께 할 수 없다. – Bergi
ES7! == ES2017 ... –