react / wstein / node_modules / jest-cli / node_modules / istanbul / node_modules / handlebars / node_modules / uglify-js / test / compress / sequences.js
80728 viewsmake_sequences_1: {1options = {2sequences: true3};4input: {5foo();6bar();7baz();8}9expect: {10foo(),bar(),baz();11}12}1314make_sequences_2: {15options = {16sequences: true17};18input: {19if (boo) {20foo();21bar();22baz();23} else {24x();25y();26z();27}28}29expect: {30if (boo) foo(),bar(),baz();31else x(),y(),z();32}33}3435make_sequences_3: {36options = {37sequences: true38};39input: {40function f() {41foo();42bar();43return baz();44}45function g() {46foo();47bar();48throw new Error();49}50}51expect: {52function f() {53return foo(), bar(), baz();54}55function g() {56throw foo(), bar(), new Error();57}58}59}6061make_sequences_4: {62options = {63sequences: true64};65input: {66x = 5;67if (y) z();6869x = 5;70for (i = 0; i < 5; i++) console.log(i);7172x = 5;73for (; i < 5; i++) console.log(i);7475x = 5;76switch (y) {}7778x = 5;79with (obj) {}80}81expect: {82if (x = 5, y) z();83for (x = 5, i = 0; i < 5; i++) console.log(i);84for (x = 5; i < 5; i++) console.log(i);85switch (x = 5, y) {}86with (x = 5, obj);87}88}8990lift_sequences_1: {91options = { sequences: true };92input: {93foo = !(x(), y(), bar());94}95expect: {96x(), y(), foo = !bar();97}98}99100lift_sequences_2: {101options = { sequences: true, evaluate: true };102input: {103q = 1 + (foo(), bar(), 5) + 7 * (5 / (3 - (a(), (QW=ER), c(), 2))) - (x(), y(), 5);104}105expect: {106foo(), bar(), a(), QW = ER, c(), x(), y(), q = 36107}108}109110lift_sequences_3: {111options = { sequences: true, conditionals: true };112input: {113x = (foo(), bar(), baz()) ? 10 : 20;114}115expect: {116foo(), bar(), x = baz() ? 10 : 20;117}118}119120lift_sequences_4: {121options = { side_effects: true };122input: {123x = (foo, bar, baz);124}125expect: {126x = baz;127}128}129130for_sequences: {131options = { sequences: true };132input: {133// 1134foo();135bar();136for (; false;);137// 2138foo();139bar();140for (x = 5; false;);141// 3142x = (foo in bar);143for (; false;);144// 4145x = (foo in bar);146for (y = 5; false;);147}148expect: {149// 1150for (foo(), bar(); false;);151// 2152for (foo(), bar(), x = 5; false;);153// 3154x = (foo in bar);155for (; false;);156// 4157x = (foo in bar);158for (y = 5; false;);159}160}161162163