Bug 140493 - Const declaration should throw TypeError if there is another declaration of the same name
Summary: Const declaration should throw TypeError if there is another declaration of t...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-15 00:48 PST by Ryosuke Niwa
Modified: 2015-01-15 01:52 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.