Skip to content

Commit 58986b7

Browse files
committedFeb 8, 2017
Space -> WhiteSpace
1 parent f217458 commit 58986b7

File tree

9 files changed

+16
-17
lines changed

9 files changed

+16
-17
lines changed
 

‎lib/compressor/clean/Space.js ‎lib/compressor/clean/WhiteSpace.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ module.exports = function cleanWhitespace(node, item, list) {
33
return;
44
}
55

6-
if (item.prev !== null && item.prev.data.type === 'Space') {
6+
if (item.prev !== null && item.prev.data.type === 'WhiteSpace') {
77
list.remove(item.prev);
88
}
99

10-
if (item.next !== null && item.next.data.type === 'Space') {
10+
if (item.next !== null && item.next.data.type === 'WhiteSpace') {
1111
list.remove(item.next);
1212
}
1313
};

‎lib/compressor/clean/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var handlers = {
55
Declaration: require('./Declaration'),
66
TypeSelector: require('./TypeSelector'),
77
Comment: require('./Comment'),
8-
Operator: require('./Space')
8+
Operator: require('./WhiteSpace')
99
};
1010

1111
module.exports = function(ast, usageData) {

‎lib/compressor/compress/color.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,9 @@ function compressFunction(node, item, list) {
414414

415415
// check if color is not at the end and not followed by space
416416
var next = item.next;
417-
if (next && next.data.type !== 'Space') {
417+
if (next && next.data.type !== 'WhiteSpace') {
418418
list.insert(list.createItem({
419-
type: 'Space',
419+
type: 'WhiteSpace',
420420
value: ' '
421421
}), next);
422422
}

‎lib/compressor/compress/property/background.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = function compressBackground(node) {
88
}
99

1010
function flush() {
11-
if (lastType() === 'Space') {
11+
if (lastType() === 'WhiteSpace') {
1212
buffer.pop();
1313
}
1414

@@ -20,7 +20,7 @@ module.exports = function compressBackground(node) {
2020
value: '0'
2121
},
2222
{
23-
type: 'Space',
23+
type: 'WhiteSpace',
2424
value: ' '
2525
},
2626
{
@@ -57,7 +57,7 @@ module.exports = function compressBackground(node) {
5757
}
5858

5959
// don't add redundant spaces
60-
if (node.type === 'Space' && (!buffer.length || lastType() === 'Space')) {
60+
if (node.type === 'WhiteSpace' && (!buffer.length || lastType() === 'WhiteSpace')) {
6161
return;
6262
}
6363

‎lib/compressor/compress/property/font.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ module.exports = function compressFont(node) {
2929

3030
// remove redundant spaces
3131
list.each(function(node, item) {
32-
if (node.type === 'Space') {
33-
if (!item.prev || !item.next || item.next.data.type === 'Space') {
32+
if (node.type === 'WhiteSpace') {
33+
if (!item.prev || !item.next || item.next.data.type === 'WhiteSpace') {
3434
this.remove(item);
3535
}
3636
}

‎lib/compressor/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function readChunk(children, specialComments) {
2727
return;
2828
}
2929

30-
if (node.type !== 'Space') {
30+
if (node.type !== 'WhiteSpace') {
3131
nonSpaceTokenInBuffer = true;
3232
}
3333

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ TRBL.prototype.getValueSequence = function(declaration, count) {
124124
special = child.name;
125125
break;
126126

127-
case 'Space':
127+
case 'WhiteSpace':
128128
return false; // ignore space
129129

130130
default:
@@ -296,14 +296,14 @@ TRBL.prototype.getValue = function() {
296296

297297
for (var i = 0; i < values.length; i++) {
298298
if (i) {
299-
result.appendData({ type: 'Space', value: ' ' });
299+
result.appendData({ type: 'WhiteSpace', value: ' ' });
300300
}
301301

302302
result.appendData(values[i].node);
303303
}
304304

305305
if (this.iehack) {
306-
result.appendData({ type: 'Space', value: ' ' });
306+
result.appendData({ type: 'WhiteSpace', value: ' ' });
307307
result.appendData({
308308
type: 'Identifier',
309309
loc: null,

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ var NEEDLESS_TABLE = {
6363
function getPropertyFingerprint(propertyName, declaration, fingerprints) {
6464
var realName = resolveProperty(propertyName).name;
6565

66-
if (realName === 'background' ||
67-
(realName === 'filter' && declaration.value.children.first().type === 'Progid')) {
66+
if (realName === 'background') {
6867
return propertyName + ':' + translate(declaration.value);
6968
}
7069

‎lib/compressor/restructure/prepare/processSelector.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ module.exports = function freeze(node, usageData) {
6969
}
7070
break;
7171

72-
case 'Space':
72+
case 'WhiteSpace':
7373
case 'Combinator':
7474
tagName = '*';
7575
break;

0 commit comments

Comments
 (0)
Please sign in to comment.