blob: cf349765ac067c8edd81e84529b58ebfa96cec25 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
{%- if use_new_js_bindings %}
"use strict";
(function() {
// TODO(yzshen): Define these aliases to minimize the differences between the
// old/new modes. Remove them when the old mode goes away.
var bindings = mojoBindings;
var codec = mojoBindings.internal;
var validator = mojoBindings.internal;
{%- for import in imports %}
var {{import.unique_name}} = {{import.module.namespace}};
{%- endfor %}
{% include "module_definition.tmpl" %}
})();
{%- else %}
define("{{module.path}}", [
{%- if module.path != "mojo/public/interfaces/bindings/interface_control_messages.mojom" %}
"mojo/public/js/bindings",
{%- endif %}
"mojo/public/js/codec",
"mojo/public/js/core",
"mojo/public/js/validator",
{%- for import in imports %}
"{{import.module.path}}",
{%- endfor %}
], function(
{%- if module.path != "mojo/public/interfaces/bindings/interface_control_messages.mojom" -%}
bindings, {% endif -%}
codec, core, validator
{%- for import in imports -%}
, {{import.unique_name}}
{%- endfor -%}
) {
{%- include "module_definition.tmpl" %}
return exports;
});
{%- endif %}