Skip to content

Commit 3b8b9e0

Browse files
committed
Stop forcing debugging comments when creating sourcemap
1 parent c84f25c commit 3b8b9e0

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

pysass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ PySass_compile_filename(PyObject *self, PyObject *args) {
575575
context = sass_make_file_context(filename);
576576
options = sass_file_context_get_options(context);
577577

578-
if (source_comments && PySass_Bytes_Check(source_map_filename)) {
578+
if (PySass_Bytes_Check(source_map_filename)) {
579579
size_t source_map_file_len = PySass_Bytes_GET_SIZE(source_map_filename);
580580
if (source_map_file_len) {
581581
char *source_map_file = (char *) malloc(source_map_file_len + 1);

sass.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,6 @@ def my_importer(path):
537537
raise CompileError('source_map_filename is only available with '
538538
'filename= keyword argument since it has to be '
539539
'aware of it')
540-
if source_map_filename is not None:
541-
source_comments = True
542540
try:
543541
include_paths = kwargs.pop('include_paths') or b''
544542
except KeyError:

sasstests.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ def normalize_path(path):
4545
'''
4646

4747
A_EXPECTED_CSS_WITH_MAP = '''\
48-
/* line 6, SOURCE */
4948
body {
5049
background-color: green; }
51-
/* line 8, SOURCE */
5250
body a {
5351
color: blue; }
5452
@@ -60,8 +58,8 @@ def normalize_path(path):
6058
'sources': ['test/a.scss'],
6159
'names': [],
6260
'mappings': (
63-
';AAKA,AAAA,IAAI,CAAC;EAHH,gBAAgB,EAAE,KAAM,GAQzB;;EALD,AAEE,IAFE,'
64-
'CAEF,CAAC,CAAC;IACA,KAAK,EAAE,IAAK,GACb'
61+
'AAKA,AAAA,IAAI,CAAC;EAHH,gBAAgB,EAAE,KAAM,GAQzB;EALD,AAEE,'
62+
'IAFE,CAEF,CAAC,CAAC;IACA,KAAK,EAAE,IAAK,GACb'
6563
),
6664
}
6765

@@ -71,7 +69,6 @@ def normalize_path(path):
7169
'''
7270

7371
B_EXPECTED_CSS_WITH_MAP = '''\
74-
/* line 2, SOURCE */
7572
b i {
7673
font-size: 20px; }
7774
@@ -97,10 +94,8 @@ def normalize_path(path):
9794

9895
D_EXPECTED_CSS_WITH_MAP = '''\
9996
@charset "UTF-8";
100-
/* line 6, SOURCE */
10197
body {
10298
background-color: green; }
103-
/* line 8, SOURCE */
10499
body a {
105100
font: '나눔고딕', sans-serif; }
106101
@@ -446,10 +441,7 @@ def test_compile_source_map(self):
446441
source_map_filename='a.scss.css.map'
447442
)
448443
self.assertEqual(
449-
A_EXPECTED_CSS_WITH_MAP.replace(
450-
'SOURCE',
451-
normalize_path(os.path.abspath(filename))
452-
),
444+
A_EXPECTED_CSS_WITH_MAP,
453445
actual
454446
)
455447
self.assert_source_map_equal(A_EXPECTED_MAP, source_map)
@@ -612,7 +604,7 @@ def replace_source_path(s, name):
612604
'sources': ['../test/b.scss'],
613605
'names': [],
614606
'mappings': (
615-
';AAAA,AACE,CADD,CACC,CAAC,CAAC;EACA,SAAS,EAAE,IAAK,'
607+
'AAAA,AACE,CADD,CACC,CAAC,CAAC;EACA,SAAS,EAAE,IAAK,'
616608
'GACjB'
617609
),
618610
},
@@ -632,7 +624,7 @@ def replace_source_path(s, name):
632624
'sources': ['../test/d.scss'],
633625
'names': [],
634626
'mappings': (
635-
';;AAKA,AAAA,IAAI,CAAC;EAHH,gBAAgB,EAAE,KAAM,GAQzB;;'
627+
';AAKA,AAAA,IAAI,CAAC;EAHH,gBAAgB,EAAE,KAAM,GAQzB;'
636628
'EALD,AAEE,IAFE,CAEF,CAAC,CAAC;IACA,IAAI,EAAE,0BAA2B,'
637629
'GAClC'
638630
),
@@ -667,7 +659,7 @@ def test_wsgi_sass_middleware(self):
667659
self.assertEqual(200, r.status_code)
668660
src_path = normalize_path(os.path.join(src_dir, 'a.scss'))
669661
self.assert_bytes_equal(
670-
b(A_EXPECTED_CSS_WITH_MAP.replace('SOURCE', src_path)),
662+
b(A_EXPECTED_CSS_WITH_MAP),
671663
r.data
672664
)
673665
self.assertEqual('text/css', r.mimetype)
@@ -818,9 +810,7 @@ def test_sassc_sourcemap(self):
818810
self.assertEqual('', self.out.getvalue())
819811
with open(out_filename) as f:
820812
self.assertEqual(
821-
A_EXPECTED_CSS_WITH_MAP.replace(
822-
'SOURCE', normalize_path(src_filename)
823-
),
813+
A_EXPECTED_CSS_WITH_MAP,
824814
f.read().strip()
825815
)
826816
with open(out_filename + '.map') as f:

0 commit comments

Comments
 (0)