Add shared pointer support in javascript