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

Side by Side Diff: Source/bindings/scripts/idl_definitions.py

Issue 1215093002: Clean up the IDL compiler around [SetWrapperReferenceFrom/To] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_interface.py » ('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 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 if child_class and child_class != 'Arguments': 878 if child_class and child_class != 'Arguments':
879 raise ValueError('[CustomConstructor] only supports Arguments as child, but has child of class: %s' % child_class) 879 raise ValueError('[CustomConstructor] only supports Arguments as child, but has child of class: %s' % child_class)
880 custom_constructors.append(child) 880 custom_constructors.append(child)
881 elif name == 'NamedConstructor': 881 elif name == 'NamedConstructor':
882 if child_class and child_class != 'Call': 882 if child_class and child_class != 'Call':
883 raise ValueError('[NamedConstructor] only supports Call as child , but has child of class: %s' % child_class) 883 raise ValueError('[NamedConstructor] only supports Call as child , but has child of class: %s' % child_class)
884 extended_attributes[name] = child 884 extended_attributes[name] = child
885 elif name == 'SetWrapperReferenceTo': 885 elif name == 'SetWrapperReferenceTo':
886 if not child: 886 if not child:
887 raise ValueError('[SetWrapperReferenceTo] requires a child, but has none.') 887 raise ValueError('[SetWrapperReferenceTo] requires a child, but has none.')
888 children = child.GetChildren()
889 if len(children) != 1:
890 raise ValueError('[SetWrapperReferenceTo] supports only one chil d.')
888 if child_class != 'Arguments': 891 if child_class != 'Arguments':
889 raise ValueError('[SetWrapperReferenceTo] only supports Argument s as child, but has child of class: %s' % child_class) 892 raise ValueError('[SetWrapperReferenceTo] only supports Argument s as child, but has child of class: %s' % child_class)
890 extended_attributes[name] = arguments_node_to_arguments(idl_name, ch ild) 893 extended_attributes[name] = IdlArgument(idl_name, children[0])
891 elif name == 'Exposed': 894 elif name == 'Exposed':
892 if child_class and child_class != 'Arguments': 895 if child_class and child_class != 'Arguments':
893 raise ValueError('[Exposed] only supports Arguments as child, bu t has child of class: %s' % child_class) 896 raise ValueError('[Exposed] only supports Arguments as child, bu t has child of class: %s' % child_class)
894 exposures = [] 897 exposures = []
895 if child_class == 'Arguments': 898 if child_class == 'Arguments':
896 exposures = [Exposure(exposed=str(arg.idl_type), 899 exposures = [Exposure(exposed=str(arg.idl_type),
897 runtime_enabled=arg.name) 900 runtime_enabled=arg.name)
898 for arg in arguments_node_to_arguments('*', child)] 901 for arg in arguments_node_to_arguments('*', child)]
899 else: 902 else:
900 value = extended_attribute_node.GetProperty('VALUE') 903 value = extended_attribute_node.GetProperty('VALUE')
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 self.visit_typed_object(argument) 1084 self.visit_typed_object(argument)
1082 1085
1083 def visit_iterable(self, iterable): 1086 def visit_iterable(self, iterable):
1084 self.visit_typed_object(iterable) 1087 self.visit_typed_object(iterable)
1085 1088
1086 def visit_maplike(self, maplike): 1089 def visit_maplike(self, maplike):
1087 self.visit_typed_object(maplike) 1090 self.visit_typed_object(maplike)
1088 1091
1089 def visit_setlike(self, setlike): 1092 def visit_setlike(self, setlike):
1090 self.visit_typed_object(setlike) 1093 self.visit_typed_object(setlike)
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_interface.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698