Skip to content

Commit 8517997

Browse files
committed
formatting tweaks
1 parent 6fcbe6e commit 8517997

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

lib/parser.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ module.exports = function (content) {
7373

7474
var result
7575
if (type === 'script') {
76-
result = commentScript(content.slice(0, start)) +
77-
content.slice(start, end) +
78-
commentScript(content.slice(end))
76+
result =
77+
commentScript(content.slice(0, start)) +
78+
content.slice(start, end) +
79+
commentScript(content.slice(end))
7980
} else {
8081
result = content.slice(start, end).trim()
8182
}
@@ -91,15 +92,16 @@ module.exports = function (content) {
9192
}
9293

9394
function commentScript (content) {
94-
return content.split(/\n\r|\n|\r/g)
95-
.map(function (line) {
96-
if (line.trim() === '') {
97-
return line
98-
} else {
99-
return '// ' + line
100-
}
101-
})
102-
.join('\n')
95+
return content
96+
.split(/\n\r|\n|\r/g)
97+
.map(function (line) {
98+
if (line.trim() === '') {
99+
return line
100+
} else {
101+
return '// ' + line
102+
}
103+
})
104+
.join('\n')
103105
}
104106

105107
function getAttribute (node, name) {

test/test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ describe('vue-loader', function () {
141141
getFile('test.build.js.map', function (map) {
142142
var smc = new SourceMapConsumer(JSON.parse(map))
143143
getFile('test.build.js', function (code) {
144-
console.log(code)
145144
var line
146145
code.split('\n').some(function (l, i) {
147146
if (l.indexOf('Hello from Component A') > -1) {

0 commit comments

Comments
 (0)