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

Side by Side Diff: third_party/WebKit/Source/bindings/scripts/v8_interface.py

Issue 2175463002: IDL: Support callback interface in overload resolution (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix arg name Created 4 years, 5 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/idls/core/TestObject.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # coding=utf-8 2 # coding=utf-8
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 # [constructor(sequence<DOMString> arg), constructor(Dictionary arg)] 1100 # [constructor(sequence<DOMString> arg), constructor(Dictionary arg)]
1101 # interface I { ... } 1101 # interface I { ... }
1102 # (Need to check array types before objects because an array is an object) 1102 # (Need to check array types before objects because an array is an object)
1103 for idl_type, method in idl_types_methods: 1103 for idl_type, method in idl_types_methods:
1104 if idl_type.native_array_element_type: 1104 if idl_type.native_array_element_type:
1105 # (We test for Array instead of generic Object to type-check.) 1105 # (We test for Array instead of generic Object to type-check.)
1106 # FIXME: test for Object during resolution, then have type check for 1106 # FIXME: test for Object during resolution, then have type check for
1107 # Array in overloaded method: http://crbug.com/262383 1107 # Array in overloaded method: http://crbug.com/262383
1108 yield '%s->IsArray()' % cpp_value, method 1108 yield '%s->IsArray()' % cpp_value, method
1109 for idl_type, method in idl_types_methods: 1109 for idl_type, method in idl_types_methods:
1110 if idl_type.is_dictionary or idl_type.name == 'Dictionary': 1110 if idl_type.is_dictionary or idl_type.name == 'Dictionary' or idl_type.i s_callback_interface:
1111 # FIXME: should be '{1}->IsObject() && !{1}->IsDate() && !{1}->IsReg Exp()'.format(cpp_value) 1111 # FIXME: should be '{1}->IsObject() && !{1}->IsRegExp()'.format(cpp_ value)
1112 # FIXME: the IsDate and IsRegExp checks can be skipped if we've 1112 # FIXME: the IsRegExp checks can be skipped if we've
1113 # already generated tests for them. 1113 # already generated tests for them.
1114 yield '%s->IsObject()' % cpp_value, method 1114 yield '%s->IsObject()' % cpp_value, method
1115 1115
1116 # (Check for exact type matches before performing automatic type conversion; 1116 # (Check for exact type matches before performing automatic type conversion;
1117 # only needed if distinguishing between primitive types.) 1117 # only needed if distinguishing between primitive types.)
1118 if len([idl_type.is_primitive_type for idl_type in idl_types]) > 1: 1118 if len([idl_type.is_primitive_type for idl_type in idl_types]) > 1:
1119 # (Only needed if match in step 11, otherwise redundant.) 1119 # (Only needed if match in step 11, otherwise redundant.)
1120 if any(idl_type.is_string_type or idl_type.is_enum 1120 if any(idl_type.is_string_type or idl_type.is_enum
1121 for idl_type in idl_types): 1121 for idl_type in idl_types):
1122 # 10. Otherwise: if V is a Number value, and there is an entry in S 1122 # 10. Otherwise: if V is a Number value, and there is an entry in S
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 extended_attributes = deleter.extended_attributes 1386 extended_attributes = deleter.extended_attributes
1387 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState') 1387 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState')
1388 is_ce_reactions = 'CEReactions' in extended_attributes 1388 is_ce_reactions = 'CEReactions' in extended_attributes
1389 return { 1389 return {
1390 'is_call_with_script_state': is_call_with_script_state, 1390 'is_call_with_script_state': is_call_with_script_state,
1391 'is_ce_reactions': is_ce_reactions, 1391 'is_ce_reactions': is_ce_reactions,
1392 'is_custom': 'Custom' in extended_attributes, 1392 'is_custom': 'Custom' in extended_attributes,
1393 'is_raises_exception': 'RaisesException' in extended_attributes, 1393 'is_raises_exception': 'RaisesException' in extended_attributes,
1394 'name': cpp_name(deleter), 1394 'name': cpp_name(deleter),
1395 } 1395 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698