Lines Matching refs:function
34 // function and block scopes.
36 function TestFunctionLocal(s) {
38 eval("(function(){" + s + "; })")();
46 function TestBlockLocal(s,e) {
48 eval("(function(){ {" + s + ";} })")();
57 function TestAll(s) {
77 TestAll('f(); let x; function f() { return x + 1; }');
78 TestAll('f(); let x; function f() { x = 1; }');
79 TestAll('f(); let x; function f() { x += 1; }');
80 TestAll('f(); let x; function f() { ++x; }');
81 TestAll('f(); let x; function f() { x++; }');
82 TestAll('f(); const x = 1; function f() { return x; }');
84 TestAll('f()(); let x; function f() { return function() { return x + 1; } }');
85 TestAll('f()(); let x; function f() { return function() { x = 1; } }');
86 TestAll('f()(); let x; function f() { return function() { x += 1; } }');
87 TestAll('f()(); let x; function f() { return function() { ++x; } }');
88 TestAll('f()(); let x; function f() { return function() { x++; } }');
89 TestAll('f()(); const x = 1; function f() { return function() { return x; } }');
100 TestAll('function f() { eval("var y = 2;"); x + 1; }; f(); let x;');
101 TestAll('function f() { eval("var y = 2;"); x = 1; }; f(); let x;');
102 TestAll('function f() { eval("var y = 2;"); x += 1; }; f(); let x;');
103 TestAll('function f() { eval("var y = 2;"); ++x; }; f(); let x;');
104 TestAll('function f() { eval("var y = 2;"); x++; }; f(); let x;');
106 // Test that variables introduced by function declarations are created and
107 // initialized upon entering a function / block scope.
108 function f() {
113 // block scoped function declaration
114 function g1() {
121 // function scoped function declaration
122 function g2() {
128 // Test that a function declaration introduces a block scoped variable.
129 TestAll('{ function k() { return 0; } }; k(); ');
131 // Test that a function declaration sees the scope it resides in.
132 function f2() {
136 function g() {
147 function h() {
156 function i() {
167 function j() {
177 function outer() {
178 function middle() {
179 function inner() {