3 ms·
JavaScriptCore is definitely underrated! I've used it for quickly prototyping business logic of apps because you can iterate without having to recompile, reload
by ladberg 4y ago
JavaScriptCore is definitely underrated! I've used it for quickly prototyping business logic of apps because you can iterate without having to recompile, reload, or even reopen the app on device. You can also use Safari to open up a web inspector for the context in your app and do some remote debugging.
- trzy 4y agoQuestion: I couldn’t figure out how to export properties that were writable in JS. I describe the problem in Entity.js. Any pointers would be much appreciated! :)
- ladberg 4y agoUnfortunately I also can't figure that out... The autogenerated bindings from JS <-> ObjC/Swift are pretty opaque and if it doesn't handle your use case then there isn't much you can do without manually binding everything you need. I might recommend using a custom class with getters/setters that don't use the subscript operator. I think on the JS side you can run some code to override [] and point it to the correct functions but I've never tried it out so ymmv.
- trzy 4y agoWell, I feel less bad about myself for getting stuck there :D The semantics of how properties work in JS are so obnoxious. A read-only property can still be replaced entirely, which means e.g.: entity.position = [0,0,0]; Is ok but: entity.position[0] = 1; entity.position[1] = 1; entity.position[3] = 1; Fails (and ChatGPT occasionally tries to do the latter).