Upstream version 11.39.266.0
[platform/framework/web/crosswalk.git] / src / mojo / public / tools / bindings / generators / js_templates / module.js.tmpl
index 9b30468..93fa537 100644 (file)
@@ -3,34 +3,42 @@
 // found in the LICENSE file.
 
 define("{{module.path}}", [
-    "mojo/public/js/bindings/core",
     "mojo/public/js/bindings/codec",
+    "mojo/public/js/bindings/validator",
 {%- for import in imports %}
     "{{import.module.path}}",
 {%- endfor %}
-  ], function(core, codec
+  ], function(codec, validator
 {%- for import in imports -%}
     , {{import.unique_name}}
 {%- endfor -%}
 ) {
 
+{#--- Constants #}
+{%  for constant in module.constants %}
+  var {{constant.name}} = {{constant.value|expression_to_text}};
+{%- endfor %}
+
 {#--- Enums #}
-{%  from "enum_definition.tmpl" import enum_def -%}
-{%  for enum in enums %}
+{%- from "enum_definition.tmpl" import enum_def %}
+{%- for enum in enums %}
   var {{ enum_def(enum.name, enum, module) }}
 {%-  endfor %}
 
 {#--- Struct definitions #}
 {%  for struct in structs %}
 {%-   include "struct_definition.tmpl" %}
-{%- endfor %}
+{%- endfor -%}
 
 {#--- Interface definitions #}
-{%- for interface in interfaces %}
+{%- for interface in interfaces -%}
 {%-   include "interface_definition.tmpl" %}
 {%- endfor %}
 
   var exports = {};
+{%-  for constant in module.constants %}
+  exports.{{constant.name}} = {{constant.name}};
+{%- endfor %}
 {%- for enum in enums %}
   exports.{{enum.name}} = {{enum.name}};
 {%- endfor %}