Throw exceptions when assigning to const in strict mode
https://bugs.webkit.org/show_bug.cgi?id=95894

Reviewed by Oliver Hunt.

Currently, this never happens; but it will start happening once the
callee is a local const register. In this patch, there's no change in
behavior.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitReadOnlyExceptionIfNeeded): Helper function
for doing the throwing.
* bytecompiler/BytecodeGenerator.h:

* bytecompiler/NodesCodegen.cpp:
(JSC::PostfixResolveNode::emitBytecode):
(JSC::PrefixResolveNode::emitBytecode):
(JSC::ReadModifyResolveNode::emitBytecode):
(JSC::AssignResolveNode::emitBytecode): Call the helper function.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
4 files changed