Giter Club home page Giter Club logo

Comments (14)

waneck avatar waneck commented on May 31, 2024

Try compiling with -dce no

from hscript.

NicoM1 avatar NicoM1 commented on May 31, 2024

how do I do that in an openfl project?

from hscript.

waneck avatar waneck commented on May 31, 2024

Not sure. You'll need to look up for the .nmml docs and see how to pass additional compiler options

from hscript.

NicoM1 avatar NicoM1 commented on May 31, 2024

Do you know where I could find that? sorry to sound clueless:/

from hscript.

waneck avatar waneck commented on May 31, 2024

Try using <haxeflag name="-dce" value="no" /> :
https://gist.github.com/jgranick/1763850#file-gistfile1-xml-L332

from hscript.

NicoM1 avatar NicoM1 commented on May 31, 2024

hmm ok that works (could you explain what it does?) for int iterators 0...1 and array iterators, but interestingly enough, FlxTypedGroup has a custom iterator, so while for (i in group.members) works, for (i in group) still gives me EInvalidIterator((active: true | visible: true | alive: true | exists: true))

from hscript.

waneck avatar waneck commented on May 31, 2024

It may be that its iterator() function has an optional argument ( http://api.haxeflixel.com/flixel/group/FlxTypedGroup.html ). The hscript interpreter is trying to call the function with no arguments, while it needs one argument - it being optional is a compile-time feature.

from hscript.

NicoM1 avatar NicoM1 commented on May 31, 2024

ok, I'll just note it in iceentitys documentation to directly use the members array, thanks:D

from hscript.

ncannasse avatar ncannasse commented on May 31, 2024

You should report to HaxeFlixel that adding optional arguments breaks Dynamic iterators.

from hscript.

NicoM1 avatar NicoM1 commented on May 31, 2024

I mentioned it to @Gama11 on twitter, maybe they can split it into iterator() and filteredIterator(), btw why does keeping dead code fix for-loops?

from hscript.

Gama11 avatar Gama11 commented on May 31, 2024

Hm... I take it this is a limitation of how hscript works (compile time vs runtime?) and there's nothing you can do about it on your side?

from hscript.

Simn avatar Simn commented on May 31, 2024

I'm thinking we should find a way to make hscript always keep IntIterator and its fields. It's a bit silly if this requires DCE disabling.

from hscript.

icek avatar icek commented on May 31, 2024

You should add --macro keep('IntIterator') to extraParams.hxml.

from hscript.

Simn avatar Simn commented on May 31, 2024

That's actually a very good idea!

from hscript.

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.