aboutsummaryrefslogtreecommitdiff
path: root/test/compress/pure_getters.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-03-16 01:42:28 +0000
committerGitHub <noreply@github.com>2021-03-16 09:42:28 +0800
commit77c9116c91e8a758263ab68a7a7f720dcb7e0214 (patch)
treee9b496ea2c925d5315cf4d4de3229ba945220926 /test/compress/pure_getters.js
parente821787095d856448940ab93a7a03febb7e644de (diff)
downloadtracifyjs-77c9116c91e8a758263ab68a7a7f720dcb7e0214.tar.gz
tracifyjs-77c9116c91e8a758263ab68a7a7f720dcb7e0214.zip
fix corner case in `unsafe` (#4783)
Diffstat (limited to 'test/compress/pure_getters.js')
-rw-r--r--test/compress/pure_getters.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/compress/pure_getters.js b/test/compress/pure_getters.js
index 13f9d4fe..bf6f73ef 100644
--- a/test/compress/pure_getters.js
+++ b/test/compress/pure_getters.js
@@ -1490,3 +1490,49 @@ issue_4751: {
};
}
}
+
+super_toString: {
+ options = {
+ pure_getters: true,
+ unsafe: true,
+ }
+ input: {
+ console.log({
+ f() {
+ return super.toString();
+ },
+ }.f());
+ }
+ expect: {
+ console.log({
+ f() {
+ return super.toString();
+ },
+ }.f());
+ }
+ expect_stdout: "[object Object]"
+ node_version: ">=4"
+}
+
+this_toString: {
+ options = {
+ pure_getters: true,
+ unsafe: true,
+ }
+ input: {
+ console.log({
+ f() {
+ return this.toString();
+ },
+ }.f());
+ }
+ expect: {
+ console.log({
+ f() {
+ return "" + this;
+ },
+ }.f());
+ }
+ expect_stdout: "[object Object]"
+ node_version: ">=4"
+}