chakra-core/ChakraCore

Redeclaration of a function* inside a block definition

Aperta

#6459 aperta il 8 giu 2020

 (2 commenti) (0 reazioni) (0 assegnatari)JavaScript (1225 fork)batch import
Bughelp wanted

Metriche repository

Star
 (9258 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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

Guida contributor