codecombat / codecombat/esper.js

Redeclaration of const should throw SyntaxError

Open
#15 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
99
Forks
21
PR merge metrics
No merged PRs in 30d

Description

You can do attempt to change a const variable without any error. For example, it should throw an error SyntaxError: redeclaration of const y instead of silently not reassigning y in this code

const y = 2;
y = 4;
print(y); // prints 2

Contributor guide

No contributing guide indexed for this repository

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

Start by reproducing the issue with the provided const y example and trace the interpreter's handling of const declarations and later assignments. Done means assigning to a const throws SyntaxError: redeclaration of const y instead of silently leaving y unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Bug
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.