Skip to content

Commit a42433c

Browse files
committedFeb 5, 2017
don't merge loc's (source maps doesn't support it anyway)
1 parent 6920da5 commit a42433c

File tree

3 files changed

+34
-22
lines changed

3 files changed

+34
-22
lines changed
 

‎lib/compressor/restructure/2-mergeAtrule.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ function processAtrule(node, item, list) {
2020
prev.expression &&
2121
node.expression.id === prev.expression.id) {
2222
prev.block.children.appendList(node.block.children);
23-
prev.loc = {
24-
primary: prev.loc,
25-
merged: node.loc
26-
};
2723
list.remove(item);
24+
25+
// TODO: use it when we can refer to several points in source
26+
// prev.loc = {
27+
// primary: prev.loc,
28+
// merged: node.loc
29+
// };
2830
}
2931
}
3032

‎lib/compressor/restructure/4-restructShorthand.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,16 @@ TRBL.prototype.add = function(name, declaration) {
233233
return false;
234234
}
235235

236-
if (this.loc) {
237-
this.loc = {
238-
primary: this.loc,
239-
merged: declaration.loc
240-
};
241-
} else {
236+
// TODO: use it when we can refer to several points in source
237+
// if (this.loc) {
238+
// this.loc = {
239+
// primary: this.loc,
240+
// merged: declaration.loc
241+
// };
242+
// } else {
243+
// this.loc = declaration.loc;
244+
// }
245+
if (!this.loc) {
242246
this.loc = declaration.loc;
243247
}
244248

‎lib/compressor/restructure/6-restructBlock.js

+18-12
Original file line numberDiff line numberDiff line change
@@ -214,26 +214,32 @@ function processRule(rule, item, list, props, fingerprints) {
214214
};
215215

216216
prev.block.remove(prev.item);
217-
declaration.loc = {
218-
primary: declaration.loc,
219-
merged: prev.item.data.loc
220-
};
217+
218+
// TODO: use it when we can refer to several points in source
219+
// declaration.loc = {
220+
// primary: declaration.loc,
221+
// merged: prev.item.data.loc
222+
// };
221223
} else {
222224
declarations.remove(declarationItem);
223-
prev.item.data.loc = {
224-
primary: prev.item.data.loc,
225-
merged: declaration.loc
226-
};
225+
226+
// TODO: use it when we can refer to several points in source
227+
// prev.item.data.loc = {
228+
// primary: prev.item.data.loc,
229+
// merged: declaration.loc
230+
// };
227231
}
228232
} else {
229233
var prev = needless(props, declaration, fingerprints);
230234

231235
if (prev) {
232236
declarations.remove(declarationItem);
233-
prev.item.data.loc = {
234-
primary: prev.item.data.loc,
235-
merged: declaration.loc
236-
};
237+
238+
// TODO: use it when we can refer to several points in source
239+
// prev.item.data.loc = {
240+
// primary: prev.item.data.loc,
241+
// merged: declaration.loc
242+
// };
237243
} else {
238244
declaration.fingerprint = fingerprint;
239245

0 commit comments

Comments
 (0)
Please sign in to comment.