Port StringBuffer to JS.