OLD | NEW |
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
4 * | 4 * |
5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
9 * | 9 * |
10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 function test() | 50 function test() |
51 { | 51 { |
52 enterFunc ('test'); | 52 enterFunc ('test'); |
53 printBugNumber(BUGNUMBER); | 53 printBugNumber(BUGNUMBER); |
54 printStatus (summary); | 54 printStatus (summary); |
55 | 55 |
56 var index; | 56 var index; |
57 var obj = { index: 1 }; | 57 var obj = { index: 1 }; |
58 | 58 |
59 expect = 'No Error'; | 59 expect = 'No Error'; |
| 60 actual = 'No Error'; |
60 | 61 |
61 function gen() | 62 function gen() |
62 { | 63 { |
63 delete obj.index; | 64 delete obj.index; |
64 yield 2; | 65 yield 2; |
65 } | 66 } |
66 | 67 |
67 with (obj) { | 68 with (obj) { |
68 for (index in gen()); | 69 for (index in gen()); |
69 } | 70 } |
70 | 71 |
71 if ('index' in obj) | 72 try |
72 throw "for-in binds name to early"; | 73 { |
| 74 if ('index' in obj) |
| 75 throw "for-in binds name to early"; |
73 | 76 |
74 if (index !== 2) | 77 if (index !== 2) |
75 throw "unexpected value of index: "+index; | 78 throw "unexpected value of index: "+index; |
76 | 79 } |
77 actual = 'No Error'; | 80 catch(ex) |
| 81 { |
| 82 actual = ex + ''; |
| 83 } |
78 | 84 |
79 reportCompare(expect, actual, summary); | 85 reportCompare(expect, actual, summary); |
80 | 86 |
81 exitFunc ('test'); | 87 exitFunc ('test'); |
82 } | 88 } |
OLD | NEW |