Skip to content
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

AST error on a file #31

Open
Berkmann18 opened this issue Oct 16, 2018 · 5 comments
Open

AST error on a file #31

Berkmann18 opened this issue Oct 16, 2018 · 5 comments

Comments

@Berkmann18
Copy link
Contributor

Berkmann18 commented Oct 16, 2018

I'm working on a project and when I'm trying to generate the flowchart for all files, everything but one goes well.
I haven't properly dug into the code as I'm really busy at the moment but thought it would be better to have this issue known.

Error at buildFlowTreeFromAstt.isTSTypeAssertion is not a function
                                                                                       /mnt/c/Users/max/Projects/hashmyjs/node_modules/js2flowchart/dist/js2flowchart.js:39700
                                                                                            throw e;
                                                                                                                                                                ^
                                                                                                                                                                                                                                                                                                                               TypeError: t.isTSTypeAssertion is not a function
                                                                                                                            at ConditionalExpression (/mnt/c/Users/max/Projects/hashmyjs/node_modules/js2flowchart/dist/js2flowchart.js:3916:82)
                                                    at ArrowFunctionExpression (/mnt/c/Users/max/Projects/hashmyjs/node_modules/js2flowchart/dist/js2flowchart.js:3910:43)
                                                  at find (/mnt/c/Users/max/Projects/hashmyjs/node_modules/js2flowchart/dist/js2flowchart.js:3695:15)
                                                                     at Object.needsParens (/mnt/c/Users/max/Projects/hashmyjs/node_modules/js2flowchart/dist/js2flowchart.js:3748:10)
                                                       at Generator.print (/mnt/c/Users/max/Projects/hashmyjs/node_modules/js2flowchart/dist/js2flowchart.js:4497:25)
                                                          at Generator.printJoin (/mnt/c/Users/max/Projects/hashmyjs/node_modules/js2flowchart/dist/js2flowchart.js:4576:12)
                                                      at Generator.printList (/mnt/c/Users/max/Projects/hashmyjs/node_modules/js2flowchart/dist/js2flowchart.js:4648:17)
                                                      at Generator.CallExpression (/mnt/c/Users/max/Projects/hashmyjs/node_modules/js2flowchart/dist/js2flowchart.js:1019:8)
                                                  at /mnt/c/Users/max/Projects/hashmyjs/node_modules/js2flowchart/dist/js2flowchart.js:4509:23
                                                                            at Buffer.withSource (/mnt/c/Users/max/Projects/hashmyjs/node_modules/js2flowchart/dist/js2flowchart.js:614:28)
@Bogdan-Lyashenko
Copy link
Owner

Hm..

const readIn = () => {
  return new Promise(() => {
   
  })
};

this code seems to fail.. has not sense to me, I can have a look later.

@ugrg
Copy link

ugrg commented Dec 13, 2018

if code is

let a = {
  	"b" : false ? 0 : 1
}

or

let a=[()=>{ }]

Will also appear

@Berkmann18
Copy link
Contributor Author

@Bogdan-Lyashenko Have you had a chance to look at the minimal example?

@chucklu
Copy link

chucklu commented Jun 29, 2019

Encounter the same error when try to analyze https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.fileupload.js

PS C:\repository\GitHub\Other\jQuery-File-Upload\js> js2flowchart.cmd .\jquery.fileupload.js
Error at buildFlowTreeFromAstt.isTSTypeAssertion is not a function
C:\Users\clu\AppData\Local\Yarn\Data\global\node_modules\js2flowchart\dist\js2flowchart.js:39700
                throw e;
                ^

TypeError: t.isTSTypeAssertion is not a function
    at ConditionalExpression (C:\Users\clu\AppData\Local\Yarn\Data\global\node_modules\js2flowchart\dist\js2flowchart.js:3916:82)
    at AssignmentExpression (C:\Users\clu\AppData\Local\Yarn\Data\global\node_modules\js2flowchart\dist\js2flowchart.js:3927:34)
    at find (C:\Users\clu\AppData\Local\Yarn\Data\global\node_modules\js2flowchart\dist\js2flowchart.js:3695:15)
    at Object.needsParens (C:\Users\clu\AppData\Local\Yarn\Data\global\node_modules\js2flowchart\dist\js2flowchart.js:3748:10)
    at Generator.print (C:\Users\clu\AppData\Local\Yarn\Data\global\node_modules\js2flowchart\dist\js2flowchart.js:4497:25)
    at Generator.AssignmentExpression (C:\Users\clu\AppData\Local\Yarn\Data\global\node_modules\js2flowchart\dist\js2flowchart.js:1085:8)
    at C:\Users\clu\AppData\Local\Yarn\Data\global\node_modules\js2flowchart\dist\js2flowchart.js:4509:23
    at Buffer.withSource (C:\Users\clu\AppData\Local\Yarn\Data\global\node_modules\js2flowchart\dist\js2flowchart.js:614:28)
    at Generator.withSource (C:\Users\clu\AppData\Local\Yarn\Data\global\node_modules\js2flowchart\dist\js2flowchart.js:4380:15)
    at Generator.print (C:\Users\clu\AppData\Local\Yarn\Data\global\node_modules\js2flowchart\dist\js2flowchart.js:4508:10)

@chucklu
Copy link

chucklu commented Jun 30, 2019

The same problem exists for https://github.com/blueimp/JavaScript-Load-Image/blob/master/js/load-image.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants