Skip to content

Commit a31153c

Browse files
thefourtheyeMyles Borins
authored and
Myles Borins
committed
tools: remove the minifying logic
As the minifier logic is not used at all, this patch removes the code necessary for it. PR-URL: #6636 Reviewed-By: Jackson Tian <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 6dfe7ae commit a31153c

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

tools/js2c.py

-23
Original file line numberDiff line numberDiff line change
@@ -32,36 +32,15 @@
3232
# library.
3333

3434
import os
35-
from os.path import dirname
3635
import re
3736
import sys
3837
import string
3938

40-
sys.path.append(dirname(__file__) + "/../deps/v8/tools");
41-
import jsmin
42-
4339

4440
def ToCArray(filename, lines):
4541
return ','.join(str(ord(c)) for c in lines)
4642

4743

48-
def CompressScript(lines, do_jsmin):
49-
# If we're not expecting this code to be user visible, we can run it through
50-
# a more aggressive minifier.
51-
if do_jsmin:
52-
minifier = JavaScriptMinifier()
53-
return minifier.JSMinify(lines)
54-
55-
# Remove stuff from the source that we don't want to appear when
56-
# people print the source code using Function.prototype.toString().
57-
# Note that we could easily compress the scripts mode but don't
58-
# since we want it to remain readable.
59-
#lines = re.sub('//.*\n', '\n', lines) # end-of-line comments
60-
#lines = re.sub(re.compile(r'/\*.*?\*/', re.DOTALL), '', lines) # comments.
61-
#lines = re.sub('\s+\n+', '\n', lines) # trailing whitespace
62-
return lines
63-
64-
6544
def ReadFile(filename):
6645
file = open(filename, "rt")
6746
try:
@@ -264,11 +243,9 @@ def JS2C(source, target):
264243
for s in modules:
265244
delay = str(s).endswith('-delay.js')
266245
lines = ReadFile(str(s))
267-
do_jsmin = lines.find('// jsminify this file, js2c: jsmin') != -1
268246

269247
lines = ExpandConstants(lines, consts)
270248
lines = ExpandMacros(lines, macros)
271-
lines = CompressScript(lines, do_jsmin)
272249
data = ToCArray(s, lines)
273250

274251
# On Windows, "./foo.bar" in the .gyp file is passed as "foo.bar"

0 commit comments

Comments
 (0)