Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(551)

Side by Side Diff: third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp

Issue 2342393002: Enable TypeError for dictionary members of non-nullable interface type (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% filter format_blink_cpp_source_code %} 1 {% filter format_blink_cpp_source_code %}
2 2
3 {% from 'utilities.cpp' import declare_enum_validation_variable %} 3 {% from 'utilities.cpp' import declare_enum_validation_variable %}
4 {% include 'copyright_block.txt' %} 4 {% include 'copyright_block.txt' %}
5 #include "{{v8_original_class}}.h" 5 #include "{{v8_original_class}}.h"
6 6
7 {% for filename in cpp_includes if filename != '%s.h' % v8_class %} 7 {% for filename in cpp_includes if filename != '%s.h' % v8_class %}
8 #include "{{filename}}" 8 #include "{{filename}}"
9 {% endfor %} 9 {% endfor %}
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 {% if member.is_nullable %} 61 {% if member.is_nullable %}
62 } else if ({{member.name}}Value->IsNull()) { 62 } else if ({{member.name}}Value->IsNull()) {
63 impl.{{member.null_setter_name}}(); 63 impl.{{member.null_setter_name}}();
64 {% endif %} 64 {% endif %}
65 } else { 65 } else {
66 {% if member.deprecate_as %} 66 {% if member.deprecate_as %}
67 Deprecation::countDeprecationIfNotPrivateScript(isolate, currentExecutio nContext(isolate), UseCounter::{{member.deprecate_as}}); 67 Deprecation::countDeprecationIfNotPrivateScript(isolate, currentExecutio nContext(isolate), UseCounter::{{member.deprecate_as}});
68 {% endif %} 68 {% endif %}
69 {{v8_value_to_local_cpp_value(member) | indent(8)}} 69 {{v8_value_to_local_cpp_value(member) | indent(8)}}
70 {% if member.is_interface_type %} 70 {% if member.is_interface_type %}
71 if (!{{member.name}} && !{{member.name}}Value->IsNull()) { 71 if (!{{member.name}}) {
72 exceptionState.throwTypeError("member {{member.name}} is not of type {{member.idl_type}}."); 72 exceptionState.throwTypeError("member {{member.name}} is not of type {{member.idl_type}}.");
73 return; 73 return;
74 } 74 }
75 {% endif %} 75 {% endif %}
76 {% if member.enum_values %} 76 {% if member.enum_values %}
77 {{declare_enum_validation_variable(member.enum_values) | indent(8)}} 77 {{declare_enum_validation_variable(member.enum_values) | indent(8)}}
78 if (!isValidEnum({{member.name}}, validValues, WTF_ARRAY_LENGTH(validVal ues), "{{member.enum_type}}", exceptionState)) 78 if (!isValidEnum({{member.name}}, validValues, WTF_ARRAY_LENGTH(validVal ues), "{{member.enum_type}}", exceptionState))
79 return; 79 return;
80 {% elif member.is_object %} 80 {% elif member.is_object %}
81 if (!{{member.name}}.isObject()) { 81 if (!{{member.name}}.isObject()) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 {{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate , v8::Local<v8::Value> value, ExceptionState& exceptionState) 133 {{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate , v8::Local<v8::Value> value, ExceptionState& exceptionState)
134 { 134 {
135 {{cpp_class}} impl; 135 {{cpp_class}} impl;
136 {{v8_class}}::toImpl(isolate, value, impl, exceptionState); 136 {{v8_class}}::toImpl(isolate, value, impl, exceptionState);
137 return impl; 137 return impl;
138 } 138 }
139 139
140 } // namespace blink 140 } // namespace blink
141 141
142 {% endfilter %}{# format_blink_cpp_source_code #} 142 {% endfilter %}{# format_blink_cpp_source_code #}
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698