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

[javascript] Cannot resolve Destructuring Assignment for new object #77

Open
ZLY201 opened this issue Mar 10, 2023 · 1 comment
Open

Comments

@ZLY201
Copy link

ZLY201 commented Mar 10, 2023

It can resolve:

const { host, protocol } = URL(origin);

and

const url = new URL(origin);

but when I use:

const { host, protocol } = new URL(origin);

It caught an error:

Traceback (most recent call last):
  File "/opt/homebrew/bin/code2flow", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/lib/python3.10/site-packages/code2flow/engine.py", line 860, in main
    code2flow(
  File "/opt/homebrew/lib/python3.10/site-packages/code2flow/engine.py", line 734, in code2flow
    file_groups, all_nodes, edges = map_it(sources, language, no_trimming,
  File "/opt/homebrew/lib/python3.10/site-packages/code2flow/engine.py", line 478, in map_it
    file_group = make_file_group(file_ast_tree, source, extension)
  File "/opt/homebrew/lib/python3.10/site-packages/code2flow/engine.py", line 356, in make_file_group
    for new_node in language.make_nodes(node_tree, parent=file_group):
  File "/opt/homebrew/lib/python3.10/site-packages/code2flow/javascript.py", line 354, in make_nodes
    variables = make_local_variables(this_scope_body, parent)
  File "/opt/homebrew/lib/python3.10/site-packages/code2flow/javascript.py", line 193, in make_local_variables
    variables += process_assign(element)
  File "/opt/homebrew/lib/python3.10/site-packages/code2flow/javascript.py", line 134, in process_assign
    token = target['id']['name']
KeyError: 'name'
@ZLY201 ZLY201 changed the title Cannot resolve Destructuring Assignment for new object [javascript] Cannot resolve Destructuring Assignment for new object Mar 10, 2023
@ZLY201
Copy link
Author

ZLY201 commented Mar 17, 2023

@scottrogowski Do you have time to have a look? #78

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

1 participant