Skip to content

Commit 550dcee

Browse files
committed
fix coverage
1 parent b69b4a4 commit 550dcee

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/platforms/web/compiler/modules/style.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ function transformNode (el: ASTElement, options: CompilerOptions) {
1212
const warn = options.warn || baseWarn
1313
const staticStyle = getAndRemoveAttr(el, 'style')
1414
if (staticStyle) {
15+
/* istanbul ignore if */
1516
if (process.env.NODE_ENV !== 'production') {
1617
const expression = parseText(staticStyle, options.delimiters)
1718
if (expression) {

src/platforms/web/util/style.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@
33
import { cached, extend, toObject } from 'shared/util'
44

55
export const parseStyleText = cached(function (cssText) {
6-
const rs = {}
7-
if (!cssText) {
8-
return rs
9-
}
6+
const res = {}
107
const hasBackground = cssText.indexOf('background') >= 0
118
// maybe with background-image: url(http://xxx) or base64 img
129
const listDelimiter = hasBackground ? /;(?![^(]*\))/g : ';'
1310
const propertyDelimiter = hasBackground ? /:(.+)/ : ':'
1411
cssText.split(listDelimiter).forEach(function (item) {
1512
if (item) {
1613
var tmp = item.split(propertyDelimiter)
17-
tmp.length > 1 && (rs[tmp[0].trim()] = tmp[1].trim())
14+
tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim())
1815
}
1916
})
20-
return rs
17+
return res
2118
})
2219

2320
// merge static and dynamic style data on the same vnode

0 commit comments

Comments
 (0)