fix(es): Ensure that #1681 is fixed (#1970)

swc:
 - Ensure #1681 is fixed. (#1681)
This commit is contained in:
강동윤 2021-08-02 23:18:50 +09:00 committed by GitHub
parent be23e66ca8
commit 6285f20cfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 216 additions and 0 deletions

View File

@ -0,0 +1,5 @@
{
"jsc": {
"target": "es2015"
}
}

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View 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()));

View File

@ -0,0 +1,5 @@
{
"jsc": {
"target": "es2016"
}
}

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View File

@ -0,0 +1,5 @@
{
"jsc": {
"target": "es2017"
}
}

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View File

@ -0,0 +1,5 @@
{
"jsc": {
"target": "es2018"
}
}

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View File

@ -0,0 +1,5 @@
{
"jsc": {
"target": "es2019"
}
}

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View File

@ -0,0 +1,5 @@
{
"jsc": {
"target": "es2020"
}
}

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View File

@ -0,0 +1,5 @@
{
"jsc": {
"target": "es2021"
}
}

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View File

@ -0,0 +1,5 @@
{
"jsc": {
"target": "es3"
}
}

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View 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()));

View File

@ -0,0 +1,5 @@
{
"jsc": {
"target": "es5"
}
}

View File

@ -0,0 +1,5 @@
console.log(String.raw`a
b
c
`);
console.log(String.raw`a\nb\nc\n`);

View 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()));