Changeset 147038 in webkit
- Timestamp:
- Mar 27, 2013 5:41:19 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r147036 r147038 1 2013-03-27 Arnaud Renevier <a.renevier@sisa.samsung.com> 2 3 javascriptcore bindings do not check exception after calling valueToStringWithNullCheck 4 https://bugs.webkit.org/show_bug.cgi?id=113219 5 6 Reviewed by Kentaro Hara. 7 8 * fast/dom/exception-in-binding-expected.txt: Added. 9 * fast/dom/exception-in-binding.html: Added. 10 * platform/chromium/TestExpectations: new test fails for now 11 1 12 2013-03-27 Claudio Saavedra <csaavedra@igalia.com> 2 13 -
trunk/LayoutTests/platform/chromium/TestExpectations
r147022 r147038 3799 3799 3800 3800 webkit.org/b/113114 media/video-controls-captions.html [ Timeout ] 3801 3802 webkit.org/b/113219 fast/dom/exception-in-binding.html [ Failure ] -
trunk/Source/WebCore/ChangeLog
r147037 r147038 1 2013-03-27 Arnaud Renevier <a.renevier@sisa.samsung.com> 2 3 javascriptcore bindings do not check exception after calling valueToStringWithNullCheck 4 https://bugs.webkit.org/show_bug.cgi?id=113219 5 6 Reviewed by Kentaro Hara. 7 8 When converting JSValue to native value in attribute setter, store the 9 native value in a temporary variable. After this variable assignment, 10 always check if an exception has been raised. 11 12 Update binding tests. 13 14 Test: fast/dom/exception-in-binding.html 15 16 * bindings/scripts/CodeGeneratorJS.pm: 17 (GenerateImplementation): 18 (GetNativeType): 19 (JSValueToNative): 20 * bindings/scripts/test/JS/JSTestInterface.cpp: 21 (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr): 22 (WebCore::setJSTestInterfaceSupplementalStr2): 23 (WebCore::setJSTestInterfaceSupplementalNode): 24 * bindings/scripts/test/JS/JSTestObj.cpp: 25 (WebCore::setJSTestObjConstructorStaticStringAttr): 26 (WebCore::setJSTestObjEnumAttr): 27 (WebCore::setJSTestObjShortAttr): 28 (WebCore::setJSTestObjUnsignedShortAttr): 29 (WebCore::setJSTestObjLongAttr): 30 (WebCore::setJSTestObjLongLongAttr): 31 (WebCore::setJSTestObjUnsignedLongLongAttr): 32 (WebCore::setJSTestObjStringAttr): 33 (WebCore::setJSTestObjTestObjAttr): 34 (WebCore::setJSTestObjXMLObjAttr): 35 (WebCore::setJSTestObjCreate): 36 (WebCore::setJSTestObjReflectedStringAttr): 37 (WebCore::setJSTestObjReflectedIntegralAttr): 38 (WebCore::setJSTestObjReflectedUnsignedIntegralAttr): 39 (WebCore::setJSTestObjReflectedBooleanAttr): 40 (WebCore::setJSTestObjReflectedURLAttr): 41 (WebCore::setJSTestObjReflectedCustomIntegralAttr): 42 (WebCore::setJSTestObjReflectedCustomBooleanAttr): 43 (WebCore::setJSTestObjReflectedCustomURLAttr): 44 (WebCore::setJSTestObjTypedArrayAttr): 45 (WebCore::setJSTestObjAttrWithGetterException): 46 (WebCore::setJSTestObjAttrWithSetterException): 47 (WebCore::setJSTestObjStringAttrWithGetterException): 48 (WebCore::setJSTestObjStringAttrWithSetterException): 49 (WebCore::setJSTestObjWithScriptStateAttribute): 50 (WebCore::setJSTestObjWithScriptExecutionContextAttribute): 51 (WebCore::setJSTestObjWithScriptStateAttributeRaises): 52 (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises): 53 (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute): 54 (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises): 55 (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): 56 (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute): 57 (WebCore::setJSTestObjConditionalAttr1): 58 (WebCore::setJSTestObjConditionalAttr2): 59 (WebCore::setJSTestObjConditionalAttr3): 60 (WebCore::setJSTestObjAnyAttribute): 61 (WebCore::setJSTestObjMutablePoint): 62 (WebCore::setJSTestObjImmutablePoint): 63 (WebCore::setJSTestObjStrawberry): 64 (WebCore::setJSTestObjStrictFloat): 65 (WebCore::setJSTestObjId): 66 (WebCore::setJSTestObjNullableLongSettableAttribute): 67 (WebCore::setJSTestObjNullableStringValue): 68 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: 69 (WebCore::setJSTestSerializedScriptValueInterfaceValue): 70 (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue): 71 * bindings/scripts/test/JS/JSTestTypedefs.cpp: 72 (WebCore::setJSTestTypedefsUnsignedLongLongAttr): 73 (WebCore::setJSTestTypedefsImmutableSerializedScriptValue): 74 (WebCore::setJSTestTypedefsAttrWithGetterException): 75 (WebCore::setJSTestTypedefsAttrWithSetterException): 76 (WebCore::setJSTestTypedefsStringAttrWithGetterException): 77 (WebCore::setJSTestTypedefsStringAttrWithSetterException): 78 1 79 2013-03-27 Arnaud Renevier <a.renevier@sisa.samsung.com> 2 80 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r146430 r147038 2143 2143 } 2144 2144 2145 my $nativeValue; 2145 push(@implContent, " " . GetNativeTypeFromSignature($attribute->signature) . " nativeValue(" . JSValueToNative($attribute->signature, "value") . ");\n"); 2146 push(@implContent, " if (exec->hadException())\n"); 2147 push(@implContent, " return;\n"); 2148 2146 2149 if ($codeGenerator->IsEnumType($type)) { 2147 push(@implContent, " const String string = value.isEmpty() ? String() : value.toString(exec)->value(exec);\n");2148 push(@implContent, " if (exec->hadException())\n");2149 push(@implContent, " return;\n");2150 2150 my @enumValues = $codeGenerator->ValidEnumValues($type); 2151 2151 my @enumChecks = (); 2152 2152 foreach my $enumValue (@enumValues) { 2153 push(@enumChecks, " string!= \"$enumValue\"");2153 push(@enumChecks, "nativeValue != \"$enumValue\""); 2154 2154 } 2155 2155 push (@implContent, " if (" . join(" && ", @enumChecks) . ")\n"); 2156 2156 push (@implContent, " return;\n"); 2157 $nativeValue = "string";2158 } else {2159 $nativeValue = JSValueToNative($attribute->signature, "value");2160 2157 } 2161 2158 … … 2170 2167 push(@implContent, " $svgPropertyOrListPropertyType& podImpl = impl->propertyReference();\n"); 2171 2168 if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber 2172 push(@implContent, " podImpl = $nativeValue;\n");2169 push(@implContent, " podImpl = nativeValue;\n"); 2173 2170 } else { 2174 push(@implContent, " podImpl.set$implSetterFunctionName( $nativeValue");2171 push(@implContent, " podImpl.set$implSetterFunctionName(nativeValue"); 2175 2172 push(@implContent, ", ec") if @{$attribute->setterExceptions}; 2176 2173 push(@implContent, ");\n"); … … 2187 2184 } else { 2188 2185 my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute); 2189 push(@arguments, $nativeValue);2186 push(@arguments, "nativeValue"); 2190 2187 if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) { 2191 2188 my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"}; … … 3098 3095 "NodeFilter" => "RefPtr<NodeFilter>", 3099 3096 "SerializedScriptValue" => "RefPtr<SerializedScriptValue>", 3097 "Date" => "double", 3100 3098 "Dictionary" => "Dictionary", 3101 3099 "any" => "ScriptValue", … … 3127 3125 3128 3126 return "Vector<" . GetNativeVectorInnerType($arrayOrSequenceType) . ">" if $arrayOrSequenceType; 3127 3128 if ($codeGenerator->IsEnumType($type)) { 3129 return "const String"; 3130 } 3129 3131 3130 3132 # For all other types, the native type is a pointer with same type name as the IDL type. … … 3272 3274 } 3273 3275 return "toNativeArray<" . GetNativeVectorInnerType($arrayOrSequenceType) . ">(exec, $value)"; 3276 } 3277 3278 if ($codeGenerator->IsEnumType($type)) { 3279 return "$value.isEmpty() ? String() : $value.toString(exec)->value(exec)"; 3274 3280 } 3275 3281 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
r143304 r147038 340 340 { 341 341 UNUSED_PARAM(exec); 342 TestSupplemental::setSupplementalStaticAttr(value.isEmpty() ? String() : value.toString(exec)->value(exec)); 342 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); 343 if (exec->hadException()) 344 return; 345 TestSupplemental::setSupplementalStaticAttr(nativeValue); 343 346 } 344 347 … … 351 354 JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject); 352 355 TestInterface* impl = static_cast<TestInterface*>(castedThis->impl()); 353 TestSupplemental::setSupplementalStr2(impl, value.isEmpty() ? String() : value.toString(exec)->value(exec)); 356 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); 357 if (exec->hadException()) 358 return; 359 TestSupplemental::setSupplementalStr2(impl, nativeValue); 354 360 } 355 361 … … 371 377 JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject); 372 378 TestInterface* impl = static_cast<TestInterface*>(castedThis->impl()); 373 TestSupplemental::setSupplementalNode(impl, toNode(value)); 379 Node* nativeValue(toNode(value)); 380 if (exec->hadException()) 381 return; 382 TestSupplemental::setSupplementalNode(impl, nativeValue); 374 383 } 375 384 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r146430 r147038 1077 1077 { 1078 1078 UNUSED_PARAM(exec); 1079 TestObj::setStaticStringAttr(value.isEmpty() ? String() : value.toString(exec)->value(exec)); 1079 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); 1080 if (exec->hadException()) 1081 return; 1082 TestObj::setStaticStringAttr(nativeValue); 1080 1083 } 1081 1084 … … 1086 1089 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1087 1090 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1088 const String string = value.isEmpty() ? String() : value.toString(exec)->value(exec);1089 if (exec->hadException()) 1090 return; 1091 if ( string != "" && string != "EnumValue1" && string != "EnumValue2" && string!= "EnumValue3")1092 return; 1093 impl->setEnumAttr( string);1091 const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); 1092 if (exec->hadException()) 1093 return; 1094 if (nativeValue != "" && nativeValue != "EnumValue1" && nativeValue != "EnumValue2" && nativeValue != "EnumValue3") 1095 return; 1096 impl->setEnumAttr(nativeValue); 1094 1097 } 1095 1098 … … 1100 1103 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1101 1104 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1102 impl->setShortAttr(toInt32(exec, value, NormalConversion)); 1105 short nativeValue(toInt32(exec, value, NormalConversion)); 1106 if (exec->hadException()) 1107 return; 1108 impl->setShortAttr(nativeValue); 1103 1109 } 1104 1110 … … 1109 1115 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1110 1116 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1111 impl->setUnsignedShortAttr(toUInt32(exec, value, NormalConversion)); 1117 unsigned short nativeValue(toUInt32(exec, value, NormalConversion)); 1118 if (exec->hadException()) 1119 return; 1120 impl->setUnsignedShortAttr(nativeValue); 1112 1121 } 1113 1122 … … 1118 1127 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1119 1128 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1120 impl->setLongAttr(toInt32(exec, value, NormalConversion)); 1129 int nativeValue(toInt32(exec, value, NormalConversion)); 1130 if (exec->hadException()) 1131 return; 1132 impl->setLongAttr(nativeValue); 1121 1133 } 1122 1134 … … 1127 1139 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1128 1140 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1129 impl->setLongLongAttr(toInt64(exec, value, NormalConversion)); 1141 long long nativeValue(toInt64(exec, value, NormalConversion)); 1142 if (exec->hadException()) 1143 return; 1144 impl->setLongLongAttr(nativeValue); 1130 1145 } 1131 1146 … … 1136 1151 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1137 1152 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1138 impl->setUnsignedLongLongAttr(toUInt64(exec, value, NormalConversion)); 1153 unsigned long long nativeValue(toUInt64(exec, value, NormalConversion)); 1154 if (exec->hadException()) 1155 return; 1156 impl->setUnsignedLongLongAttr(nativeValue); 1139 1157 } 1140 1158 … … 1145 1163 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1146 1164 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1147 impl->setStringAttr(value.isEmpty() ? String() : value.toString(exec)->value(exec)); 1165 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); 1166 if (exec->hadException()) 1167 return; 1168 impl->setStringAttr(nativeValue); 1148 1169 } 1149 1170 … … 1154 1175 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1155 1176 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1156 impl->setTestObjAttr(toTestObj(value)); 1177 TestObj* nativeValue(toTestObj(value)); 1178 if (exec->hadException()) 1179 return; 1180 impl->setTestObjAttr(nativeValue); 1157 1181 } 1158 1182 … … 1163 1187 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1164 1188 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1165 impl->setXMLObjAttr(toTestObj(value)); 1189 TestObj* nativeValue(toTestObj(value)); 1190 if (exec->hadException()) 1191 return; 1192 impl->setXMLObjAttr(nativeValue); 1166 1193 } 1167 1194 … … 1172 1199 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1173 1200 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1174 impl->setCreate(value.toBoolean(exec)); 1201 bool nativeValue(value.toBoolean(exec)); 1202 if (exec->hadException()) 1203 return; 1204 impl->setCreate(nativeValue); 1175 1205 } 1176 1206 … … 1181 1211 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1182 1212 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1183 impl->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, valueToStringWithNullCheck(exec, value)); 1213 const String& nativeValue(valueToStringWithNullCheck(exec, value)); 1214 if (exec->hadException()) 1215 return; 1216 impl->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, nativeValue); 1184 1217 } 1185 1218 … … 1190 1223 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1191 1224 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1192 impl->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, toInt32(exec, value, NormalConversion)); 1225 int nativeValue(toInt32(exec, value, NormalConversion)); 1226 if (exec->hadException()) 1227 return; 1228 impl->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, nativeValue); 1193 1229 } 1194 1230 … … 1199 1235 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1200 1236 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1201 impl->setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, toUInt32(exec, value, NormalConversion)); 1237 unsigned nativeValue(toUInt32(exec, value, NormalConversion)); 1238 if (exec->hadException()) 1239 return; 1240 impl->setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, nativeValue); 1202 1241 } 1203 1242 … … 1208 1247 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1209 1248 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1210 impl->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, value.toBoolean(exec)); 1249 bool nativeValue(value.toBoolean(exec)); 1250 if (exec->hadException()) 1251 return; 1252 impl->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, nativeValue); 1211 1253 } 1212 1254 … … 1217 1259 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1218 1260 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1219 impl->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, valueToStringWithNullCheck(exec, value)); 1261 const String& nativeValue(valueToStringWithNullCheck(exec, value)); 1262 if (exec->hadException()) 1263 return; 1264 impl->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, nativeValue); 1220 1265 } 1221 1266 … … 1226 1271 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1227 1272 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1228 impl->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, valueToStringWithNullCheck(exec, value)); 1273 const String& nativeValue(valueToStringWithNullCheck(exec, value)); 1274 if (exec->hadException()) 1275 return; 1276 impl->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, nativeValue); 1229 1277 } 1230 1278 … … 1235 1283 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1236 1284 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1237 impl->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, toInt32(exec, value, NormalConversion)); 1285 int nativeValue(toInt32(exec, value, NormalConversion)); 1286 if (exec->hadException()) 1287 return; 1288 impl->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, nativeValue); 1238 1289 } 1239 1290 … … 1244 1295 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1245 1296 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1246 impl->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, value.toBoolean(exec)); 1297 bool nativeValue(value.toBoolean(exec)); 1298 if (exec->hadException()) 1299 return; 1300 impl->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, nativeValue); 1247 1301 } 1248 1302 … … 1253 1307 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1254 1308 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1255 impl->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, valueToStringWithNullCheck(exec, value)); 1309 const String& nativeValue(valueToStringWithNullCheck(exec, value)); 1310 if (exec->hadException()) 1311 return; 1312 impl->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, nativeValue); 1256 1313 } 1257 1314 … … 1262 1319 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1263 1320 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1264 impl->setTypedArrayAttr(toFloat32Array(value)); 1321 Float32Array* nativeValue(toFloat32Array(value)); 1322 if (exec->hadException()) 1323 return; 1324 impl->setTypedArrayAttr(nativeValue); 1265 1325 } 1266 1326 … … 1271 1331 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1272 1332 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1273 impl->setAttrWithGetterException(toInt32(exec, value, NormalConversion)); 1333 int nativeValue(toInt32(exec, value, NormalConversion)); 1334 if (exec->hadException()) 1335 return; 1336 impl->setAttrWithGetterException(nativeValue); 1274 1337 } 1275 1338 … … 1281 1344 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1282 1345 ExceptionCode ec = 0; 1283 impl->setAttrWithSetterException(toInt32(exec, value, NormalConversion), ec); 1346 int nativeValue(toInt32(exec, value, NormalConversion)); 1347 if (exec->hadException()) 1348 return; 1349 impl->setAttrWithSetterException(nativeValue, ec); 1284 1350 setDOMException(exec, ec); 1285 1351 } … … 1291 1357 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1292 1358 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1293 impl->setStringAttrWithGetterException(value.isEmpty() ? String() : value.toString(exec)->value(exec)); 1359 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); 1360 if (exec->hadException()) 1361 return; 1362 impl->setStringAttrWithGetterException(nativeValue); 1294 1363 } 1295 1364 … … 1301 1370 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1302 1371 ExceptionCode ec = 0; 1303 impl->setStringAttrWithSetterException(value.isEmpty() ? String() : value.toString(exec)->value(exec), ec); 1372 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); 1373 if (exec->hadException()) 1374 return; 1375 impl->setStringAttrWithSetterException(nativeValue, ec); 1304 1376 setDOMException(exec, ec); 1305 1377 } … … 1318 1390 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1319 1391 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1320 impl->setWithScriptStateAttribute(exec, toInt32(exec, value, NormalConversion)); 1392 int nativeValue(toInt32(exec, value, NormalConversion)); 1393 if (exec->hadException()) 1394 return; 1395 impl->setWithScriptStateAttribute(exec, nativeValue); 1321 1396 } 1322 1397 … … 1327 1402 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1328 1403 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1404 TestObj* nativeValue(toTestObj(value)); 1405 if (exec->hadException()) 1406 return; 1329 1407 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); 1330 1408 if (!scriptContext) 1331 1409 return; 1332 impl->setWithScriptExecutionContextAttribute(scriptContext, toTestObj(value));1410 impl->setWithScriptExecutionContextAttribute(scriptContext, nativeValue); 1333 1411 } 1334 1412 … … 1339 1417 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1340 1418 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1341 impl->setWithScriptStateAttributeRaises(exec, toTestObj(value)); 1419 TestObj* nativeValue(toTestObj(value)); 1420 if (exec->hadException()) 1421 return; 1422 impl->setWithScriptStateAttributeRaises(exec, nativeValue); 1342 1423 } 1343 1424 … … 1348 1429 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1349 1430 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1431 TestObj* nativeValue(toTestObj(value)); 1432 if (exec->hadException()) 1433 return; 1350 1434 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); 1351 1435 if (!scriptContext) 1352 1436 return; 1353 impl->setWithScriptExecutionContextAttributeRaises(scriptContext, toTestObj(value));1437 impl->setWithScriptExecutionContextAttributeRaises(scriptContext, nativeValue); 1354 1438 } 1355 1439 … … 1360 1444 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1361 1445 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1446 TestObj* nativeValue(toTestObj(value)); 1447 if (exec->hadException()) 1448 return; 1362 1449 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); 1363 1450 if (!scriptContext) 1364 1451 return; 1365 impl->setWithScriptExecutionContextAndScriptStateAttribute(exec, scriptContext, toTestObj(value));1452 impl->setWithScriptExecutionContextAndScriptStateAttribute(exec, scriptContext, nativeValue); 1366 1453 } 1367 1454 … … 1372 1459 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1373 1460 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1461 TestObj* nativeValue(toTestObj(value)); 1462 if (exec->hadException()) 1463 return; 1374 1464 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); 1375 1465 if (!scriptContext) 1376 1466 return; 1377 impl->setWithScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, toTestObj(value));1467 impl->setWithScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, nativeValue); 1378 1468 } 1379 1469 … … 1384 1474 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1385 1475 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1476 TestObj* nativeValue(toTestObj(value)); 1477 if (exec->hadException()) 1478 return; 1386 1479 ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); 1387 1480 if (!scriptContext) 1388 1481 return; 1389 impl->setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext, toTestObj(value));1482 impl->setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext, nativeValue); 1390 1483 } 1391 1484 … … 1396 1489 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1397 1490 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1398 impl->setWithScriptArgumentsAndCallStackAttribute(toTestObj(value)); 1491 TestObj* nativeValue(toTestObj(value)); 1492 if (exec->hadException()) 1493 return; 1494 impl->setWithScriptArgumentsAndCallStackAttribute(nativeValue); 1399 1495 } 1400 1496 … … 1406 1502 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1407 1503 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1408 impl->setConditionalAttr1(toInt32(exec, value, NormalConversion)); 1504 int nativeValue(toInt32(exec, value, NormalConversion)); 1505 if (exec->hadException()) 1506 return; 1507 impl->setConditionalAttr1(nativeValue); 1409 1508 } 1410 1509 … … 1417 1516 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1418 1517 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1419 impl->setConditionalAttr2(toInt32(exec, value, NormalConversion)); 1518 int nativeValue(toInt32(exec, value, NormalConversion)); 1519 if (exec->hadException()) 1520 return; 1521 impl->setConditionalAttr2(nativeValue); 1420 1522 } 1421 1523 … … 1428 1530 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1429 1531 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1430 impl->setConditionalAttr3(toInt32(exec, value, NormalConversion)); 1532 int nativeValue(toInt32(exec, value, NormalConversion)); 1533 if (exec->hadException()) 1534 return; 1535 impl->setConditionalAttr3(nativeValue); 1431 1536 } 1432 1537 … … 1468 1573 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1469 1574 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1470 impl->setAnyAttribute(exec->globalData(), value); 1575 ScriptValue nativeValue(exec->globalData(), value); 1576 if (exec->hadException()) 1577 return; 1578 impl->setAnyAttribute(nativeValue); 1471 1579 } 1472 1580 … … 1477 1585 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1478 1586 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1479 impl->setMutablePoint(toSVGPoint(value)); 1587 SVGPropertyTearOff<FloatPoint>* nativeValue(toSVGPoint(value)); 1588 if (exec->hadException()) 1589 return; 1590 impl->setMutablePoint(nativeValue); 1480 1591 } 1481 1592 … … 1486 1597 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1487 1598 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1488 impl->setImmutablePoint(toSVGPoint(value)); 1599 SVGPropertyTearOff<FloatPoint>* nativeValue(toSVGPoint(value)); 1600 if (exec->hadException()) 1601 return; 1602 impl->setImmutablePoint(nativeValue); 1489 1603 } 1490 1604 … … 1495 1609 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1496 1610 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1497 impl->setBlueberry(toInt32(exec, value, NormalConversion)); 1611 int nativeValue(toInt32(exec, value, NormalConversion)); 1612 if (exec->hadException()) 1613 return; 1614 impl->setBlueberry(nativeValue); 1498 1615 } 1499 1616 … … 1504 1621 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1505 1622 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1506 impl->setStrictFloat(value.toFloat(exec)); 1623 float nativeValue(value.toFloat(exec)); 1624 if (exec->hadException()) 1625 return; 1626 impl->setStrictFloat(nativeValue); 1507 1627 } 1508 1628 … … 1513 1633 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1514 1634 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1515 impl->setId(toInt32(exec, value, NormalConversion)); 1635 int nativeValue(toInt32(exec, value, NormalConversion)); 1636 if (exec->hadException()) 1637 return; 1638 impl->setId(nativeValue); 1516 1639 } 1517 1640 … … 1530 1653 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1531 1654 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1532 impl->setNullableLongSettableAttribute(toInt32(exec, value, NormalConversion)); 1655 int nativeValue(toInt32(exec, value, NormalConversion)); 1656 if (exec->hadException()) 1657 return; 1658 impl->setNullableLongSettableAttribute(nativeValue); 1533 1659 } 1534 1660 … … 1539 1665 JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject); 1540 1666 TestObj* impl = static_cast<TestObj*>(castedThis->impl()); 1541 impl->setNullableStringValue(toInt32(exec, value, NormalConversion)); 1667 int nativeValue(toInt32(exec, value, NormalConversion)); 1668 if (exec->hadException()) 1669 return; 1670 impl->setNullableStringValue(nativeValue); 1542 1671 } 1543 1672 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
r143304 r147038 258 258 JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(thisObject); 259 259 TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl()); 260 impl->setValue(SerializedScriptValue::create(exec, value, 0, 0)); 260 RefPtr<SerializedScriptValue> nativeValue(SerializedScriptValue::create(exec, value, 0, 0)); 261 if (exec->hadException()) 262 return; 263 impl->setValue(nativeValue); 261 264 } 262 265 … … 267 270 JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(thisObject); 268 271 TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl()); 269 impl->setCachedValue(SerializedScriptValue::create(exec, value, 0, 0)); 272 RefPtr<SerializedScriptValue> nativeValue(SerializedScriptValue::create(exec, value, 0, 0)); 273 if (exec->hadException()) 274 return; 275 impl->setCachedValue(nativeValue); 270 276 } 271 277 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
r146430 r147038 281 281 JSTestTypedefs* castedThis = jsCast<JSTestTypedefs*>(thisObject); 282 282 TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl()); 283 impl->setUnsignedLongLongAttr(toUInt64(exec, value, NormalConversion)); 283 unsigned long long nativeValue(toUInt64(exec, value, NormalConversion)); 284 if (exec->hadException()) 285 return; 286 impl->setUnsignedLongLongAttr(nativeValue); 284 287 } 285 288 … … 290 293 JSTestTypedefs* castedThis = jsCast<JSTestTypedefs*>(thisObject); 291 294 TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl()); 292 impl->setImmutableSerializedScriptValue(SerializedScriptValue::create(exec, value, 0, 0)); 295 RefPtr<SerializedScriptValue> nativeValue(SerializedScriptValue::create(exec, value, 0, 0)); 296 if (exec->hadException()) 297 return; 298 impl->setImmutableSerializedScriptValue(nativeValue); 293 299 } 294 300 … … 299 305 JSTestTypedefs* castedThis = jsCast<JSTestTypedefs*>(thisObject); 300 306 TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl()); 301 impl->setAttrWithGetterException(toInt32(exec, value, NormalConversion)); 307 int nativeValue(toInt32(exec, value, NormalConversion)); 308 if (exec->hadException()) 309 return; 310 impl->setAttrWithGetterException(nativeValue); 302 311 } 303 312 … … 309 318 TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl()); 310 319 ExceptionCode ec = 0; 311 impl->setAttrWithSetterException(toInt32(exec, value, NormalConversion), ec); 320 int nativeValue(toInt32(exec, value, NormalConversion)); 321 if (exec->hadException()) 322 return; 323 impl->setAttrWithSetterException(nativeValue, ec); 312 324 setDOMException(exec, ec); 313 325 } … … 319 331 JSTestTypedefs* castedThis = jsCast<JSTestTypedefs*>(thisObject); 320 332 TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl()); 321 impl->setStringAttrWithGetterException(value.isEmpty() ? String() : value.toString(exec)->value(exec)); 333 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); 334 if (exec->hadException()) 335 return; 336 impl->setStringAttrWithGetterException(nativeValue); 322 337 } 323 338 … … 329 344 TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl()); 330 345 ExceptionCode ec = 0; 331 impl->setStringAttrWithSetterException(value.isEmpty() ? String() : value.toString(exec)->value(exec), ec); 346 const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec)); 347 if (exec->hadException()) 348 return; 349 impl->setStringAttrWithSetterException(nativeValue, ec); 332 350 setDOMException(exec, ec); 333 351 }
Note: See TracChangeset
for help on using the changeset viewer.