Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a31153c

Browse filesBrowse files
thefourtheyeMyles Borins
authored andcommitted
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 <shvyo1987@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 6dfe7ae commit a31153c
Copy full SHA for a31153c

File tree

Expand file treeCollapse file tree

1 file changed

+0
-23
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+0
-23
lines changed
Open diff view settings
Collapse file

‎tools/js2c.py‎

Copy file name to clipboardExpand all lines: tools/js2c.py
-23Lines changed: 0 additions & 23 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.