Skip to content

An issue about constant #6590

Open
Open
@YiWen-y

Description

@YiWen-y
Version

chakra-1.11.24

Test case
const x = 'const x';
this.x = 20;
delete this.x;
print(this.x);
print(x);
x = 1;
print(x);
Execution steps
./ChakraCore/out/Release/ch testcase.js
Output
undefined
const x
1
Expected behavior
undefined
const x
testcase.js:6:1 TypeError: invalid assignment to const 'x'
Description

In the above test case, the value of the constant x cannot be modified, but chakra did successfully modify the value of x(line 6). Maybe this is a problem with chakra.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions