Coder Social home page Coder Social logo

Comments (4)

kg avatar kg commented on August 10, 2024

Can you provide an example?

MakeSealedTypeGetter should construct a function that, when called, initializes the type. It shouldn't initialize the type itself when called.

from jsil.

kg avatar kg commented on August 10, 2024

To clarify:

Sealing of types only occurs in queued initializers, which are created at the end of each generated file. Sealing should never occur after that, so running a static constructor shouldn't cause types to become sealed.

There was a race condition of sorts where .Of(T) could be called on a generic type before it was fully defined. This caused all sorts of problems, and I could see how maybe that would make you think that things were going wrong with type sealing, but really the root problem was .Of(T) being called too early. I've worked around this by ensuring that base types are always deferred if they are generic, so that .Of(T) doesn't actually get called until after type sealing has occurred.

P.S. Fuck, I hate JavaScript.

from jsil.

robashton avatar robashton commented on August 10, 2024

Hah, okay - well I'll run this over the old version of my code that raised all these issues in the first place and see what creeps up- I've decided that I'm going to go with a solution for the SLJS project which involves re-implementing most of the SL stuff manually, too many issues in trying to bring across ported code from either moonlight or MS stuff itself. (Mainly due to the amount of native code as well as the way things are bound together)

Should make a lot progress now I've decided to write a crap load of javascript, I like writing crap loads of code. Getting to grips with the way JSIL is structured now too, so can probably contribute a bit more - it's a complex beast so it takes some time to know that the changes you're making aren't causing issues :-)

PS: I actually rather like JavaScript, quirky as it is :-)

from jsil.

kg avatar kg commented on August 10, 2024

The order-independence branch ( https://github.com/kevingadd/JSIL/tree/order-independence ) makes significant changes to type initialization, sealing, and assembly loading. I think it should address all of your issues here. Let me know if you get a chance to try it out (things may be horribly broken).

from jsil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.