nodejs / nodejs/cjs-module-lexer

this.exportname

Open
#12 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

edge case wontfix
Dominant language
JavaScript
Stars
262
Forks
31
Avg merge
9d 2h
Merged PRs (30d)
5

Description

In CommonJS modules the this assignment also works for named exports:

this.exportName = 'value';

So long as we are at the top-level, the above would be straightforward to track, although it's such an uncommon pattern the benefit would likely be marginal but it seems worth doing nonetheless.

Contributor guide

Open the contributing guide

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.

Research direction

The issue does not name a file or test. Start by locating the CommonJS named-export analysis for top-level assignments, then trace how an assignment such as this.exportName = 'value' is handled. Add coverage for the example and verify that the name is extracted as an export.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.