Changeset 98688 in webkit
- Timestamp:
- Oct 27, 2011, 9:58:21 PM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
bindings/scripts/test/JS/JSTestInterface.cpp (modified) (1 diff)
-
bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp (modified) (1 diff)
-
bindings/scripts/test/JS/JSTestObj.cpp (modified) (34 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r98686 r98688 1 2011-10-27 Ryosuke Niwa <rniwa@webkit.org> 2 3 binding test rebaseline after r98679. 4 5 * bindings/scripts/test/JS/JSTestInterface.cpp: 6 (WebCore::JSTestInterfaceConstructor::constructJSTestInterface): 7 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: 8 (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod): 9 * bindings/scripts/test/JS/JSTestObj.cpp: 10 (WebCore::setJSTestObjStringAttr): 11 (WebCore::setJSTestObjStringAttrWithGetterException): 12 (WebCore::setJSTestObjStringAttrWithSetterException): 13 (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs): 14 (WebCore::jsTestObjPrototypeFunctionIntMethodWithArgs): 15 (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs): 16 (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgs): 17 (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows): 18 (WebCore::jsTestObjPrototypeFunctionSerializedValue): 19 (WebCore::jsTestObjPrototypeFunctionIdbKey): 20 (WebCore::jsTestObjPrototypeFunctionOptionsObject): 21 (WebCore::jsTestObjPrototypeFunctionCustomArgsAndException): 22 (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndArg): 23 (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg): 24 (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture): 25 (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD): 26 (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg): 27 (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg): 28 (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs): 29 (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg): 30 (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1): 31 (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2): 32 (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3): 33 (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4): 34 (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6): 35 (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7): 36 (WebCore::jsTestObjPrototypeFunctionClassMethodWithOptional): 37 1 38 2011-10-27 Adam Barth <abarth@webkit.org> 2 39 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
r98552 r98688 106 106 return throwVMError(exec, createTypeError(exec, "Not enough arguments")); 107 107 ExceptionCode ec = 0; 108 const String& str1(ustringToString( exec->argument(0).toString(exec)));108 const String& str1(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec))); 109 109 if (exec->hadException()) 110 110 return JSValue::encode(jsUndefined()); 111 const String& str2(ustringToString( exec->argument(1).toString(exec)));111 const String& str2(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toString(exec))); 112 112 if (exec->hadException()) 113 113 return JSValue::encode(jsUndefined()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
r98552 r98688 187 187 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestMediaQueryListListener::s_info); 188 188 TestMediaQueryListListener* imp = static_cast<TestMediaQueryListListener*>(castedThis->impl()); 189 RefPtr<MediaQueryListListener> listener(MediaQueryListListener::create(ScriptValue(exec->globalData(), exec->argument(0))));189 RefPtr<MediaQueryListListener> listener(MediaQueryListListener::create(ScriptValue(exec->globalData(), MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined)))); 190 190 if (exec->hadException()) 191 191 return JSValue::encode(jsUndefined()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r98617 r98688 791 791 JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject); 792 792 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 793 imp->setStringAttr(ustringToString(value. toString(exec)));793 imp->setStringAttr(ustringToString(value.isEmpty() ? UString() : value.toString(exec))); 794 794 } 795 795 … … 932 932 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 933 933 ExceptionCode ec = 0; 934 imp->setStringAttrWithGetterException(ustringToString(value. toString(exec)), ec);934 imp->setStringAttrWithGetterException(ustringToString(value.isEmpty() ? UString() : value.toString(exec)), ec); 935 935 setDOMException(exec, ec); 936 936 } … … 942 942 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 943 943 ExceptionCode ec = 0; 944 imp->setStringAttrWithSetterException(ustringToString(value. toString(exec)), ec);944 imp->setStringAttrWithSetterException(ustringToString(value.isEmpty() ? UString() : value.toString(exec)), ec); 945 945 setDOMException(exec, ec); 946 946 } … … 1043 1043 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1044 1044 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1045 int intArg( exec->argument(0).toInt32(exec));1046 if (exec->hadException()) 1047 return JSValue::encode(jsUndefined()); 1048 const String& strArg(ustringToString( exec->argument(1).toString(exec)));1049 if (exec->hadException()) 1050 return JSValue::encode(jsUndefined()); 1051 TestObj* objArg(toTestObj( exec->argument(2)));1045 int intArg(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec)); 1046 if (exec->hadException()) 1047 return JSValue::encode(jsUndefined()); 1048 const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toString(exec))); 1049 if (exec->hadException()) 1050 return JSValue::encode(jsUndefined()); 1051 TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 2, MissingIsUndefined))); 1052 1052 if (exec->hadException()) 1053 1053 return JSValue::encode(jsUndefined()); … … 1077 1077 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1078 1078 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1079 int intArg( exec->argument(0).toInt32(exec));1080 if (exec->hadException()) 1081 return JSValue::encode(jsUndefined()); 1082 const String& strArg(ustringToString( exec->argument(1).toString(exec)));1083 if (exec->hadException()) 1084 return JSValue::encode(jsUndefined()); 1085 TestObj* objArg(toTestObj( exec->argument(2)));1079 int intArg(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec)); 1080 if (exec->hadException()) 1081 return JSValue::encode(jsUndefined()); 1082 const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toString(exec))); 1083 if (exec->hadException()) 1084 return JSValue::encode(jsUndefined()); 1085 TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 2, MissingIsUndefined))); 1086 1086 if (exec->hadException()) 1087 1087 return JSValue::encode(jsUndefined()); … … 1112 1112 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1113 1113 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1114 int intArg( exec->argument(0).toInt32(exec));1115 if (exec->hadException()) 1116 return JSValue::encode(jsUndefined()); 1117 const String& strArg(ustringToString( exec->argument(1).toString(exec)));1118 if (exec->hadException()) 1119 return JSValue::encode(jsUndefined()); 1120 TestObj* objArg(toTestObj( exec->argument(2)));1114 int intArg(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec)); 1115 if (exec->hadException()) 1116 return JSValue::encode(jsUndefined()); 1117 const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toString(exec))); 1118 if (exec->hadException()) 1119 return JSValue::encode(jsUndefined()); 1120 TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 2, MissingIsUndefined))); 1121 1121 if (exec->hadException()) 1122 1122 return JSValue::encode(jsUndefined()); … … 1136 1136 if (exec->argumentCount() < 2) 1137 1137 return JSValue::encode(jsUndefined()); 1138 const String& strArg(ustringToString( exec->argument(0).toString(exec)));1139 if (exec->hadException()) 1140 return JSValue::encode(jsUndefined()); 1141 TestObj* objArg(toTestObj( exec->argument(1)));1138 const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec))); 1139 if (exec->hadException()) 1140 return JSValue::encode(jsUndefined()); 1141 TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined))); 1142 1142 if (exec->hadException()) 1143 1143 return JSValue::encode(jsUndefined()); … … 1158 1158 return throwVMError(exec, createTypeError(exec, "Not enough arguments")); 1159 1159 ExceptionCode ec = 0; 1160 const String& strArg(ustringToString( exec->argument(0).toString(exec)));1161 if (exec->hadException()) 1162 return JSValue::encode(jsUndefined()); 1163 TestObj* objArg(toTestObj( exec->argument(1)));1160 const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec))); 1161 if (exec->hadException()) 1162 return JSValue::encode(jsUndefined()); 1163 TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined))); 1164 1164 if (exec->hadException()) 1165 1165 return JSValue::encode(jsUndefined()); … … 1178 1178 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1179 1179 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1180 RefPtr<SerializedScriptValue> serializedArg(SerializedScriptValue::create(exec, exec->argument(0)));1180 RefPtr<SerializedScriptValue> serializedArg(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined))); 1181 1181 if (exec->hadException()) 1182 1182 return JSValue::encode(jsUndefined()); … … 1193 1193 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1194 1194 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1195 RefPtr<IDBKey> key(createIDBKeyFromValue(exec, exec->argument(0)));1195 RefPtr<IDBKey> key(createIDBKeyFromValue(exec, MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined))); 1196 1196 if (exec->hadException()) 1197 1197 return JSValue::encode(jsUndefined()); … … 1208 1208 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1209 1209 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1210 OptionsObject* oo(toOptionsObject( exec->argument(0)));1210 OptionsObject* oo(toOptionsObject(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined))); 1211 1211 if (exec->hadException()) 1212 1212 return JSValue::encode(jsUndefined()); … … 1218 1218 } 1219 1219 1220 OptionsObject* ooo(toOptionsObject( exec->argument(1)));1220 OptionsObject* ooo(toOptionsObject(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined))); 1221 1221 if (exec->hadException()) 1222 1222 return JSValue::encode(jsUndefined()); … … 1271 1271 size_t maxStackSize = imp->shouldCaptureFullStackTrace() ? ScriptCallStack::maxCallStackSizeToCapture : 1; 1272 1272 RefPtr<ScriptCallStack> callStack(createScriptCallStack(exec, maxStackSize)); 1273 log* intArg(tolog( exec->argument(0)));1273 log* intArg(tolog(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined))); 1274 1274 if (exec->hadException()) 1275 1275 return JSValue::encode(jsUndefined()); … … 1335 1335 if (!dynamicFrame) 1336 1336 return JSValue::encode(jsUndefined()); 1337 int intArg( exec->argument(0).toInt32(exec));1337 int intArg(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec)); 1338 1338 if (exec->hadException()) 1339 1339 return JSValue::encode(jsUndefined()); … … 1353 1353 if (!dynamicFrame) 1354 1354 return JSValue::encode(jsUndefined()); 1355 int intArg( exec->argument(0).toInt32(exec));1355 int intArg(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec)); 1356 1356 if (exec->hadException()) 1357 1357 return JSValue::encode(jsUndefined()); … … 1363 1363 } 1364 1364 1365 int optionalArg( exec->argument(1).toInt32(exec));1365 int optionalArg(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toInt32(exec)); 1366 1366 if (exec->hadException()) 1367 1367 return JSValue::encode(jsUndefined()); … … 1381 1381 if (!dynamicFrame) 1382 1382 return JSValue::encode(jsUndefined()); 1383 int intArg( exec->argument(0).toInt32(exec));1383 int intArg(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec)); 1384 1384 if (exec->hadException()) 1385 1385 return JSValue::encode(jsUndefined()); … … 1399 1399 if (!dynamicFrame) 1400 1400 return JSValue::encode(jsUndefined()); 1401 int intArg( exec->argument(0).toInt32(exec));1401 int intArg(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec)); 1402 1402 if (exec->hadException()) 1403 1403 return JSValue::encode(jsUndefined()); … … 1409 1409 } 1410 1410 1411 int optionalArg( exec->argument(1).toInt32(exec));1411 int optionalArg(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toInt32(exec)); 1412 1412 if (exec->hadException()) 1413 1413 return JSValue::encode(jsUndefined()); … … 1504 1504 } 1505 1505 1506 int opt( exec->argument(0).toInt32(exec));1506 int opt(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec)); 1507 1507 if (exec->hadException()) 1508 1508 return JSValue::encode(jsUndefined()); … … 1519 1519 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1520 1520 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1521 int nonOpt( exec->argument(0).toInt32(exec));1521 int nonOpt(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec)); 1522 1522 if (exec->hadException()) 1523 1523 return JSValue::encode(jsUndefined()); … … 1529 1529 } 1530 1530 1531 int opt( exec->argument(1).toInt32(exec));1531 int opt(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toInt32(exec)); 1532 1532 if (exec->hadException()) 1533 1533 return JSValue::encode(jsUndefined()); … … 1544 1544 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1545 1545 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1546 int nonOpt( exec->argument(0).toInt32(exec));1546 int nonOpt(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec)); 1547 1547 if (exec->hadException()) 1548 1548 return JSValue::encode(jsUndefined()); … … 1554 1554 } 1555 1555 1556 int opt1( exec->argument(1).toInt32(exec));1556 int opt1(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toInt32(exec)); 1557 1557 if (exec->hadException()) 1558 1558 return JSValue::encode(jsUndefined()); … … 1562 1562 } 1563 1563 1564 int opt2( exec->argument(2).toInt32(exec));1564 int opt2(MAYBE_MISSING_PARAMETER(exec, 2, MissingIsUndefined).toInt32(exec)); 1565 1565 if (exec->hadException()) 1566 1566 return JSValue::encode(jsUndefined()); … … 1594 1594 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1595 1595 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1596 int nonCallback( exec->argument(0).toInt32(exec));1596 int nonCallback(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec)); 1597 1597 if (exec->hadException()) 1598 1598 return JSValue::encode(jsUndefined()); … … 1680 1680 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1681 1681 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1682 TestObj* objArg(toTestObj( exec->argument(0)));1683 if (exec->hadException()) 1684 return JSValue::encode(jsUndefined()); 1685 const String& strArg(ustringToString( exec->argument(1).toString(exec)));1682 TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined))); 1683 if (exec->hadException()) 1684 return JSValue::encode(jsUndefined()); 1685 const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toString(exec))); 1686 1686 if (exec->hadException()) 1687 1687 return JSValue::encode(jsUndefined()); … … 1698 1698 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1699 1699 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1700 TestObj* objArg(toTestObj( exec->argument(0)));1700 TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined))); 1701 1701 if (exec->hadException()) 1702 1702 return JSValue::encode(jsUndefined()); … … 1708 1708 } 1709 1709 1710 int intArg( exec->argument(1).toInt32(exec));1710 int intArg(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toInt32(exec)); 1711 1711 if (exec->hadException()) 1712 1712 return JSValue::encode(jsUndefined()); … … 1723 1723 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1724 1724 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1725 const String& strArg(ustringToString( exec->argument(0).toString(exec)));1725 const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec))); 1726 1726 if (exec->hadException()) 1727 1727 return JSValue::encode(jsUndefined()); … … 1738 1738 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1739 1739 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1740 int intArg( exec->argument(0).toInt32(exec));1740 int intArg(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec)); 1741 1741 if (exec->hadException()) 1742 1742 return JSValue::encode(jsUndefined()); … … 1770 1770 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1771 1771 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1772 DOMStringList* listArg(toDOMStringList( exec->argument(0)));1772 DOMStringList* listArg(toDOMStringList(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined))); 1773 1773 if (exec->hadException()) 1774 1774 return JSValue::encode(jsUndefined()); … … 1785 1785 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info); 1786 1786 TestObj* imp = static_cast<TestObj*>(castedThis->impl()); 1787 DOMStringList* arrayArg(toDOMStringList( exec->argument(0)));1787 DOMStringList* arrayArg(toDOMStringList(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined))); 1788 1788 if (exec->hadException()) 1789 1789 return JSValue::encode(jsUndefined()); … … 1842 1842 } 1843 1843 1844 int arg( exec->argument(0).toInt32(exec));1844 int arg(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec)); 1845 1845 if (exec->hadException()) 1846 1846 return JSValue::encode(jsUndefined());
Note:
See TracChangeset
for help on using the changeset viewer.