chakra-core / chakra-core/ChakraCore

Redeclaration of a function* inside a block definition

Open
#6,459 2 comments 0 reactions 0 assignees View on GitHub
Bug help wanted
Dominant language
JavaScript
Stars
9.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Hi everyone,
I found a case of redeclaration of a generator function inside a block definition.

version: 1.11.19
OS: Linux Ubuntu 19.10 x64

steps to reproduce:

{
function* f() { yield 1 }
function f() { print(2) }
}
f()
Actual results:
2

Expected results:
SyntaxError: Identifier 'f' has already been declared

V8, SpiderMonkey works as expected.

cinfuzz

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.