Changeset 18715 in webkit
- Timestamp:
- Jan 9, 2007, 9:38:46 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r18712 r18715 1 2007-01-09 Mitz Pettel <[email protected]> 2 3 Reviewed by Darin. 4 5 - changes for http://bugs.webkit.org/show_bug.cgi?id=11078 6 Forms Don't Submit (ASP Pages) 7 8 * JavaScriptCore.exp: 9 * kjs/value.cpp: 10 (KJS::JSValue::toInt32): Folded toInt32Inline into this method, which was its 11 only caller. 12 (KJS::JSValue::toUInt32): Added a variant that reports if the conversion has 13 succeeded. 14 * kjs/value.h: 15 1 16 2007-01-09 Darin Adler <[email protected]> 2 17 -
trunk/JavaScriptCore/JavaScriptCore.exp
r18481 r18715 248 248 __ZNK3KJS7JSValue7toInt32EPNS_9ExecStateERb 249 249 __ZNK3KJS7JSValue8toUInt32EPNS_9ExecStateE 250 __ZNK3KJS7JSValue8toUInt32EPNS_9ExecStateERb 250 251 __ZNK3KJS7JSValue9toIntegerEPNS_9ExecStateE 251 252 __ZNK3KJS7UString10UTF8StringEv -
trunk/JavaScriptCore/kjs/value.cpp
r17372 r18715 56 56 } 57 57 58 inline int32_t JSValue::toInt32Inline(ExecState* exec, bool& ok) const 58 int32_t JSValue::toInt32(ExecState* exec) const 59 { 60 bool ok; 61 return toInt32(exec, ok); 62 } 63 64 int32_t JSValue::toInt32(ExecState* exec, bool& ok) const 59 65 { 60 66 ok = true; … … 79 85 } 80 86 81 int32_t JSValue::toInt32(ExecState* exec) const87 uint32_t JSValue::toUInt32(ExecState* exec) const 82 88 { 83 89 bool ok; 84 return to Int32(exec, ok);90 return toUInt32(exec, ok); 85 91 } 86 92 87 int32_t JSValue::toInt32(ExecState* exec, bool& ok) const93 uint32_t JSValue::toUInt32(ExecState* exec, bool& ok) const 88 94 { 89 return toInt32Inline(exec, ok); 90 } 95 ok = true; 91 96 92 uint32_t JSValue::toUInt32(ExecState *exec) const93 {94 97 uint32_t i; 95 98 if (getUInt32(i)) … … 97 100 98 101 double d = roundValue(exec, const_cast<JSValue*>(this)); 99 if (isNaN(d) || isInf(d)) 102 if (isNaN(d) || isInf(d)) { 103 ok = false; 100 104 return 0; 105 } 101 106 double d32 = fmod(d, D32); 102 107 -
trunk/JavaScriptCore/kjs/value.h
r17372 r18715 95 95 96 96 // Integer conversions. 97 double toInteger(ExecState *exec) const;97 double toInteger(ExecState*) const; 98 98 int32_t toInt32(ExecState*) const; 99 99 int32_t toInt32(ExecState*, bool& ok) const; 100 uint32_t toUInt32(ExecState *exec) const; 101 uint16_t toUInt16(ExecState *exec) const; 100 uint32_t toUInt32(ExecState*) const; 101 uint32_t toUInt32(ExecState*, bool& ok) const; 102 uint16_t toUInt16(ExecState*) const; 102 103 103 104 // Garbage collection. … … 109 110 JSCell *downcast(); 110 111 const JSCell *downcast() const; 111 inline int32_t toInt32Inline(ExecState*, bool& ok) const;112 112 113 113 // Give a compile time error if we try to copy one of these. -
trunk/LayoutTests/ChangeLog
r18707 r18715 1 2007-01-09 Mitz Pettel <[email protected]> 2 3 Reviewed by Darin. 4 5 - test for http://bugs.webkit.org/show_bug.cgi?id=11078 6 Forms Don't Submit (ASP Pages) 7 8 * fast/dom/collection-namedItem-via-item-expected.txt: Added. 9 * fast/dom/collection-namedItem-via-item.html: Added. 10 1 11 2007-01-09 Darin Adler <[email protected]> 2 12 -
trunk/WebCore/ChangeLog
r18712 r18715 1 2007-01-09 Mitz Pettel <[email protected]> 2 3 Reviewed by Darin. 4 5 - fix http://bugs.webkit.org/show_bug.cgi?id=11078 6 Forms Don't Submit (ASP Pages) 7 8 Test: fast/dom/collection-namedItem-via-item.html 9 10 * bindings/js/kjs_html.cpp: 11 (KJS::JSHTMLCollectionProtoFunc::callAsFunction): Changed item() to fall back 12 to namedItem() if its argument does not convert to a number. 13 1 14 2007-01-09 Darin Adler <[email protected]> 2 15 -
trunk/WebCore/bindings/js/kjs_html.cpp
r18674 r18715 1678 1678 1679 1679 switch (id) { 1680 case JSHTMLCollection::Item:1681 return toJS(exec,coll.item(args[0]->toUInt32(exec)));1682 1680 case JSHTMLCollection::Tags: 1683 1681 return toJS(exec, coll.base()->getElementsByTagName(args[0]->toString(exec)).get()); 1682 case JSHTMLCollection::Item: 1683 { 1684 bool ok; 1685 uint32_t index = args[0]->toUInt32(exec, ok); 1686 if (ok) 1687 return toJS(exec, coll.item(index)); 1688 } 1689 // Fall through 1684 1690 case JSHTMLCollection::NamedItem: 1685 1691 return static_cast<JSHTMLCollection*>(thisObj)->getNamedItems(exec, Identifier(args[0]->toString(exec)));
Note:
See TracChangeset
for help on using the changeset viewer.