Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
mutableTemplateObject
and ignoreToPrimitiveHint
assumpt…
…ions
- Loading branch information
1 parent
da76ea2
commit 3ef32c5
Showing
41 changed files
with
56 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
...n-transform-template-literals/test/fixtures/assumption-ignoreToPrimitiveHint/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"plugins": ["transform-template-literals"], | ||
"assumptions": { | ||
"ignoreToPrimitiveHint": true | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...n-transform-template-literals/test/fixtures/assumption-ignoreToPrimitiveHint/tag/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tag`foo ${bar} baz`; |
13 changes: 13 additions & 0 deletions
13
...-transform-template-literals/test/fixtures/assumption-ignoreToPrimitiveHint/tag/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function _templateObject() { | ||
const data = _taggedTemplateLiteral(["foo ", " baz"]); | ||
|
||
_templateObject = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
|
||
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } | ||
|
||
tag(_templateObject(), bar); |
1 change: 1 addition & 0 deletions
1
...ransform-template-literals/test/fixtures/assumption-mutableTemplateObject/no-tag/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
`foo ${bar} baz`; |
1 change: 1 addition & 0 deletions
1
...ansform-template-literals/test/fixtures/assumption-mutableTemplateObject/no-tag/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"foo ".concat(bar, " baz"); |
6 changes: 6 additions & 0 deletions
6
...n-transform-template-literals/test/fixtures/assumption-mutableTemplateObject/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"plugins": ["transform-template-literals"], | ||
"assumptions": { | ||
"mutableTemplateObject": true | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...bel-plugin-transform-template-literals/test/fixtures/loose/ignoreToPrimitiveHint/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var o = `foo ${bar} baz`; |
1 change: 1 addition & 0 deletions
1
...el-plugin-transform-template-literals/test/fixtures/loose/ignoreToPrimitiveHint/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var o = "foo " + bar + " baz"; |
1 change: 1 addition & 0 deletions
1
...bel-plugin-transform-template-literals/test/fixtures/loose/mutableTemplateObject/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var o = tag`foo ${bar} baz`; |
13 changes: 13 additions & 0 deletions
13
...el-plugin-transform-template-literals/test/fixtures/loose/mutableTemplateObject/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function _templateObject() { | ||
const data = _taggedTemplateLiteralLoose(["foo ", " baz"]); | ||
|
||
_templateObject = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
|
||
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; } | ||
|
||
var o = tag(_templateObject(), bar); |