Skip to content

Commit f683c2e

Browse files
committed
ensure stability of output JS by using OrderedDict
1 parent ad887f8 commit f683c2e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/mergejs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import re
4141
import os
4242
import sys
43+
from collections import OrderedDict
4344

4445
SUFFIX_JAVASCRIPT = ".js"
4546

@@ -176,7 +177,7 @@ def run (sourceDirectory, outputFilename = None, configFile = None,
176177
## Header inserted at the start of each file in the output
177178
HEADER = "/* " + "=" * 70 + "\n %s\n" + " " + "=" * 70 + " */\n\n"
178179

179-
files = {}
180+
files = OrderedDict()
180181

181182
## Import file source code
182183
## TODO: Do import when we walk the directories above?
@@ -213,7 +214,7 @@ def run (sourceDirectory, outputFilename = None, configFile = None,
213214
raise MissingImport("File '%s' not found (required by '%s')." % (path, filepath))
214215

215216
# create dictionary of dependencies
216-
dependencies = {}
217+
dependencies = OrderedDict()
217218
for filepath, info in files.items():
218219
dependencies[filepath] = info.requires
219220

0 commit comments

Comments
 (0)