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

Unified Diff: Source/bindings/templates/dictionary_v8.cpp

Issue 946973005: IDL: Drop value conversion (V8 -> C++) macros from generated code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/templates/conversions.cpp ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/dictionary_v8.cpp
diff --git a/Source/bindings/templates/dictionary_v8.cpp b/Source/bindings/templates/dictionary_v8.cpp
index 084666b692998a55a5ea7e8cd85947ac8dae48ee..0d30807092ddef4c565b9c42f7ea61e278e5072f 100644
--- a/Source/bindings/templates/dictionary_v8.cpp
+++ b/Source/bindings/templates/dictionary_v8.cpp
@@ -13,8 +13,7 @@
namespace blink {
-{% macro convert_and_set_member(member) %}
-{% endmacro %}
+{% from 'conversions.cpp' import v8_value_to_local_cpp_value %}
void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{cpp_class}}& impl, ExceptionState& exceptionState)
{
if (isUndefinedOrNull(v8Value))
@@ -22,10 +21,11 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{
if (!v8Value->IsObject()) {
{% if use_permissive_dictionary_conversion %}
// Do nothing.
+ return;
{% else %}
exceptionState.throwTypeError("cannot convert to dictionary.");
- {% endif %}
return;
+ {% endif %}
}
{% if parent_v8_class %}
@@ -55,10 +55,7 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{
{% if member.deprecate_as %}
UseCounter::countDeprecationIfNotPrivateScript(isolate, callingExecutionContext(isolate), UseCounter::{{member.deprecate_as}});
{% endif %}
- {% if member.use_output_parameter_for_result %}
- {{member.cpp_type}} {{member.name}};
- {% endif %}
- {{member.v8_value_to_local_cpp_value}};
+ {{v8_value_to_local_cpp_value(member) | indent(8)}}
{% if member.is_interface_type %}
if (!{{member.name}} && !{{member.name}}Value->IsNull()) {
exceptionState.throwTypeError("member {{member.name}} is not of type {{member.idl_type}}.");
« no previous file with comments | « Source/bindings/templates/conversions.cpp ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698