OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 {%- if use_new_js_bindings %} | |
6 | |
7 "use strict"; | |
8 | |
9 (function() { | |
10 // TODO(yzshen): Define these aliases to minimize the differences between the | |
11 // old/new modes. Remove them when the old mode goes away. | |
12 var bindings = mojoBindings; | |
13 var codec = mojoBindings.internal; | |
14 var validator = mojoBindings.internal; | |
15 {%- for import in imports %} | |
16 var {{import.unique_name}} = {{import.module.namespace}}; | |
17 {%- endfor %} | |
18 | |
19 {% include "module_definition.tmpl" %} | |
20 })(); | |
21 | |
22 {%- else %} | |
23 | |
24 define("{{module.path}}", [ | 5 define("{{module.path}}", [ |
25 {%- if module.path != "mojo/public/interfaces/bindings/interface_control_messa
ges.mojom" %} | 6 {%- if module.path != "mojo/public/interfaces/bindings/interface_control_message
s.mojom" %} |
26 "mojo/public/js/bindings", | 7 "mojo/public/js/bindings", |
27 {%- endif %} | 8 {%- endif %} |
28 "mojo/public/js/codec", | 9 "mojo/public/js/codec", |
29 "mojo/public/js/core", | 10 "mojo/public/js/core", |
30 "mojo/public/js/validator", | 11 "mojo/public/js/validator", |
31 {%- for import in imports %} | 12 {%- for import in imports %} |
32 "{{import.module.path}}", | 13 "{{import.module.path}}", |
33 {%- endfor %} | 14 {%- endfor %} |
34 ], function( | 15 ], function( |
35 {%- if module.path != "mojo/public/interfaces/bindings/interface_control_message
s.mojom" -%} | 16 {%- if module.path != "mojo/public/interfaces/bindings/interface_control_message
s.mojom" -%} |
36 bindings, {% endif -%} | 17 bindings, {% endif -%} |
37 codec, core, validator | 18 codec, core, validator |
38 {%- for import in imports -%} | 19 {%- for import in imports -%} |
39 , {{import.unique_name}} | 20 , {{import.unique_name}} |
40 {%- endfor -%} | 21 {%- endfor -%} |
41 ) { | 22 ) { |
42 | 23 |
43 {%- include "module_definition.tmpl" %} | 24 {%- include "module_definition.tmpl" %} |
44 | 25 |
45 return exports; | 26 return exports; |
46 }); | 27 }); |
47 | |
48 {%- endif %} | |
OLD | NEW |