Changeset 35533 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp


Ignore:
Timestamp:
Aug 3, 2008, 2:58:21 AM (17 years ago)
Author:
[email protected]
Message:

Bug 19359: JavaScriptCore behaves differently from FF2/3 and IE when handling context in catch statement
<https://bugs.webkit.org/show_bug.cgi?id=19359>

Reviewed by Cameron Zwarich

Make our catch behave like Firefox and IE, we do this by using a StaticScopeObject
instead of a generic JSObject for the scope node. We still don't make use of the
fact that we have a static scope inside the catch block, so the internal performance
of the catch block is not improved, even though technically it would be possible to
do so.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r35454 r35533  
    16051605        generator.emitJump(handlerEndLabel.get());
    16061606        RefPtr<RegisterID> exceptionRegister = generator.emitCatch(generator.newTemporary(), tryStartLabel.get(), tryEndLabel.get());
    1607         RefPtr<RegisterID> newScope = generator.emitNewObject(generator.newTemporary()); // scope must be protected until popped
    1608         generator.emitPutById(newScope.get(), m_exceptionIdent, exceptionRegister.get());
    1609         exceptionRegister = 0; // Release register used for temporaries
    1610         generator.emitPushScope(newScope.get());
     1607        generator.emitPushNewScope(exceptionRegister.get(), m_exceptionIdent, exceptionRegister.get());
    16111608        generator.emitNode(dst, m_catchBlock.get());
    16121609        generator.emitPopScope();
Note: See TracChangeset for help on using the changeset viewer.