| OLD | NEW |
| 1 {##############################################################################} | 1 {##############################################################################} |
| 2 {% macro generate_method(method, world_suffix) %} | 2 {% macro generate_method(method, world_suffix) %} |
| 3 {% filter conditional(method.conditional_string) %} | 3 {% filter conditional(method.conditional_string) %} |
| 4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) | 4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) |
| 5 { | 5 { |
| 6 {% if method.has_exception_state %} | 6 {% if method.has_exception_state %} |
| 7 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na
me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); | 7 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na
me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); |
| 8 {% endif %} | 8 {% endif %} |
| 9 {% if method.name in ['addEventListener', 'removeEventListener'] %} | 9 {% if method.name in ['addEventListener', 'removeEventListener'] %} |
| 10 {{add_remove_event_listener_method(method.name) | indent}} | 10 {{add_remove_event_listener_method(method.name) | indent}} |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 ScriptState& state = *currentState; | 170 ScriptState& state = *currentState; |
| 171 {% endif %} | 171 {% endif %} |
| 172 {% if method.is_call_with_execution_context %} | 172 {% if method.is_call_with_execution_context %} |
| 173 ExecutionContext* scriptContext = getExecutionContext(); | 173 ExecutionContext* scriptContext = getExecutionContext(); |
| 174 {% endif %} | 174 {% endif %} |
| 175 {% if method.is_call_with_script_arguments %} | 175 {% if method.is_call_with_script_arguments %} |
| 176 RefPtr<ScriptArguments> scriptArguments(createScriptArguments(info, {{method.num
ber_of_arguments}})); | 176 RefPtr<ScriptArguments> scriptArguments(createScriptArguments(info, {{method.num
ber_of_arguments}})); |
| 177 {% endif %} | 177 {% endif %} |
| 178 {% if method.idl_type == 'void' %} | 178 {% if method.idl_type == 'void' %} |
| 179 {{cpp_value}}; | 179 {{cpp_value}}; |
| 180 {% elif method.is_call_with_script_state %} | 180 {% elif method.is_call_with_script_state or method.is_raises_exception %} |
| 181 {# FIXME: consider always using a local variable #} | 181 {# FIXME: consider always using a local variable #} |
| 182 {{method.cpp_type}} result = {{cpp_value}}; | 182 {{method.cpp_type}} result = {{cpp_value}}; |
| 183 {% endif %} | 183 {% endif %} |
| 184 {% if method.is_raises_exception %} | 184 {% if method.is_raises_exception %} |
| 185 if (exceptionState.throwIfNeeded()) | 185 if (exceptionState.throwIfNeeded()) |
| 186 return; | 186 return; |
| 187 {% endif %} | 187 {% endif %} |
| 188 {% if method.is_call_with_script_state %} | 188 {% if method.is_call_with_script_state %} |
| 189 if (state.hadException()) { | 189 if (state.hadException()) { |
| 190 v8::Local<v8::Value> exception = state.exception(); | 190 v8::Local<v8::Value> exception = state.exception(); |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 v8::Handle<v8::Object> wrapper = info.Holder(); | 390 v8::Handle<v8::Object> wrapper = info.Holder(); |
| 391 {% if is_constructor_raises_exception %} | 391 {% if is_constructor_raises_exception %} |
| 392 if (exceptionState.throwIfNeeded()) | 392 if (exceptionState.throwIfNeeded()) |
| 393 return; | 393 return; |
| 394 {% endif %} | 394 {% endif %} |
| 395 | 395 |
| 396 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8
_class}}Constructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfigu
ration::Dependent); | 396 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8
_class}}Constructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfigu
ration::Dependent); |
| 397 v8SetReturnValue(info, wrapper); | 397 v8SetReturnValue(info, wrapper); |
| 398 } | 398 } |
| 399 {% endmacro %} | 399 {% endmacro %} |
| OLD | NEW |