When assigning value to a variable in "catch" block, browser always throws InvalidGlobalAssignment exception. Note: this doesn't happen when using JIT. It could be an old problem, but become visible since http://trac.webkit.org/changeset/69940. JSObject* createErrorForInvalidGlobalAssignment(ExecState* exec, const UString& propertyName) { return createReferenceError(exec, makeUString("Strict mode forbids implicit creation of global property '", propertyName, "'")); } A simple test case can reproduce it: <html> <script> try { throw "test"; } catch (e1) { try { var s; s = e1.message; document.write("succeeded"); } catch (e2) { alert(e2); } } </script> <body> </body> </html>
Seems like the problem here is that strict mode is being enforced even in non-strict contexts.
<rdar://problem/8660072>
How did you find this problem? Did you discover this on an actual website?
(In reply to comment #3) > How did you find this problem? Did you discover this on an actual website? It is acid3 I remember.
Don’t want Acid3 to fail!
Weeee, so many bugs in one small test case! The original issue (strict mode applied to non-strict code) was fixed a while ago, but this has exposed a bevy of additional bugs which i am determining the root cause of now.
Created attachment 82661 [details] Patch
Comment on attachment 82661 [details] Patch r=geoff
Committed r78727: <http://trac.webkit.org/changeset/78727>