Include name when trying to invoke non-functional variables and properties.

Open
#217 3 comments 3 reactions 0 assignees View on GitHub

Maintainers usually reply within 5 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, javascript
Domain
compilers

Research direction

Start by reproducing the issue with the two command-line examples using ./qjs and compare the resulting diagnostics. Trace the QuickJS C implementation responsible for invoking non-callable values, then verify that errors identify the relevant variable or property without regressing the existing TypeError behavior.

Written by the indexing model from the issue text.

Description

It would be fantastic if we could get the name of the property or variable we're trying to invoke for debugging purposes.

./qjs -e "const a = {};a()"

TypeError: not a function
    at <eval> (<cmdline>:1)

In node this helps with debugging:

node -e "const a = {};a()"

[eval]:1
const a = {};a()
             ^

TypeError: a is not a function
    at [eval]:1:14
Dominant language
C
Stars
11.1k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bellard/quickjs

All issues in bellard/quickjs

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.