mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 02:06:08 +03:00
parent
be23e66ca8
commit
6285f20cfa
5
tests/fixture/issue-1681/es2015/input/.swcrc
Normal file
5
tests/fixture/issue-1681/es2015/input/.swcrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"jsc": {
|
||||||
|
"target": "es2015"
|
||||||
|
}
|
||||||
|
}
|
5
tests/fixture/issue-1681/es2015/input/input.js
Normal file
5
tests/fixture/issue-1681/es2015/input/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
32
tests/fixture/issue-1681/es2015/output/input.js
Normal file
32
tests/fixture/issue-1681/es2015/output/input.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
function _taggedTemplateLiteral(strings, raw) {
|
||||||
|
if (!raw) {
|
||||||
|
raw = strings.slice(0);
|
||||||
|
}
|
||||||
|
return Object.freeze(Object.defineProperties(strings, {
|
||||||
|
raw: {
|
||||||
|
value: Object.freeze(raw)
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
function _templateObject() {
|
||||||
|
var data = _taggedTemplateLiteral([
|
||||||
|
"a\nb\nc\n"
|
||||||
|
]);
|
||||||
|
_templateObject = function _templateObject() {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
function _templateObject1() {
|
||||||
|
var data = _taggedTemplateLiteral([
|
||||||
|
"a\nb\nc\n"
|
||||||
|
], [
|
||||||
|
"a\nb\nc\nc\n"
|
||||||
|
]);
|
||||||
|
_templateObject1 = function _templateObject1() {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
console.log(String.raw(_templateObject()));
|
||||||
|
console.log(String.raw(_templateObject1()));
|
5
tests/fixture/issue-1681/es2016/input/.swcrc
Normal file
5
tests/fixture/issue-1681/es2016/input/.swcrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"jsc": {
|
||||||
|
"target": "es2016"
|
||||||
|
}
|
||||||
|
}
|
5
tests/fixture/issue-1681/es2016/input/input.js
Normal file
5
tests/fixture/issue-1681/es2016/input/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
5
tests/fixture/issue-1681/es2016/output/input.js
Normal file
5
tests/fixture/issue-1681/es2016/output/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
5
tests/fixture/issue-1681/es2017/input/.swcrc
Normal file
5
tests/fixture/issue-1681/es2017/input/.swcrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"jsc": {
|
||||||
|
"target": "es2017"
|
||||||
|
}
|
||||||
|
}
|
5
tests/fixture/issue-1681/es2017/input/input.js
Normal file
5
tests/fixture/issue-1681/es2017/input/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
5
tests/fixture/issue-1681/es2017/output/input.js
Normal file
5
tests/fixture/issue-1681/es2017/output/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
5
tests/fixture/issue-1681/es2018/input/.swcrc
Normal file
5
tests/fixture/issue-1681/es2018/input/.swcrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"jsc": {
|
||||||
|
"target": "es2018"
|
||||||
|
}
|
||||||
|
}
|
5
tests/fixture/issue-1681/es2018/input/input.js
Normal file
5
tests/fixture/issue-1681/es2018/input/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
5
tests/fixture/issue-1681/es2018/output/input.js
Normal file
5
tests/fixture/issue-1681/es2018/output/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
5
tests/fixture/issue-1681/es2019/input/.swcrc
Normal file
5
tests/fixture/issue-1681/es2019/input/.swcrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"jsc": {
|
||||||
|
"target": "es2019"
|
||||||
|
}
|
||||||
|
}
|
5
tests/fixture/issue-1681/es2019/input/input.js
Normal file
5
tests/fixture/issue-1681/es2019/input/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
5
tests/fixture/issue-1681/es2019/output/input.js
Normal file
5
tests/fixture/issue-1681/es2019/output/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
5
tests/fixture/issue-1681/es2020/input/.swcrc
Normal file
5
tests/fixture/issue-1681/es2020/input/.swcrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"jsc": {
|
||||||
|
"target": "es2020"
|
||||||
|
}
|
||||||
|
}
|
5
tests/fixture/issue-1681/es2020/input/input.js
Normal file
5
tests/fixture/issue-1681/es2020/input/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
5
tests/fixture/issue-1681/es2020/output/input.js
Normal file
5
tests/fixture/issue-1681/es2020/output/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
5
tests/fixture/issue-1681/es2021/input/.swcrc
Normal file
5
tests/fixture/issue-1681/es2021/input/.swcrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"jsc": {
|
||||||
|
"target": "es2021"
|
||||||
|
}
|
||||||
|
}
|
5
tests/fixture/issue-1681/es2021/input/input.js
Normal file
5
tests/fixture/issue-1681/es2021/input/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
5
tests/fixture/issue-1681/es2021/output/input.js
Normal file
5
tests/fixture/issue-1681/es2021/output/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
5
tests/fixture/issue-1681/es3/input/.swcrc
Normal file
5
tests/fixture/issue-1681/es3/input/.swcrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"jsc": {
|
||||||
|
"target": "es3"
|
||||||
|
}
|
||||||
|
}
|
5
tests/fixture/issue-1681/es3/input/input.js
Normal file
5
tests/fixture/issue-1681/es3/input/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
32
tests/fixture/issue-1681/es3/output/input.js
Normal file
32
tests/fixture/issue-1681/es3/output/input.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
function _taggedTemplateLiteral(strings, raw) {
|
||||||
|
if (!raw) {
|
||||||
|
raw = strings.slice(0);
|
||||||
|
}
|
||||||
|
return Object.freeze(Object.defineProperties(strings, {
|
||||||
|
raw: {
|
||||||
|
value: Object.freeze(raw)
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
function _templateObject() {
|
||||||
|
var data = _taggedTemplateLiteral([
|
||||||
|
"a\nb\nc\n"
|
||||||
|
]);
|
||||||
|
_templateObject = function _templateObject() {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
function _templateObject1() {
|
||||||
|
var data = _taggedTemplateLiteral([
|
||||||
|
"a\nb\nc\n"
|
||||||
|
], [
|
||||||
|
"a\\nb\\nc\\n"
|
||||||
|
]);
|
||||||
|
_templateObject1 = function _templateObject1() {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
console.log(String.raw(_templateObject()));
|
||||||
|
console.log(String.raw(_templateObject1()));
|
5
tests/fixture/issue-1681/es5/input/.swcrc
Normal file
5
tests/fixture/issue-1681/es5/input/.swcrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"jsc": {
|
||||||
|
"target": "es5"
|
||||||
|
}
|
||||||
|
}
|
5
tests/fixture/issue-1681/es5/input/input.js
Normal file
5
tests/fixture/issue-1681/es5/input/input.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
console.log(String.raw`a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
`);
|
||||||
|
console.log(String.raw`a\nb\nc\n`);
|
32
tests/fixture/issue-1681/es5/output/input.js
Normal file
32
tests/fixture/issue-1681/es5/output/input.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
function _taggedTemplateLiteral(strings, raw) {
|
||||||
|
if (!raw) {
|
||||||
|
raw = strings.slice(0);
|
||||||
|
}
|
||||||
|
return Object.freeze(Object.defineProperties(strings, {
|
||||||
|
raw: {
|
||||||
|
value: Object.freeze(raw)
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
function _templateObject() {
|
||||||
|
var data = _taggedTemplateLiteral([
|
||||||
|
"a\nb\nc\n"
|
||||||
|
]);
|
||||||
|
_templateObject = function _templateObject() {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
function _templateObject1() {
|
||||||
|
var data = _taggedTemplateLiteral([
|
||||||
|
"a\nb\nc\n"
|
||||||
|
], [
|
||||||
|
"a\\nb\\nc\\n"
|
||||||
|
]);
|
||||||
|
_templateObject1 = function _templateObject1() {
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
console.log(String.raw(_templateObject()));
|
||||||
|
console.log(String.raw(_templateObject1()));
|
Loading…
Reference in New Issue
Block a user