ts2c
ts2c copied to clipboard
Convert Javascript/TypeScript to C
This prevents a use after free and a valgrind error like this: ``` ==671682== Memcheck, a memory error detector ==671682== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et...
``` var a=[]; a[0]=1; a.push(a); a[2]=a; console.log(a[2][0]); ```
Having the following js: ``` function foo() { var s = "a"; function bar(a) { s += " hello " + a; } bar(5); return s; } console.log(foo()); ``` The...
This is a fun bit of the spec: it doesn't have to be the actual code! "An implementation-dependent representation of the function is returned." This means we can whatever we...
return;
For whatever reason, argument-less return doesn't work: ```js function f() { return; } ``` It _should_ just result in a `return` from c.
Classes shouldn't be too difficult to get working, especially in typescript, and should be even easier than prototypes (i think).
This sounds like multiple issues but they are all related. For the following js code: ``` var s = ""; for (var i = 0; i < 10000; ++i) {...
There're now several simple-to-implement standard calls which can significantly improve overall range of supported by TS2C ES3 features. Very good for start. If somebody wanted to contribute to the project,...
I try some code in playground, and I get a Error when I try to write `class`. ``` js // code: function A() { this.a = 2 } A.prototype.change =...
this would be really usefull if it would be able to implament some standard stuff like a basic http request and response handling or a net socket.