Changeset 111825 in webkit
- Timestamp:
- Mar 22, 2012 9:31:32 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r111824 r111825 1 2012-03-22 Mao Yujie <yujie.mao@intel.com> 2 3 Implement strict testing criterion for callback function definition 4 https://bugs.webkit.org/show_bug.cgi?id=80005 5 6 Reviewed by Adam Barth. 7 8 Modify some tests to align with their behavior. 9 10 * fast/dom/MediaStream/argument-types-expected.txt: 11 * fast/dom/MediaStream/script-tests/argument-types.js: 12 * fast/mediastream/peerconnection-argument-types-expected.txt: 13 * fast/mediastream/script-tests/argument-types.js: 14 1 15 2012-03-22 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 16 -
trunk/LayoutTests/fast/dom/MediaStream/argument-types-expected.txt
r107540 r111825 28 28 PASS navigator.webkitGetUserMedia("video", undefined) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 29 29 PASS navigator.webkitGetUserMedia("video", null) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 30 PASS navigator.webkitGetUserMedia("video", {}) did not throw exception.31 PASS navigator.webkitGetUserMedia("video", objectThrowingException) did not throw exception.30 PASS navigator.webkitGetUserMedia("video", {}) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 31 PASS navigator.webkitGetUserMedia("video", objectThrowingException) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 32 32 PASS navigator.webkitGetUserMedia("video", true) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 33 33 PASS navigator.webkitGetUserMedia("video", 42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. … … 42 42 PASS navigator.webkitGetUserMedia("video", emptyFunction, "video") threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 43 43 PASS navigator.webkitGetUserMedia("video", emptyFunction, null) did not throw exception. 44 PASS navigator.webkitGetUserMedia("video", emptyFunction, {}) did not throw exception.45 PASS navigator.webkitGetUserMedia("video", emptyFunction, objectThrowingException) did not throw exception.44 PASS navigator.webkitGetUserMedia("video", emptyFunction, {}) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 45 PASS navigator.webkitGetUserMedia("video", emptyFunction, objectThrowingException) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 46 46 PASS navigator.webkitGetUserMedia("video", emptyFunction, true) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 47 47 PASS navigator.webkitGetUserMedia("video", emptyFunction, 42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. -
trunk/LayoutTests/fast/dom/MediaStream/script-tests/argument-types.js
r107540 r111825 63 63 test('navigator.webkitGetUserMedia("video", undefined)', true, typeMismatchError); 64 64 test('navigator.webkitGetUserMedia("video", null)', true, typeMismatchError); 65 test('navigator.webkitGetUserMedia("video", {})', false);66 test('navigator.webkitGetUserMedia("video", objectThrowingException)', false);65 test('navigator.webkitGetUserMedia("video", {})', true, typeMismatchError); 66 test('navigator.webkitGetUserMedia("video", objectThrowingException)', true, typeMismatchError); 67 67 test('navigator.webkitGetUserMedia("video", true)', true, typeMismatchError); 68 68 test('navigator.webkitGetUserMedia("video", 42)', true, typeMismatchError); … … 79 79 test('navigator.webkitGetUserMedia("video", emptyFunction, "video")', true, typeMismatchError); 80 80 test('navigator.webkitGetUserMedia("video", emptyFunction, null)', false ); 81 test('navigator.webkitGetUserMedia("video", emptyFunction, {})', false);82 test('navigator.webkitGetUserMedia("video", emptyFunction, objectThrowingException)', false);81 test('navigator.webkitGetUserMedia("video", emptyFunction, {})', true, typeMismatchError); 82 test('navigator.webkitGetUserMedia("video", emptyFunction, objectThrowingException)', true, typeMismatchError); 83 83 test('navigator.webkitGetUserMedia("video", emptyFunction, true)', true, typeMismatchError); 84 84 test('navigator.webkitGetUserMedia("video", emptyFunction, 42)', true, typeMismatchError); -
trunk/LayoutTests/fast/mediastream/peerconnection-argument-types-expected.txt
r110587 r111825 46 46 PASS new webkitDeprecatedPeerConnection("STUNS NONE",emptyFunction) did not throw exception. 47 47 PASS new webkitDeprecatedPeerConnection("TURN NONE",undefined) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 48 PASS new webkitDeprecatedPeerConnection("TURNS NONE",{}) did not throw exception.48 PASS new webkitDeprecatedPeerConnection("TURNS NONE",{}) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 49 49 PASS new webkitDeprecatedPeerConnection("STUN NONE",42) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 50 50 PASS new webkitDeprecatedPeerConnection("STUNS NONE",Infinity) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. -
trunk/LayoutTests/fast/mediastream/script-tests/argument-types.js
r110587 r111825 80 80 test('new webkitDeprecatedPeerConnection("STUNS NONE",emptyFunction)', false); 81 81 test('new webkitDeprecatedPeerConnection("TURN NONE",undefined)', true); 82 test('new webkitDeprecatedPeerConnection("TURNS NONE",{})', false);82 test('new webkitDeprecatedPeerConnection("TURNS NONE",{})', true); 83 83 test('new webkitDeprecatedPeerConnection("STUN NONE",42)', true); 84 84 test('new webkitDeprecatedPeerConnection("STUNS NONE",Infinity)', true); -
trunk/Source/WebCore/ChangeLog
r111824 r111825 1 2012-03-22 Mao Yujie <yujie.mao@intel.com> 2 3 Implement strict testing criterion for callback function definition 4 https://bugs.webkit.org/show_bug.cgi?id=80005 5 6 Reviewed by Adam Barth. 7 8 Callback function should be defined as the function type instead of 9 the object type. 10 11 LayoutTest: fast/dom/MediaStream/argument-types.html 12 13 * bindings/scripts/CodeGeneratorJS.pm: 14 (GenerateParametersCheckExpression): 15 (GenerateParametersCheck): 16 * bindings/scripts/CodeGeneratorV8.pm: 17 (GenerateParametersCheckExpression): 18 (GenerateParametersCheck): 19 1 20 2012-03-22 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 21 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r111779 r111825 1232 1232 } elsif ($parameter->extendedAttributes->{"Callback"}) { 1233 1233 # For Callbacks only checks if the value is null or object. 1234 push(@andExpression, "(${value}.isNull() || ${value}.is Object())");1234 push(@andExpression, "(${value}.isNull() || ${value}.isFunction())"); 1235 1235 $usedArguments{$parameterIndex} = 1; 1236 1236 } elsif (IsArrayType($type)) { … … 2501 2501 push(@$outputArray, " RefPtr<$argType> $name;\n"); 2502 2502 push(@$outputArray, " if (exec->argumentCount() > $argsIndex && !exec->argument($argsIndex).isUndefinedOrNull()) {\n"); 2503 push(@$outputArray, " if (!exec->argument($argsIndex).is Object()) {\n");2503 push(@$outputArray, " if (!exec->argument($argsIndex).isFunction()) {\n"); 2504 2504 push(@$outputArray, " setDOMException(exec, TYPE_MISMATCH_ERR);\n"); 2505 2505 push(@$outputArray, " return JSValue::encode(jsUndefined());\n"); … … 2508 2508 push(@$outputArray, " }\n"); 2509 2509 } else { 2510 push(@$outputArray, " if (exec->argumentCount() <= $argsIndex || !exec->argument($argsIndex).is Object()) {\n");2510 push(@$outputArray, " if (exec->argumentCount() <= $argsIndex || !exec->argument($argsIndex).isFunction()) {\n"); 2511 2511 push(@$outputArray, " setDOMException(exec, TYPE_MISMATCH_ERR);\n"); 2512 2512 push(@$outputArray, " return JSValue::encode(jsUndefined());\n"); -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r111813 r111825 1285 1285 } elsif ($parameter->extendedAttributes->{"Callback"}) { 1286 1286 # For Callbacks only checks if the value is null or object. 1287 push(@andExpression, "(${value}->IsNull() || ${value}->Is Object())");1287 push(@andExpression, "(${value}->IsNull() || ${value}->IsFunction())"); 1288 1288 } elsif (IsArrayType($type)) { 1289 1289 # FIXME: Add proper support for T[], T[]?, sequence<T>. … … 1586 1586 $parameterCheckString .= " RefPtr<" . $parameter->type . "> $parameterName;\n"; 1587 1587 $parameterCheckString .= " if (args.Length() > $paramIndex && !args[$paramIndex]->IsNull() && !args[$paramIndex]->IsUndefined()) {\n"; 1588 $parameterCheckString .= " if (!args[$paramIndex]->Is Object())\n";1588 $parameterCheckString .= " if (!args[$paramIndex]->IsFunction())\n"; 1589 1589 $parameterCheckString .= " return throwError(TYPE_MISMATCH_ERR);\n"; 1590 1590 $parameterCheckString .= " $parameterName = ${className}::create(args[$paramIndex], getScriptExecutionContext());\n"; 1591 1591 $parameterCheckString .= " }\n"; 1592 1592 } else { 1593 $parameterCheckString .= " if (args.Length() <= $paramIndex || !args[$paramIndex]->Is Object())\n";1593 $parameterCheckString .= " if (args.Length() <= $paramIndex || !args[$paramIndex]->IsFunction())\n"; 1594 1594 $parameterCheckString .= " return throwError(TYPE_MISMATCH_ERR);\n"; 1595 1595 $parameterCheckString .= " RefPtr<" . $parameter->type . "> $parameterName = ${className}::create(args[$paramIndex], getScriptExecutionContext());\n";
Note: See TracChangeset
for help on using the changeset viewer.