| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 var foo3 = { | 44 var foo3 = { |
| 45 bar: function(a){}, | 45 bar: function(a){}, |
| 46 bar: function(b){}, | 46 bar: function(b){}, |
| 47 bar: 7 | 47 bar: 7 |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 var foo4 = { | 50 var foo4 = { |
| 51 bar: function(b){}, | 51 bar: function(b){}, |
| 52 bar: 7, | 52 bar: 7, |
| 53 bar: function(){return 7}, | 53 bar: function(){return 7;}, |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 var foo5 = { | 56 var foo5 = { |
| 57 13: function(a){}, | 57 13: function(a){}, |
| 58 13: 7 | 58 13: 7 |
| 59 } | 59 }; |
| 60 | 60 |
| 61 var foo6 = { | 61 var foo6 = { |
| 62 14.31: function(a){}, | 62 14.31: function(a){}, |
| 63 14.31: 7 | 63 14.31: 7 |
| 64 } | 64 }; |
| 65 | 65 |
| 66 var foo7 = { | 66 var foo7 = { |
| 67 15: 6, | 67 15: 6, |
| 68 15: 7 | 68 15: 7 |
| 69 } | 69 }; |
| 70 | 70 |
| 71 assertEquals(7, foo1.bar); | 71 assertEquals(7, foo1.bar); |
| 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. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 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 |