Changeset 207711 in webkit
- Timestamp:
- Oct 22, 2016 3:19:21 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207710 r207711 1 2016-10-22 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr> 2 3 Bindings error message for missing required dictionary member should be more explicit 4 https://bugs.webkit.org/show_bug.cgi?id=163665 5 6 Reviewed by Darin Adler. 7 8 Update existing tests. 9 10 * fast/mediastream/MediaStreamTrackEvent-constructor-expected.txt: 11 1 12 2016-10-22 Ryosuke Niwa <rniwa@webkit.org> 2 13 -
trunk/LayoutTests/fast/mediastream/MediaStreamTrackEvent-constructor-expected.txt
r207588 r207711 13 13 14 14 *** Bubbles and cancelable true, track is missing *** 15 PASS new MediaStreamTrackEvent('MediaStreamTrackEvent', { bubbles: true, cancelable: true }) threw exception TypeError: Type error.15 PASS new MediaStreamTrackEvent('MediaStreamTrackEvent', { bubbles: true, cancelable: true }) threw exception TypeError: Member MediaStreamTrackEventInit.track is required and must be an instance of MediaStreamTrack. 16 16 17 17 *** Bubbles and cancelable true, invalid track *** -
trunk/Source/WebCore/ChangeLog
r207710 r207711 1 2016-10-22 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr> 2 3 Bindings error message for missing required dictionary member should be more explicit 4 https://bugs.webkit.org/show_bug.cgi?id=163665 5 6 Reviewed by Darin Adler. 7 8 Add throwRequiredMemberTypeError function to throw a TypeError exception with an error 9 message indicating the missing required member. 10 11 No new test required, rebase existing tests. 12 13 * bindings/js/JSDOMBinding.cpp: 14 (WebCore::throwRequiredMemberTypeError): 15 * bindings/js/JSDOMBinding.h: 16 * bindings/scripts/CodeGeneratorJS.pm: 17 (GenerateDictionaryImplementationContent): 18 * bindings/scripts/test/JS/JSTestObj.cpp: 19 (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>): 20 1 21 2016-10-22 Ryosuke Niwa <rniwa@webkit.org> 2 22 -
trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp
r207192 r207711 933 933 } 934 934 935 JSC::EncodedJSValue throwRequiredMemberTypeError(JSC::ExecState& state, JSC::ThrowScope& scope, const char* memberName, const char* dictionaryName, const char* expectedType) 936 { 937 StringBuilder builder; 938 builder.appendLiteral("Member "); 939 builder.append(dictionaryName); 940 builder.append('.'); 941 builder.append(memberName); 942 builder.appendLiteral(" is required and must be an instance of "); 943 builder.append(expectedType); 944 return throwVMTypeError(&state, scope, builder.toString()); 945 } 946 935 947 JSC::EncodedJSValue throwConstructorScriptExecutionContextUnavailableError(JSC::ExecState& state, JSC::ThrowScope& scope, const char* interfaceName) 936 948 { -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r207575 r207711 128 128 JSC::EncodedJSValue throwArgumentMustBeFunctionError(JSC::ExecState&, JSC::ThrowScope&, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName); 129 129 WEBCORE_EXPORT JSC::EncodedJSValue throwArgumentTypeError(JSC::ExecState&, JSC::ThrowScope&, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName, const char* expectedType); 130 WEBCORE_EXPORT JSC::EncodedJSValue throwRequiredMemberTypeError(JSC::ExecState&, JSC::ThrowScope&, const char* memberName, const char* dictionaryName, const char* expectedType); 130 131 JSC::EncodedJSValue throwConstructorScriptExecutionContextUnavailableError(JSC::ExecState&, JSC::ThrowScope&, const char* interfaceName); 131 132 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r207705 r207711 1162 1162 # 5.5. Otherwise, if value is undefined and the dictionary member is a required dictionary member, then throw a TypeError. 1163 1163 $result .= " } else {\n"; 1164 $result .= " throw TypeError(&state, throwScope);\n";1164 $result .= " throwRequiredMemberTypeError(state, throwScope, \"".$member->name."\", \"$name\", \"".$idlType->name."\");\n"; 1165 1165 $result .= " return { };\n"; 1166 1166 $result .= " }\n"; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r207705 r207711 714 714 RETURN_IF_EXCEPTION(throwScope, { }); 715 715 } else { 716 throw TypeError(&state, throwScope);716 throwRequiredMemberTypeError(state, throwScope, "nonNullableNode", "TestDictionaryThatShouldNotTolerateNull", "Node"); 717 717 return { }; 718 718 } … … 722 722 RETURN_IF_EXCEPTION(throwScope, { }); 723 723 } else { 724 throw TypeError(&state, throwScope);724 throwRequiredMemberTypeError(state, throwScope, "requiredDictionaryMember", "TestDictionaryThatShouldNotTolerateNull", "TestDictionary"); 725 725 return { }; 726 726 } … … 730 730 RETURN_IF_EXCEPTION(throwScope, { }); 731 731 } else { 732 throw TypeError(&state, throwScope);732 throwRequiredMemberTypeError(state, throwScope, "requiredEnumerationValue", "TestDictionaryThatShouldNotTolerateNull", "TestEnumType"); 733 733 return { }; 734 734 }
Note: See TracChangeset
for help on using the changeset viewer.