andrei-markeev / ts2c

Convert Javascript/TypeScript to C
ISC License
1.26k stars 95 forks source link

Can not compile class #61

Open RonkTsang opened 4 years ago

RonkTsang commented 4 years ago

I try some code in playground, and I get a Error when I try to write class.

// code:
function A() {
  this.a = 2
}

A.prototype.change = function () {
  this.a = 3
}

and I got the Error:

Transpilation failed. TypeError: Cannot read property 'length' of undefined

This project is cool ~

andrei-markeev commented 4 years ago

prototype is not yet supported. Currently finalizing closures, probably prototypes will be the next step after that.