equal
deleted
inserted
replaced
57 throw "error"; |
57 throw "error"; |
58 } |
58 } |
59 |
59 |
60 print("Scoping OK"); |
60 print("Scoping OK"); |
61 |
61 |
62 var f = eval("function cookie() { print('sweet and crunchy!'); } function cake() { print('moist and delicious!'); }"); |
62 // According to the spec, evaluation of function declarations should not return a value, |
|
63 // but we return values of anonymous function declarations (Nashorn extension). |
|
64 var e = eval("function cookie() { print('sweet and crunchy!'); } function cake() { print('moist and delicious!'); }"); |
|
65 print(e); |
|
66 var f = eval("function cookie() { print('sweet and crunchy!'); } function() { print('moist and delicious!'); }"); |
63 print(f); |
67 print(f); |
64 f(); |
68 f(); |
65 var g = eval("function cake() { print('moist and delicious!'); } function cookie() { print('sweet and crunchy!'); }"); |
69 var g = eval("function cake() { print('moist and delicious!'); } function() { print('sweet and crunchy!'); }"); |
66 print(g); |
70 print(g); |
67 g(); |
71 g(); |
68 |
72 |
69 |
73 |
70 |
74 |