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

Side by Side Diff: mojo/public/tools/bindings/generators/js_templates/module_definition.tmpl

Issue 2549683002: Mojo JS bindings: introduce concepts that are more similar to C++ bindings: (Closed)
Patch Set: put interface control methods in the |ptr| property Created 4 years 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 | « mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {#--- Constants #} 1 {#--- Constants #}
2 {%- for constant in module.constants %} 2 {%- for constant in module.constants %}
3 var {{constant.name}} = {{constant.value|expression_to_text}}; 3 var {{constant.name}} = {{constant.value|expression_to_text}};
4 {%- endfor %} 4 {%- endfor %}
5 5
6 {#--- Enums #} 6 {#--- Enums #}
7 {%- from "enum_definition.tmpl" import enum_def %} 7 {%- from "enum_definition.tmpl" import enum_def %}
8 {%- for enum in enums %} 8 {%- for enum in enums %}
9 var {{ enum_def(enum.name, enum) }} 9 var {{ enum_def(enum.name, enum) }}
10 {%- endfor %} 10 {%- endfor %}
(...skipping 22 matching lines...) Expand all
33 exports.{{enum.name}} = {{enum.name}}; 33 exports.{{enum.name}} = {{enum.name}};
34 {%- endfor %} 34 {%- endfor %}
35 {%- for struct in structs if struct.exported %} 35 {%- for struct in structs if struct.exported %}
36 exports.{{struct.name}} = {{struct.name}}; 36 exports.{{struct.name}} = {{struct.name}};
37 {%- endfor %} 37 {%- endfor %}
38 {%- for union in unions %} 38 {%- for union in unions %}
39 exports.{{union.name}} = {{union.name}}; 39 exports.{{union.name}} = {{union.name}};
40 {%- endfor %} 40 {%- endfor %}
41 {%- for interface in interfaces %} 41 {%- for interface in interfaces %}
42 exports.{{interface.name}} = {{interface.name}}; 42 exports.{{interface.name}} = {{interface.name}};
43 exports.{{interface.name}}Ptr = {{interface.name}}Ptr;
43 {#--- Interface Client #} 44 {#--- Interface Client #}
44 {%- if interface.client in interfaces|map(attribute='name') %} 45 {%- if interface.client in interfaces|map(attribute='name') %}
45 exports.{{interface.name}}.client = {{interface.client}}; 46 exports.{{interface.name}}.client = {{interface.client}};
46 {%- elif interface.client in imported_interfaces %} 47 {%- elif interface.client in imported_interfaces %}
47 exports.{{interface.name}}.client = {{imported_interfaces[interface.client]}}; 48 exports.{{interface.name}}.client = {{imported_interfaces[interface.client]}};
48 {%- endif %} 49 {%- endif %}
49 {%- endfor %} 50 {%- endfor %}
OLDNEW
« no previous file with comments | « mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698