-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d6063f
commit 0cad61b
Showing
12 changed files
with
55 additions
and
390 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
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
24 changes: 3 additions & 21 deletions
24
...s/babel-plugin-transform-template-literals/test/fixtures/default/cache-revision/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
24 changes: 3 additions & 21 deletions
24
packages/babel-plugin-transform-template-literals/test/fixtures/default/simple-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 |
---|---|---|
@@ -1,24 +1,6 @@ | ||
function _templateObject2() { | ||
const data = _taggedTemplateLiteral(["first", "second"]); | ||
|
||
_templateObject2 = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
|
||
function _templateObject() { | ||
const data = _taggedTemplateLiteral(["wow"]); | ||
|
||
_templateObject = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
var _templateObject, _templateObject2; | ||
|
||
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } | ||
|
||
var foo = tag(_templateObject()); | ||
var bar = tag(_templateObject2(), 1); | ||
var foo = tag(_templateObject || (_templateObject = _taggedTemplateLiteral(["wow"]))); | ||
var bar = tag(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["first", "second"])), 1); |
12 changes: 2 additions & 10 deletions
12
...ugin-transform-template-literals/test/fixtures/default/tag-with-unicode-escapes/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 |
---|---|---|
@@ -1,13 +1,5 @@ | ||
function _templateObject() { | ||
const data = _taggedTemplateLiteral(["aa\uD835\uDC9C\uD835\uDC9C"], ["\\u0061\\u{0061}\\ud835\\udc9c\\u{1d49c}"]); | ||
|
||
_templateObject = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
var _templateObject; | ||
|
||
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } | ||
|
||
var foo = bar(_templateObject()); | ||
var foo = bar(_templateObject || (_templateObject = _taggedTemplateLiteral(["aa\uD835\uDC9C\uD835\uDC9C"], ["\\u0061\\u{0061}\\ud835\\udc9c\\u{1d49c}"]))); |
36 changes: 4 additions & 32 deletions
36
packages/babel-plugin-transform-template-literals/test/fixtures/default/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 |
---|---|---|
@@ -1,35 +1,7 @@ | ||
function _templateObject3() { | ||
const data = _taggedTemplateLiteral(["wow\naB", " ", ""], ["wow\\naB", " ", ""]); | ||
|
||
_templateObject3 = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
|
||
function _templateObject2() { | ||
const data = _taggedTemplateLiteral(["wow\nab", " ", ""], ["wow\\nab", " ", ""]); | ||
|
||
_templateObject2 = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
|
||
function _templateObject() { | ||
const data = _taggedTemplateLiteral(["wow\na", "b ", ""], ["wow\\na", "b ", ""]); | ||
|
||
_templateObject = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
var _templateObject, _templateObject2, _templateObject3; | ||
|
||
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } | ||
|
||
var foo = bar(_templateObject(), 42, _.foobar()); | ||
var bar = bar(_templateObject2(), 42, _.foobar()); | ||
var bar = bar(_templateObject3(), 42, _.baz()); | ||
var foo = bar(_templateObject || (_templateObject = _taggedTemplateLiteral(["wow\na", "b ", ""], ["wow\\na", "b ", ""])), 42, _.foobar()); | ||
var bar = bar(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["wow\nab", " ", ""], ["wow\\nab", " ", ""])), 42, _.foobar()); | ||
var bar = bar(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["wow\naB", " ", ""], ["wow\\naB", " ", ""])), 42, _.baz()); |
96 changes: 9 additions & 87 deletions
96
...abel-plugin-transform-template-literals/test/fixtures/default/template-revision/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 |
---|---|---|
@@ -1,94 +1,16 @@ | ||
function _templateObject8() { | ||
const data = _taggedTemplateLiteral([void 0], ["\\01"]); | ||
|
||
_templateObject8 = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
|
||
function _templateObject7() { | ||
const data = _taggedTemplateLiteral(["left", void 0, "right"], ["left", "\\u{-0}", "right"]); | ||
|
||
_templateObject7 = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
|
||
function _templateObject6() { | ||
const data = _taggedTemplateLiteral(["left", void 0, "right"], ["left", "\\u000g", "right"]); | ||
|
||
_templateObject6 = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
|
||
function _templateObject5() { | ||
const data = _taggedTemplateLiteral(["left", void 0, "right"], ["left", "\\xg", "right"]); | ||
|
||
_templateObject5 = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
|
||
function _templateObject4() { | ||
const data = _taggedTemplateLiteral(["left", void 0], ["left", "\\xg"]); | ||
|
||
_templateObject4 = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
|
||
function _templateObject3() { | ||
const data = _taggedTemplateLiteral([void 0, "right"], ["\\xg", "right"]); | ||
|
||
_templateObject3 = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
|
||
function _templateObject2() { | ||
const data = _taggedTemplateLiteral([void 0], ["\\01"]); | ||
|
||
_templateObject2 = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
|
||
function _templateObject() { | ||
const data = _taggedTemplateLiteral([void 0], ["\\unicode and \\u{55}"]); | ||
|
||
_templateObject = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8; | ||
|
||
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } | ||
|
||
tag(_templateObject()); | ||
tag(_templateObject2()); | ||
tag(_templateObject3(), 0); | ||
tag(_templateObject4(), 0); | ||
tag(_templateObject5(), 0, 1); | ||
tag(_templateObject6(), 0, 1); | ||
tag(_templateObject7(), 0, 1); | ||
tag(_templateObject || (_templateObject = _taggedTemplateLiteral([void 0], ["\\unicode and \\u{55}"]))); | ||
tag(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral([void 0], ["\\01"]))); | ||
tag(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral([void 0, "right"], ["\\xg", "right"])), 0); | ||
tag(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["left", void 0], ["left", "\\xg"])), 0); | ||
tag(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["left", void 0, "right"], ["left", "\\xg", "right"])), 0, 1); | ||
tag(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["left", void 0, "right"], ["left", "\\u000g", "right"])), 0, 1); | ||
tag(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["left", void 0, "right"], ["left", "\\u{-0}", "right"])), 0, 1); | ||
|
||
function a() { | ||
var undefined = 4; | ||
tag(_templateObject8()); | ||
tag(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral([void 0], ["\\01"]))); | ||
} |
36 changes: 4 additions & 32 deletions
36
packages/babel-plugin-transform-template-literals/test/fixtures/loose/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 |
---|---|---|
@@ -1,35 +1,7 @@ | ||
function _templateObject3() { | ||
const data = _taggedTemplateLiteralLoose(["wow\naB", " ", ""], ["wow\\naB", " ", ""]); | ||
|
||
_templateObject3 = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
|
||
function _templateObject2() { | ||
const data = _taggedTemplateLiteralLoose(["wow\nab", " ", ""], ["wow\\nab", " ", ""]); | ||
|
||
_templateObject2 = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
|
||
function _templateObject() { | ||
const data = _taggedTemplateLiteralLoose(["wow\na", "b ", ""], ["wow\\na", "b ", ""]); | ||
|
||
_templateObject = function () { | ||
return data; | ||
}; | ||
|
||
return data; | ||
} | ||
var _templateObject, _templateObject2, _templateObject3; | ||
|
||
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; } | ||
|
||
var foo = bar(_templateObject(), 42, _.foobar()); | ||
var bar = bar(_templateObject2(), 42, _.foobar()); | ||
var bar = bar(_templateObject3(), 42, _.baz()); | ||
var foo = bar(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["wow\na", "b ", ""], ["wow\\na", "b ", ""])), 42, _.foobar()); | ||
var bar = bar(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["wow\nab", " ", ""], ["wow\\nab", " ", ""])), 42, _.foobar()); | ||
var bar = bar(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["wow\naB", " ", ""], ["wow\\naB", " ", ""])), 42, _.baz()); |
Oops, something went wrong.