Giter Site home page Giter Site logo

Maximum call stack size exceeded about as3js HOT 13 CLOSED

cleod9 avatar cleod9 commented on July 28, 2024
Maximum call stack size exceeded

from as3js.

Comments (13)

Cleod9 avatar Cleod9 commented on July 28, 2024

Hi @raasumy, do you have regular expression literals in your project? Regex will definitely cause the parser to choke in such a fashion. Also note that the namespace keyword is not supported in this project which is another common issue people have had

from as3js.

raasumy avatar raasumy commented on July 28, 2024

yep, I have some regular expressions used an I just masked them with quote marks so errors on them are not being raised. Then there was one file with namespace declaration on it, removed that file from project. I've examined all the issues opened and closed, seems like nobody else had anything similar.

I also tried using as3js with separate folder that is only a part of my project and it seems to work fine until the last file is parsed and I get "cannot read property 'className' of undefined". As far as I understand it's because there is no document class file in chosen folder and partial compilation fails.

Please share if you have any thoughts how to diagnose this issue properly.

from as3js.

Cleod9 avatar Cleod9 commented on July 28, 2024

It sounds like you did your research! It even appears you tried the verbose flag, correct? The next step would be to narrow down which file is causing the crash. Here's something silly you could try- copy your source files one by one into the demo page and see what errors pop up:

http://as3js.org/demo/

Also be sure to remove all the imports of your classes in this demo to suppress errors, the parser should be able to handle it since without imports it's mostly only looking for the syntax to be correct

from as3js.

raasumy avatar raasumy commented on July 28, 2024

Verbose was also examined, correct.
The thing is that error raises during parsing Main.as, which is aparently the last file to be processed. If I try to convert this file through demo page - everything is ok.

from as3js.

Cleod9 avatar Cleod9 commented on July 28, 2024

Are you ok with sharing the code from your Main.as? This definitely sounds like a bug I haven't encountered yet, I might be able to get to the bottom of it more quickly

from as3js.

raasumy avatar raasumy commented on July 28, 2024

Unfortunately I can't disclose source contents. Currently came up to converting all the files one by one. Boring, silly but effective) I'll try to reproduce the issue on other sources I have that can be disclosed.

from as3js.

Cleod9 avatar Cleod9 commented on July 28, 2024

Alright, that's good to hear the workaround is effective. If you are able to reproduce the issue on purpose I can definitely push a quick fix. Though at the moment I'm not aware of any particular logic that would cause a stack overflow. It definitely appears to be revolving strings in some fashion

from as3js.

letitfly avatar letitfly commented on July 28, 2024

I have a similar issue. I was testing this on D.eval (http://o-minds.com/deval/) and was hit with the following error:

/usr/local/lib/node_modules/as3js/runtime.js:1058
if (c.match(characters)) {
^

RangeError: Maximum call stack size exceeded
at RegExp.exec (native)
at RegExp.Symbol.match
at String.match (native)
at Function.AS3Parser.nextWord (/usr/local/lib/node_modules/as3js/runtime.js:1058:15)
at Function.AS3Parser.parseFunc (/usr/local/lib/node_modules/as3js/runtime.js:1338:31)
at Function.AS3Parser.parseFunc (/usr/local/lib/node_modules/as3js/runtime.js:1406:44)
at Function.AS3Parser.parseFunc (/usr/local/lib/node_modules/as3js/runtime.js:1406:44)
at Function.AS3Parser.parseFunc (/usr/local/lib/node_modules/as3js/runtime.js:1406:44)
at Function.AS3Parser.parseFunc (/usr/local/lib/node_modules/as3js/runtime.js:1406:44)
at Function.AS3Parser.parseFunc (/usr/local/lib/node_modules/as3js/runtime.js:1406:44)

from as3js.

raasumy avatar raasumy commented on July 28, 2024

@letitfly look at any Java Script reference and format you regexp accordingly. In my case it was enough to put it in quotes.

from as3js.

letitfly avatar letitfly commented on July 28, 2024

Anyway, the offending line seems to be a simple statement:

trueNext = falseNext = null;

Once that was changed to two separate statements, the program was able to go through.

from as3js.

letitfly avatar letitfly commented on July 28, 2024

I ran into another problem and I hope it's fine I posted here. The code I tried to convert to js uses flash system libraries. I passed the --ignore-flash and as3js completes, but obviously the resulting code is not runnable. So what are left for me to do?

One of the import is "import flash.utils.describeType;", this is inflection and I suppose it can be implemented in js. Is that the recommended path forward?

from as3js.

Cleod9 avatar Cleod9 commented on July 28, 2024

@letitfly Splitting a problematic line into shorter expressions will almost always to the trick, but I do wonder- were trueNext and falseNext getter/setters? I added special behavior for evaluating those types of statements to ensure better browser compatibility, so the bug could have been with the parser getting confused on the assignment.

As for your other problem, your assumption is correct that flash packages needs to be re-implemented in JavaScript (or if used with this library, could be re-implemented in AS3 alternatively)

from as3js.

Cleod9 avatar Cleod9 commented on July 28, 2024

Closing since this project is obsolete

from as3js.

Related Issues (17)

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.