summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-12-09 21:30:09 -0500
committerEliot Horowitz <eliot@10gen.com>2010-02-26 18:06:02 -0500
commit8e3d106320a2471a2dc3d694984d6a73cf5074e4 (patch)
treecea8f7e0c344ac29dd968b28c7bedf4276622372
parent76d4703561145d18e609b3e206a6a661ba553724 (diff)
downloadmongo-8e3d106320a2471a2dc3d694984d6a73cf5074e4.tar.gz
strip comments from javascript
-rw-r--r--SConstruct17
1 files changed, 16 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index b860995f06b..8499f0b7cb3 100644
--- a/SConstruct
+++ b/SConstruct
@@ -843,6 +843,8 @@ def concatjs(target, source, env):
fullSource = ""
+ first = True
+
for s in source:
f = open( str(s) , 'r' )
for l in f:
@@ -850,8 +852,21 @@ def concatjs(target, source, env):
if len ( l ) == 0:
continue
- fullSource += l + "\n"
+ if l == "}":
+ fullSource += "}"
+ continue
+
+ if first:
+ first = False
+ else:
+ fullSource += "\n"
+
+ fullSource += l
+
+ fullSource += "\n"
+ fullSource = re.compile( r'/\*\*.*?\*/' , re.M | re.S ).sub( "" , fullSource )
+
out = open( outFile , 'w' )
out.write( fullSource )