Skip to content

Commit 1f87847

Browse files
committed
added function merging
1 parent 37353d1 commit 1f87847

File tree

4 files changed

+494
-2
lines changed

4 files changed

+494
-2
lines changed

build/transformations/functionMerging.js

Lines changed: 237 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ stream:
3434
- name: Unicode Literal
3535
file: ./transformations/unicodeLiteral.js
3636
enabled: true
37+
- name: Function Definition Reordering
38+
file: ./transformations/functionDefinitionReordering.js
39+
enabled: true
3740
- name: Function Arguments Reordering
3841
file: ./transformations/functionArgumentsReordering.js
3942
enabled: true
40-
- name: Function Definition Reordering
41-
file: ./transformations/functionDefinitionReordering.js
43+
- name: Function Merging
44+
file: ./transformations/functionMerging.js
4245
enabled: true
4346
- name: Eval Outlining
4447
file: ./transformations/evalOutlining.js

sample/simple.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
'use strict';
22

3+
function add(a, b) {
4+
console.log('test');
5+
return a + b + 10;
6+
}
7+
8+
function sub(a, b) {
9+
return a - b - 420;
10+
}
11+
12+
console.log(add(5, 5));
13+
console.log(sub(5, 5));
14+
15+
/*
316
function args(a, b, c) {
417
var d = a - b - c;
518
d += 5;

0 commit comments

Comments
 (0)