()
| 40 | f = "global"; |
| 41 | |
| 42 | function test() { |
| 43 | try { |
| 44 | shouldBeOfType("Function declaration takes effect at entry", f, "function"); |
| 45 | } |
| 46 | catch (e) { |
| 47 | testFailed("Scoping very broken!"); |
| 48 | } |
| 49 | |
| 50 | for (var i = 0; i < 3; ++i) { |
| 51 | if (i == 0) |
| 52 | shouldBeOfType("Decl not yet overwritten", f, 'function'); |
| 53 | else |
| 54 | shouldBeOfType("Decl already overwritten", f, 'number'); |
| 55 | |
| 56 | f = 3; |
| 57 | shouldBeVal("After assign ("+i+")", f, 3); |
| 58 | |
| 59 | function f() {}; |
| 60 | shouldBeVal("function decls have no execution content", f, 3); |
| 61 | |
| 62 | f = 5; |
| 63 | |
| 64 | shouldBeVal("After assign #2 ("+i+")", f, 5); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | test(); |
no test coverage detected