OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 } | 482 } |
483 | 483 |
484 test_for_in(); | 484 test_for_in(); |
485 test_for_in(); | 485 test_for_in(); |
486 test_for_in(); | 486 test_for_in(); |
487 %OptimizeFunctionOnNextCall(test_for_in); | 487 %OptimizeFunctionOnNextCall(test_for_in); |
488 test_for_in(); | 488 test_for_in(); |
489 test_for_in(); | 489 test_for_in(); |
490 test_for_in(); | 490 test_for_in(); |
491 | 491 |
492 function test_get_property_names() { | |
493 names = %GetPropertyNames(large_array3); | |
494 property_name_count = 0; | |
495 for (x in names) { property_name_count++; }; | |
496 assertEquals(26, property_name_count); | |
497 } | |
498 | |
499 test_get_property_names(); | |
500 test_get_property_names(); | |
501 test_get_property_names(); | |
502 | |
503 // Test elements getters. | 492 // Test elements getters. |
504 assertEquals(expected_array_value(10), large_array3[10]); | 493 assertEquals(expected_array_value(10), large_array3[10]); |
505 assertEquals(expected_array_value(-NaN), large_array3[2]); | 494 assertEquals(expected_array_value(-NaN), large_array3[2]); |
506 large_array3.__defineGetter__("2", function(){ | 495 large_array3.__defineGetter__("2", function(){ |
507 return expected_array_value(10); | 496 return expected_array_value(10); |
508 }); | 497 }); |
509 | 498 |
510 function test_getter() { | 499 function test_getter() { |
511 assertEquals(expected_array_value(10), large_array3[10]); | 500 assertEquals(expected_array_value(10), large_array3[10]); |
512 assertEquals(expected_array_value(10), large_array3[2]); | 501 assertEquals(expected_array_value(10), large_array3[2]); |
(...skipping 27 matching lines...) Expand all Loading... |
540 assertEquals(expected_array_value(2), large_array4[2]); | 529 assertEquals(expected_array_value(2), large_array4[2]); |
541 } | 530 } |
542 | 531 |
543 test_setter(); | 532 test_setter(); |
544 test_setter(); | 533 test_setter(); |
545 test_setter(); | 534 test_setter(); |
546 %OptimizeFunctionOnNextCall(test_setter); | 535 %OptimizeFunctionOnNextCall(test_setter); |
547 test_setter(); | 536 test_setter(); |
548 test_setter(); | 537 test_setter(); |
549 test_setter(); | 538 test_setter(); |
OLD | NEW |