From d4fe00eec1a0eaabac08a575343eb29286cab1c5 Mon Sep 17 00:00:00 2001 From: overflowerror Date: Wed, 21 May 2014 01:13:12 +0200 Subject: [PATCH] we can now merge functions... not smart, but it works... --- main.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.js b/main.js index b77d5f8..3dce552 100644 --- a/main.js +++ b/main.js @@ -42,6 +42,16 @@ function clone(object){ 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 () { Emulator.init(document.getElementById("output"), document.forms['form'].elements['input'], 80, 24); }