we can now merge functions... not smart, but it works...

This commit is contained in:
overflowerror 2014-05-21 01:13:12 +02:00
parent a5f8e1bde7
commit d4fe00eec1

10
main.js
View file

@ -42,6 +42,16 @@ function clone(object){
return tmp; return tmp;
} }
function extendFunction(function1, function2) {
// I guess, we don't need more than 5 parameters.
return new Function("a, b, c, d, e", "\
var tmp1 = (" + function1.toString() + ")(a, b, c, d, e);\
var tmp2 = (" + function2.toString() + ")(a, b, c, d, e);\
return tmp1 | tmp2" // Problem if one return-value is an Object-
);
}
var main = function () { var main = function () {
Emulator.init(document.getElementById("output"), document.forms['form'].elements['input'], 80, 24); Emulator.init(document.getElementById("output"), document.forms['form'].elements['input'], 80, 24);
} }