Skip to content

Commit 0b3350f

Browse files
committed
comments + minor change for pull vuejs#719
1 parent f96075d commit 0b3350f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/parsers/expression.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ var saved = []
3737
/**
3838
* Save replacer
3939
*
40+
* The save regex can match two possible cases:
41+
* 1. An opening object literal
42+
* 2. A string
43+
* If matched as a plain string, we need to escape its
44+
* newlines, since the string needs to be preserved when
45+
* generating the function body.
46+
*
4047
* @param {String} str
4148
* @param {String} isString - str if matched as a string
4249
* @return {String} - placeholder with index
@@ -46,7 +53,7 @@ function save (str, isString) {
4653
var i = saved.length
4754
saved[i] = isString
4855
? str.replace(newlineRE, '\\n')
49-
: str.replace(wsRE,'')
56+
: str
5057
return '"' + i + '"'
5158
}
5259

0 commit comments

Comments
 (0)