remove rawValue property from JSX inner text Literal nodes

This commit is contained in:
Sebastian McKenzie 2015-07-26 05:30:27 +01:00
parent 9c2621519a
commit 6f607ef053
3 changed files with 10 additions and 5 deletions

View File

@ -13,6 +13,11 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
See [CHANGELOG - 6to5](CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
## 5.8.6
* **Bug Fix**
* Remove `rawValue` for JSX inner text.
## 5.8.5
* **Polish**

View File

@ -144,10 +144,7 @@ export function _Literal(node) {
// just use the raw property if our current value is equivalent to the one we got
// when we populated raw
if (node.raw != null && node.rawValue != null && val === node.rawValue) {
// https://github.com/babel/babel/issues/2078
if (typeof val !== "string" || node.raw[0] === "'" || node.raw[0] === '"') {
return node.raw;
}
return node.raw;
}
switch (typeof val) {

View File

@ -379,7 +379,10 @@ export default function(instance) {
instance.extend("parseExprAtom", function(inner) {
return function(refShortHandDefaultPos) {
if (this.match(tt.jsxText)) {
return this.parseLiteral(this.state.value);
var node = this.parseLiteral(this.state.value);
// https://github.com/babel/babel/issues/2078
node.rawValue = null;
return node;
} else if (this.match(tt.jsxTagStart)) {
return this.jsxParseElement();
} else {