Chromium Code Reviews| Index: Source/bindings/templates/attributes.cpp |
| diff --git a/Source/bindings/templates/attributes.cpp b/Source/bindings/templates/attributes.cpp |
| index 50f45c10347209f050277f1db47feaf5ed9499ef..80593fe954028bb5ffcab279ed5cd474c2489722 100644 |
| --- a/Source/bindings/templates/attributes.cpp |
| +++ b/Source/bindings/templates/attributes.cpp |
| @@ -107,7 +107,18 @@ static void {{attribute.name}}AttributeGetterCallback{{world_suffix}}(v8::Local< |
| static void {{attribute.name}}AttributeSetter{{world_suffix}}(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| { |
| {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder()); |
| + {% if attribute.idl_type == 'EventHandler' and interface_name == 'Window' %} |
| + if (!imp->document()) |
|
haraken
2013/10/19 12:41:29
I think this check should be moved to core/ if the
Nils Barth (inactive)
2013/10/21 02:41:38
28 attribute setters.
haraken
2013/10/21 03:43:52
OK, then it would make sense to keep the check in
Nils Barth (inactive)
2013/10/21 03:58:34
Got it, n/p!
|
| + return; |
| + {% endif %} |
| + {% if attribute.idl_type != 'EventHandler' %} |
| {{attribute.v8_value_to_local_cpp_value}}; |
| + {% else %}{# EventHandler hack #} |
| + {# Non-callable input should be treated as null #} |
| + if (!jsValue->IsNull() && !jsValue->IsFunction()) |
| + jsValue = v8::Null(info.GetIsolate()); |
| + transferHiddenDependency(info.Holder(), {{attribute.event_handler_getter_expression}}, jsValue, {{v8_class_name}}::eventListenerCacheIndex, info.GetIsolate()); |
| + {% endif %} |
| {% if attribute.is_call_with_script_execution_context %} |
| ExecutionContext* scriptContext = getExecutionContext(); |
| {% endif %} |