Ignore:
Timestamp:
Sep 26, 2011, 4:53:42 PM (14 years ago)
Author:
[email protected]
Message:

Make JSCell::toBoolean non-virtual
https://bugs.webkit.org/show_bug.cgi?id=67727

Reviewed by Geoffrey Garen.

JSCell::toBoolean now manually performs the toBoolean check for objects and strings (where
before it was simply virtual and would crash if its implementation was called).
Its descendants in JSObject and JSString have also been made non-virtual. JSCell now
explicitly covers all cases of toBoolean, so having a virtual implementation of
JSCell::toBoolean is no longer necessary. This is part of a larger process of un-virtualizing JSCell.

  • JavaScriptCore.exp:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  • runtime/JSCell.cpp:
  • runtime/JSCell.h:
  • runtime/JSNotAnObject.cpp:
  • runtime/JSNotAnObject.h:
  • runtime/JSObject.h:
  • runtime/JSString.h:

(JSC::JSCell::toBoolean):
(JSC::JSValue::toBoolean):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSNotAnObject.cpp

    r95901 r96045  
    4545
    4646bool JSNotAnObject::getPrimitiveNumber(ExecState* exec, double&, JSValue&)
    47 {
    48     ASSERT_UNUSED(exec, exec->hadException());
    49     return false;
    50 }
    51 
    52 bool JSNotAnObject::toBoolean(ExecState* exec) const
    5347{
    5448    ASSERT_UNUSED(exec, exec->hadException());
Note: See TracChangeset for help on using the changeset viewer.