Changeset 15321 in webkit for trunk/JavaScriptCore/kjs/value.cpp


Ignore:
Timestamp:
Jul 10, 2006, 8:16:41 PM (19 years ago)
Author:
ddkilzer
Message:

JavaScriptCore:

Reviewed by Darin.

  • JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
  • JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for kjs/value.h to make it available as a forwarded header.
  • kjs/lookup.h: (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method. The new method returns a boolean value if no entry is found in the lookup table.
  • kjs/value.cpp: (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
  • kjs/value.h: Ditto.

LayoutTests:

Reviewed by Darin.

  • fast/dom/select-selectedIndex-multiple-expected.txt: Updated test results.
  • fast/dom/select-selectedIndex-multiple.html: Updated to print comments between tests to make failures easier to track down.
  • fast/dom/select-selectedIndex-expected.txt: Mirrored updates from select-selectedIndex-multiple.html
  • fast/dom/select-selectedIndex.html: Ditto.
  • fast/js/resources/select-options-add.js: Added.
  • fast/js/select-options-add-expected.txt: Added.
  • fast/js/select-options-add.html: Added.

WebCore:

Reviewed by Darin.

Tests:

  • fast/dom/select-selectedIndex-multiple.html
  • fast/dom/select-selectedIndex.html
  • fast/js/select-options-add.html
  • DerivedSources.make: Added JSHTMLOptionsCollection.h.
  • ForwardingHeaders/kjs/operations.h: Added.
  • WebCore.xcodeproj/project.pbxproj: Added new source files.
  • bindings/js/JSHTMLOptionsCollectionCustom.cpp: Added. (WebCore::JSHTMLOptionsCollection::length): (WebCore::JSHTMLOptionsCollection::setLength): (WebCore::JSHTMLOptionsCollection::indexSetter):
  • bindings/js/kjs_html.cpp: Removed JSHTMLOptionsCollection implementation. Renamed classes and methods for consistency. (KJS::JSHTMLElement::selectGetter): (KJS::JSHTMLElement::put): (KJS::JSHTMLElement::selectSetter): (KJS::JSHTMLCollection::JSHTMLCollection): (KJS::JSHTMLCollectionProtoFunc::callAsFunction): (KJS::getHTMLOptionsCollection):
  • bindings/js/kjs_html.h: Ditto.
  • bindings/scripts/CodeGeneratorJS.pm: Added support for HasCustomIndexSetter class attribute. Added support for Optional parameter attribute, which makes generated code assume overloaded implementation methods are available for a JavaScript function with optional arguments. Changed local 'impl' variables to 'imp' so that impl() methods could be called without class designation.
  • html/HTMLOptionElement.idl: Added GenerateNativeConverter attribute.
  • html/HTMLOptionsCollection.cpp: Added methods used by generated JSHTMLOptionsCollection class. (WebCore::HTMLOptionsCollection::HTMLOptionsCollection): (WebCore::HTMLOptionsCollection::add): (WebCore::HTMLOptionsCollection::selectedIndex): (WebCore::HTMLOptionsCollection::setSelectedIndex): (WebCore::HTMLOptionsCollection::setLength):
  • html/HTMLOptionsCollection.h: Ditto.
  • html/HTMLOptionsCollection.idl: Added.
File:
1 edited

Legend:

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

    r15155 r15321  
    5656}
    5757
    58 int32_t JSValue::toInt32(ExecState *exec) const
     58int32_t JSValue::toInt32(ExecState* exec, bool& ok) const
    5959{
     60    ok = true;
     61
    6062    uint32_t i;
    6163    if (getUInt32(i))
     
    6365
    6466    double d = roundValue(exec, const_cast<JSValue*>(this));
    65     if (isNaN(d) || isInf(d))
     67    if (isNaN(d) || isInf(d)) {
     68        ok = false;
    6669        return 0;
     70    }
    6771    double d32 = fmod(d, D32);
    6872
Note: See TracChangeset for help on using the changeset viewer.