// Memory leak when defining functions #359
// https://github.com/espruino/Espruino/issues/359

function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 
function test() {console.log("rawr");} 

var mem = process.memory().usage; 
result = mem < 80;

@@ -1054,16 +1054,115 @@
 %7D %0A%0Avar 
+mem;%0A// use timeout to ensure that the actual source code has been freed%0AsetTimeout(function() %7B%0A  
 mem = pr
@@ -1184,16 +1184,38 @@
 usage; %0A
+  console.log(mem);%0A  
 result =
@@ -1225,8 +1225,15 @@
 m %3C 
-8
+9
 0;%0A
+%7D,10);%0A

fix function decl test