implement constructor
fix memory leak when call alloc in js
implement instanceof