fix syntax error in tests (#4652)

This commit is contained in:
Alex Lam S.L
2021-02-15 06:41:07 +00:00
committed by GitHub
parent 203ca2586a
commit 76b27891c6
2 changed files with 41 additions and 25 deletions

View File

@@ -399,7 +399,7 @@ unsafe_object_accessor: {
function f() { function f() {
var a = { var a = {
get b() {}, get b() {},
set b() {} set b(v) {},
}; };
return { a: a }; return { a: a };
} }
@@ -408,7 +408,7 @@ unsafe_object_accessor: {
function f() { function f() {
var a = { var a = {
get b() {}, get b() {},
set b() {} set b(v) {},
}; };
return { a: a }; return { a: a };
} }

View File

@@ -2,16 +2,32 @@ keep_name_of_getter: {
options = { options = {
unused: true, unused: true,
} }
input: { a = { get foo () {} } } input: {
expect: { a = { get foo () {} } } a = {
get foo() {},
};
}
expect: {
a = {
get foo() {},
};
}
} }
keep_name_of_setter: { keep_name_of_setter: {
options = { options = {
unused: true, unused: true,
} }
input: { a = { set foo () {} } } input: {
expect: { a = { set foo () {} } } a = {
set foo(v) {},
};
}
expect: {
a = {
set foo(v) {},
};
}
} }
setter_with_operator_keys: { setter_with_operator_keys: {
@@ -34,7 +50,7 @@ setter_with_operator_keys: {
}, },
get else() { get else() {
return test2; return test2;
} },
}; };
} }
expect: { expect: {
@@ -56,7 +72,7 @@ setter_with_operator_keys: {
}, },
get else() { get else() {
return test2; return test2;
} },
}; };
} }
} }