| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 """Generates JavaScript source files from a mojom.Module.""" | 5 """Generates JavaScript source files from a mojom.Module.""" |
| 6 | 6 |
| 7 from generate import mojom | 7 from generate import mojom |
| 8 from generate import mojom_pack | 8 from generate import mojom_pack |
| 9 from generate import mojom_generator | 9 from generate import mojom_generator |
| 10 | 10 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 self.Write(self.GenerateJsModule(), "%s.js" % self.module.name) | 218 self.Write(self.GenerateJsModule(), "%s.js" % self.module.name) |
| 219 | 219 |
| 220 def GetImports(self): | 220 def GetImports(self): |
| 221 # Since each import is assigned a variable in JS, they need to have unique | 221 # Since each import is assigned a variable in JS, they need to have unique |
| 222 # names. | 222 # names. |
| 223 counter = 1 | 223 counter = 1 |
| 224 for each in self.module.imports: | 224 for each in self.module.imports: |
| 225 each["unique_name"] = "import" + str(counter) | 225 each["unique_name"] = "import" + str(counter) |
| 226 counter += 1 | 226 counter += 1 |
| 227 return self.module.imports | 227 return self.module.imports |
| OLD | NEW |