Index: mojo/public/tools/bindings/generators/mojom_js_generator.py |
diff --git a/mojo/public/tools/bindings/generators/mojom_js_generator.py b/mojo/public/tools/bindings/generators/mojom_js_generator.py |
index ef4c2ef7b876dc1b28b2927320e91e6e1e7dfa42..13a9c39b4ebcad4fc15c1554d9d07681706976ac 100644 |
--- a/mojo/public/tools/bindings/generators/mojom_js_generator.py |
+++ b/mojo/public/tools/bindings/generators/mojom_js_generator.py |
@@ -157,16 +157,18 @@ class Generator(generator.Generator): |
if self.variant: |
raise Exception("Variants not supported in JavaScript bindings.") |
+ # TODO(yzshen): Add a JavaScriptStylizer. |
+ self.module.Stylize(generator.Stylizer()) |
+ |
# TODO(yzshen): Remove this method once the old JS bindings go away. |
self._SetUniqueNameForImports() |
- self.Write(self._GenerateAMDModule(), |
- self.MatchMojomFilePath("%s.js" % self.module.name)) |
+ self.Write(self._GenerateAMDModule(), "%s.js" % self.module.path) |
def _SetUniqueNameForImports(self): |
used_names = set() |
for each_import in self.module.imports: |
- simple_name = each_import.name.split(".")[0] |
+ simple_name = os.path.basename(each_import.path).split(".")[0] |
# Since each import is assigned a variable in JS, they need to have unique |
# names. |