Re: minisphere 1.1b1 (stable: 1.0.10)
Reply #395 –
I haven't looked particularly hard, but I did find this:
Turbo.LoadSystemScheme = function(name){
var scheme_file = new RawFile("#~/formats/"+name);
var scheme_buffer = scheme_file.read(scheme_file.size);
var scheme_byteview = new Uint8Array(scheme_buffer);
var scheme_bytearray = ByteArrayFromTypedArray(scheme_byteview);
return JSON.parse(CreateStringFromByteArray(scheme_bytearray));
}
Which is the most schizophrenic piece of code I've ever seen.
You go from a ByteArray (returned by RawFile:read) to a Uint8Array, back to a ByteArray again, and finally to a string before parsing it as JSON. Were you just stress-testing the ByteArray stuff on purpose or what?
Also, bytearray.js RequireSystemScript's arraybuffer_bytearray.js without checking to see if a native ByteArray already exists.