Bug 140493

Summary: Const declaration should throw TypeError if there is another declaration of the same name
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: barraclough, fpizlo, ggaren, ysuzuki
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Ryosuke Niwa 2015-01-15 00:48:27 PST
e.g.

const x = 1;
const x = 2;

Should throw a TypeError since x cannot be declared twice.
Comment 1 Ryosuke Niwa 2015-01-15 01:52:40 PST
It looks like we just need to check if the readonly-ness of a property in LLINT_SLOW_PATH_DECL(slow_path_put_to_scope) and operationPutToScope in JITOperations since ResolveType is always Dynamic for readonly properties.