forked from orizens/echoes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
29 lines (28 loc) · 656 Bytes
/
test.html
File metadata and controls
29 lines (28 loc) · 656 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
</head>
<body>
<button id="test">create a leak</button>
<script type="text/javascript">
function closureDemoParentFunction(paramA)
{
var a = paramA;
return function closureDemoInnerFunction (paramB)
{
console.log( a +" "+ paramB);
};
};
// var x = closureDemoParentFunction("outer x");
// x("inner x");
var leaks = [];
function createLeak(ev){
leaks.push(closureDemoParentFunction("outer " + Math.floor(Math.random()*1000)));
}
document.getElementById('test').addEventListener(
'click', createLeak);
</script>
</body>
</html>