OLD | NEW |
1 // Copyright 2006-2012 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 var elementNames; | 635 var elementNames; |
636 var total = 0; | 636 var total = 0; |
637 | 637 |
638 // Find all the named properties. | 638 // Find all the named properties. |
639 if (kind & PropertyKind.Named) { | 639 if (kind & PropertyKind.Named) { |
640 // Get all the local property names. | 640 // Get all the local property names. |
641 propertyNames = | 641 propertyNames = |
642 %GetLocalPropertyNames(this.value_, PROPERTY_ATTRIBUTES_NONE); | 642 %GetLocalPropertyNames(this.value_, PROPERTY_ATTRIBUTES_NONE); |
643 total += propertyNames.length; | 643 total += propertyNames.length; |
644 | 644 |
| 645 // TODO(dcarney): handle symbols correctly. |
| 646 // Remove symbols from total. |
| 647 for (var i = 0; i < propertyNames.length; i++) { |
| 648 if (IS_SYMBOL(propertyNames[i])) total--; |
| 649 } |
| 650 |
645 // Get names for named interceptor properties if any. | 651 // Get names for named interceptor properties if any. |
646 if (this.hasNamedInterceptor() && (kind & PropertyKind.Named)) { | 652 if (this.hasNamedInterceptor() && (kind & PropertyKind.Named)) { |
647 var namedInterceptorNames = | 653 var namedInterceptorNames = |
648 %GetNamedInterceptorPropertyNames(this.value_); | 654 %GetNamedInterceptorPropertyNames(this.value_); |
649 if (namedInterceptorNames) { | 655 if (namedInterceptorNames) { |
650 propertyNames = propertyNames.concat(namedInterceptorNames); | 656 propertyNames = propertyNames.concat(namedInterceptorNames); |
651 total += namedInterceptorNames.length; | 657 total += namedInterceptorNames.length; |
652 } | 658 } |
653 } | 659 } |
654 } | 660 } |
(...skipping 15 matching lines...) Expand all Loading... |
670 } | 676 } |
671 } | 677 } |
672 limit = Math.min(limit || total, total); | 678 limit = Math.min(limit || total, total); |
673 | 679 |
674 var names = new Array(limit); | 680 var names = new Array(limit); |
675 var index = 0; | 681 var index = 0; |
676 | 682 |
677 // Copy names for named properties. | 683 // Copy names for named properties. |
678 if (kind & PropertyKind.Named) { | 684 if (kind & PropertyKind.Named) { |
679 for (var i = 0; index < limit && i < propertyNames.length; i++) { | 685 for (var i = 0; index < limit && i < propertyNames.length; i++) { |
| 686 if (IS_SYMBOL(propertyNames[i])) continue; // Skip symbols. |
680 names[index++] = propertyNames[i]; | 687 names[index++] = propertyNames[i]; |
681 } | 688 } |
682 } | 689 } |
683 | 690 |
684 // Copy names for indexed properties. | 691 // Copy names for indexed properties. |
685 if (kind & PropertyKind.Indexed) { | 692 if (kind & PropertyKind.Indexed) { |
686 for (var i = 0; index < limit && i < elementNames.length; i++) { | 693 for (var i = 0; index < limit && i < elementNames.length; i++) { |
687 names[index++] = elementNames[i]; | 694 names[index++] = elementNames[i]; |
688 } | 695 } |
689 } | 696 } |
(...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2645 } | 2652 } |
2646 if (!NUMBER_IS_FINITE(value)) { | 2653 if (!NUMBER_IS_FINITE(value)) { |
2647 if (value > 0) { | 2654 if (value > 0) { |
2648 return 'Infinity'; | 2655 return 'Infinity'; |
2649 } else { | 2656 } else { |
2650 return '-Infinity'; | 2657 return '-Infinity'; |
2651 } | 2658 } |
2652 } | 2659 } |
2653 return value; | 2660 return value; |
2654 } | 2661 } |
OLD | NEW |