fixed double-free of java-script prototype object