upstreaming SpiderShim customizations to DeflateStringToUTF8Buffer

Myk Melez <[email protected]>
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <[email protected]>
SpiderShim currently has a custom implementation of 
DeflateStringToUTF8Buffer [1], since neither of the existing ones (the 
public one in CharacterEncoding and a private one in CTypes) does quite 
what it wants, which is to return a partial result if the destination 
buffer runs out of space (CharacterEncoding requires the buffer to have 
enough space [2]) and continue on a bad surrogate (CTypes aborts on a 
bad surrogate [3]).

It seems like it should be possible to refactor all three 
implementations into a single, public one, or at least to upstream the 
SpiderShim customizations into the public implementation in 
CharacterEncoding (leaving the private implementation in CTypes alone). 
Would the SpiderMonkey team be amenable to that? And is this the right 
forum for such a suggestion, or would it be better to file a bug and 
discuss the proposal there?

-myk

[1] 
https://github.com/mozilla/spidernode/blob/master/deps/spidershim/src/v8string.cc#L455-L538
[2] 
https://dxr.mozilla.org/mozilla-central/rev/e5a10b/js/public/CharacterEncoding.h#208-213
[3] 
https://dxr.mozilla.org/mozilla-central/rev/e5a10b/js/src/ctypes/CTypes.cpp#172-177
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.