wrote more of the compressor and added some tests
This commit is contained in:
60
test/compress/sequences.js
Normal file
60
test/compress/sequences.js
Normal file
@@ -0,0 +1,60 @@
|
||||
make_sequences_1: {
|
||||
options = {
|
||||
sequences: true
|
||||
};
|
||||
input: {
|
||||
foo();
|
||||
bar();
|
||||
baz();
|
||||
}
|
||||
expect: {
|
||||
foo(),bar(),baz();
|
||||
}
|
||||
}
|
||||
|
||||
make_sequences_2: {
|
||||
options = {
|
||||
sequences: true
|
||||
};
|
||||
input: {
|
||||
if (boo) {
|
||||
foo();
|
||||
bar();
|
||||
baz();
|
||||
} else {
|
||||
x();
|
||||
y();
|
||||
z();
|
||||
}
|
||||
}
|
||||
expect: {
|
||||
if (boo) foo(),bar(),baz();
|
||||
else x(),y(),z();
|
||||
}
|
||||
}
|
||||
|
||||
make_sequences_3: {
|
||||
options = {
|
||||
sequences: true
|
||||
};
|
||||
input: {
|
||||
function f() {
|
||||
foo();
|
||||
bar();
|
||||
return baz();
|
||||
}
|
||||
function g() {
|
||||
foo();
|
||||
bar();
|
||||
throw new Error();
|
||||
}
|
||||
}
|
||||
expect: {
|
||||
function f() {
|
||||
return foo(), bar(), baz();
|
||||
}
|
||||
function g() {
|
||||
throw foo(), bar(), new Error();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user