OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 assertEquals(7, foo2.bar); | 72 assertEquals(7, foo2.bar); |
73 assertEquals(7, foo3.bar); | 73 assertEquals(7, foo3.bar); |
74 assertEquals(7, foo4.bar()); | 74 assertEquals(7, foo4.bar()); |
75 assertEquals(7, foo5[13]); | 75 assertEquals(7, foo5[13]); |
76 assertEquals(7, foo6[14.31]); | 76 assertEquals(7, foo6[14.31]); |
77 assertEquals(7, foo7[15]); | 77 assertEquals(7, foo7[15]); |
78 | 78 |
79 // Test for the classic code generator. | 79 // Test for the classic code generator. |
80 | 80 |
81 function fun(x) { | 81 function fun(x) { |
82 var inner = { j: function(x) { return x; }, j: 7 }; | 82 var inner = { j: function(x) { return x; }, j: 7 }; |
83 return inner.j; | 83 return inner.j; |
84 } | 84 } |
85 | 85 |
86 assertEquals(7, fun(7) ); | 86 assertEquals(7, fun(7) ); |
87 | 87 |
88 // Check that the initializers of computed properties are executed, even if | 88 // Check that the initializers of computed properties are executed, even if |
89 // no store instructions are generated for the literals. | 89 // no store instructions are generated for the literals. |
90 | 90 |
91 var glob1 = 0; | 91 var glob1 = 0; |
92 | 92 |
(...skipping 15 matching lines...) Expand all Loading... |
108 | 108 |
109 var glob3 = 0; | 109 var glob3 = 0; |
110 | 110 |
111 function fun3() { | 111 function fun3() { |
112 var r = { 113: glob3++, 113: glob3++, 113: glob3++, 113: 7}; | 112 var r = { 113: glob3++, 113: glob3++, 113: glob3++, 113: 7}; |
113 return r[113]; | 113 return r[113]; |
114 } | 114 } |
115 | 115 |
116 var y = fun3(); | 116 var y = fun3(); |
117 assertEquals(7, y); | 117 assertEquals(7, y); |
118 assertEquals(3, glob3); | 118 assertEquals(3, glob3); |
OLD | NEW |