Lines Matching refs:function
33 // function and block scopes.
35 function TestFunctionLocal(s) {
37 eval("(function(){" + s + "; })")();
45 function TestBlockLocal(s,e) {
47 eval("(function(){ {" + s + ";} })")();
56 function TestAll(s) {
76 TestAll('f(); let x; function f() { return x + 1; }');
77 TestAll('f(); let x; function f() { x = 1; }');
78 TestAll('f(); let x; function f() { x += 1; }');
79 TestAll('f(); let x; function f() { ++x; }');
80 TestAll('f(); let x; function f() { x++; }');
81 TestAll('f(); const x = 1; function f() { return x; }');
83 TestAll('f()(); let x; function f() { return function() { return x + 1; } }');
84 TestAll('f()(); let x; function f() { return function() { x = 1; } }');
85 TestAll('f()(); let x; function f() { return function() { x += 1; } }');
86 TestAll('f()(); let x; function f() { return function() { ++x; } }');
87 TestAll('f()(); let x; function f() { return function() { x++; } }');
88 TestAll('f()(); const x = 1; function f() { return function() { return x; } }');
99 TestAll('function f() { eval("var y = 2;"); x + 1; }; f(); let 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; }; f(); let x;');
103 TestAll('function f() { eval("var y = 2;"); x++; }; f(); let x;');
105 // Test that variables introduced by function declarations are created and
106 // initialized upon entering a function / block scope.
107 function f() {
112 // block scoped function declaration
113 function g1() {
120 // function scoped function declaration
121 function g2() {
127 // Test that a function declaration introduces a block scoped variable.
128 TestAll('{ function k() { return 0; } }; k(); ');
130 // Test that a function declaration sees the scope it resides in.
131 function f2() {
135 function g() {
146 function h() {
155 function i() {
166 function j() {
176 function outer() {
177 function middle() {
178 function inner() {