Changeset 33372 in webkit


Ignore:
Timestamp:
May 13, 2008 12:11:01 AM (16 years ago)
Author:
oliver@apple.com
Message:

Bug 18752: SQUIRRELFISH: exceptions are not always handled by the vm
<https://bugs.webkit.org/show_bug.cgi?id=18752>

Reviewed by Geoff

First step: prevent incorrect evaluation of valueOf/toString conversion
in right hand side of expression after earlier conversion throws.

Location:
branches/squirrelfish/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/squirrelfish/JavaScriptCore/API/JSCallbackObjectFunctions.h

    r33218 r33372  
    367367double JSCallbackObject<Base>::toNumber(ExecState* exec) const
    368368{
     369    // We need this check to guard against the case where this object is rhs of
     370    // a binary expression where lhs threw an exception in its conversion to
     371    // primitive
     372    if (exec->hadException())
     373        return NaN;
    369374    JSContextRef ctx = toRef(exec);
    370375    JSObjectRef thisRef = toRef(this);
  • branches/squirrelfish/JavaScriptCore/ChangeLog

    r33371 r33372  
     12008-05-13  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Geoff.
     4
     5        Bug 18752: SQUIRRELFISH: exceptions are not always handled by the vm
     6        <https://bugs.webkit.org/show_bug.cgi?id=18752>
     7
     8        First step: prevent incorrect evaluation of valueOf/toString conversion
     9        in right hand side of expression after earlier conversion throws.
     10
     11        * API/JSCallbackObjectFunctions.h:
     12        (KJS::::toNumber):
     13        * kjs/object.cpp:
     14        (KJS::JSObject::defaultValue):
     15
    1162008-05-12  Oliver Hunt  <oliver@apple.com>
    217
  • branches/squirrelfish/JavaScriptCore/kjs/object.cpp

    r33366 r33372  
    341341JSValue* JSObject::defaultValue(ExecState* exec, JSType hint) const
    342342{
     343  // We need this check to guard against the case where this object is rhs of
     344  // a binary expression where lhs threw an exception in its conversion to
     345  // primitive
     346  if (exec->hadException())
     347    return exec->exception();
    343348  /* Prefer String for Date objects */
    344349  if ((hint == StringType) || (hint != NumberType && _proto == exec->lexicalGlobalObject()->datePrototype())) {
Note: See TracChangeset for help on using the changeset viewer.