http://trac.webkit.org/browser/trunk/LayoutTests/js/script-tests/class-syntax-name.js#L84 runTestShouldThrow("class A { constructor() { A = 1; } }; new A"); This should not throw. ClassDeclarations do not create an inner const binding. Your code seems to be doing the right thing based on the -expexted.txt Another line to add to this test would be: runTestShouldThrow("class A { constructor() { A = 1; } }; new A; new A"); which should throw because in the second call to `new A` A is 1.
My bad. The test is right and the JSC behavior is wrong. ng.
Saam, did your patch to make class declaration block-scoped fix this?
Yup, this has been fixed by http://trac.webkit.org/changeset/187680