GDQuest / learn-gdscript

Learn Godot's GDScript programming language from zero, right in your browser, for free.
https://gdquest.github.io/learn-gdscript/
Other
2.07k stars 153 forks source link

Interpreter freezes upon trying to call non-existing member functions #618

Closed MarioLiebisch closed 2 years ago

MarioLiebisch commented 2 years ago

Describe the bug Calling a non-existing member function in any lesson freezes the whole app with an uncaught runtime error popping up in the (browser) console: null function or function signature mismatch.

To Reproduce Steps to reproduce the bug:

  1. Open any practice.
  2. Define a new variable or use an existing one and call any non-existing member.
  3. Click on Run.
  4. The app freezes, triggering the runtime error.

Expected behavior The non-existing member should be noted instead of the app freezing.

Screenshots While this example is artificial, I've noticed it by making a typo using pop_font() rather than pop_front(). gdquest-bug

Information about your device (please complete the following information):

NathanLovato commented 2 years ago

We either need to add features to our mini tokenizer or get access to the parser to address this.

It should be possible to tokenize only function calls and variable accesses causing this crash and check they're valid using code reflection, though it's quite a bit of work, so help would be welcome.

See GDScriptMiniTokenizer.gd and how we address recursive function calls this way.