-
-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop shadowing haxe.io.Bytes
.
#1765
base: 8.3.0-Dev
Are you sure you want to change the base?
Conversation
Agreed. I'd even go as far as saying it should never be done. It's one thing to shadow another library's class, if you know the risks and there's seemingly no other choice. It's a giant can of Cthulhus to shadow a standard library class. |
I may be showing my ignorance here, but doesn't webassembly support come from hxcpp? I'm surprised that the cpp flag isn't set when targeting wasm. |
I've never used Wasm, so I wouldn't know. I prefer to only make changes that I fully understand. But if we can test it and show that the |
4e8757e
to
adfd15e
Compare
I tested, and the flag is indeed set. That makes things much simpler! And it makes sense. Why would C++ functionality like the |
Update: this must be merged by the time Haxe 5 releases. |
Lime's version of the class has fallen behind Haxe's over time, and I believe it's past time to return to using their version. Shadowing a core class should always be a last resort.
Lime does add a few things to the class, so we want to make sure we can still get the same functionality.
@:autoBuild
metadata to enable asset embedding. I usedCompiler.addMetadata()
to achieve the same.lime_bytes_length_getter
flag to allow settinglength
. This appears to be used by openfl-js, though there are other ways to achieve the same thing, so I submitted MakeByteArray
compatible with Haxe'sBytes
class. openfl#2692.& 0xFF
operations. The Haxe devs have gone on record saying this isn't needed, so I left them out.#if cpp
with#if (cpp || webassembly)
. Edit: this is redundant, because thecpp
flag is set when targeting WebAssembly. I left it out.I checked line by line in a diff editor to make sure that was everything. All other differences either had no functional effect (whitespace and so on), or were because Haxe's version was newer.