diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-05-03 19:14:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-03 19:14:56 +0800 |
commit | d51a00a4508022e54e257d93442abff42c4442b7 (patch) | |
tree | 43e7c7c32e046f3ca65e6763fff049e933a920c8 /test/compress/sequences.js | |
parent | fc0f168a0c4d81d724339af881b6ad466e02b0b5 (diff) | |
download | tracifyjs-d51a00a4508022e54e257d93442abff42c4442b7.tar.gz tracifyjs-d51a00a4508022e54e257d93442abff42c4442b7.zip |
compress `AST_Sequence` within `AST_Call` (#3117)
Diffstat (limited to 'test/compress/sequences.js')
-rw-r--r-- | test/compress/sequences.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/test/compress/sequences.js b/test/compress/sequences.js index 12acbcf7..8aede12b 100644 --- a/test/compress/sequences.js +++ b/test/compress/sequences.js @@ -876,3 +876,59 @@ forin: { } expect_stdout: "PASS" } + +call: { + options = { + sequences: true, + } + input: { + var a = function() { + return this; + }(); + function b() { + console.log("foo"); + } + b.c = function() { + console.log(this === b ? "bar" : "baz"); + }; + (a, b)(); + (a, b.c)(); + (a, function() { + console.log(this === a); + })(); + new (a, b)(); + new (a, b.c)(); + new (a, function() { + console.log(this === a); + })(); + } + expect: { + var a = function() { + return this; + }(); + function b() { + console.log("foo"); + } + b.c = function() { + console.log(this === b ? "bar" : "baz"); + }, + a, b(), + (a, b.c)(), + a, function() { + console.log(this === a); + }(), + a, new b(), + a, new b.c(), + a, new function() { + console.log(this === a); + }(); + } + expect_stdout: [ + "foo", + "baz", + "true", + "foo", + "baz", + "false", + ] +} |