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 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Handle id counters. | 5 // Handle id counters. |
6 var next_handle_ = 0; | 6 var next_handle_ = 0; |
7 var next_transient_handle_ = -1; | 7 var next_transient_handle_ = -1; |
8 | 8 |
9 // Mirror cache. | 9 // Mirror cache. |
10 var mirror_cache_ = []; | 10 var mirror_cache_ = []; |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 result.push(new InternalPropertyMirror("[[TargetFunction]]", | 912 result.push(new InternalPropertyMirror("[[TargetFunction]]", |
913 bindings[0])); | 913 bindings[0])); |
914 result.push(new InternalPropertyMirror("[[BoundThis]]", bindings[1])); | 914 result.push(new InternalPropertyMirror("[[BoundThis]]", bindings[1])); |
915 var boundArgs = []; | 915 var boundArgs = []; |
916 for (var i = 2; i < bindings.length; i++) { | 916 for (var i = 2; i < bindings.length; i++) { |
917 boundArgs.push(bindings[i]); | 917 boundArgs.push(bindings[i]); |
918 } | 918 } |
919 result.push(new InternalPropertyMirror("[[BoundArgs]]", boundArgs)); | 919 result.push(new InternalPropertyMirror("[[BoundArgs]]", boundArgs)); |
920 } | 920 } |
921 return result; | 921 return result; |
| 922 } else if (IS_MAP_ITERATOR(value) || IS_SET_ITERATOR(value)) { |
| 923 var details = IS_MAP_ITERATOR(value) ? %MapIteratorDetails(value) |
| 924 : %SetIteratorDetails(value); |
| 925 var kind; |
| 926 switch (details[2]) { |
| 927 case 1: kind = "keys"; break; |
| 928 case 2: kind = "values"; break; |
| 929 case 3: kind = "entries"; break; |
| 930 } |
| 931 var result = []; |
| 932 result.push(new InternalPropertyMirror("[[IteratorHasMore]]", details[0])); |
| 933 result.push(new InternalPropertyMirror("[[IteratorIndex]]", details[1])); |
| 934 if (kind) { |
| 935 result.push(new InternalPropertyMirror("[[IteratorKind]]", kind)); |
| 936 } |
| 937 return result; |
922 } else if (ObjectIsPromise(value)) { | 938 } else if (ObjectIsPromise(value)) { |
923 var result = []; | 939 var result = []; |
924 result.push(new InternalPropertyMirror("[[PromiseStatus]]", | 940 result.push(new InternalPropertyMirror("[[PromiseStatus]]", |
925 PromiseGetStatus_(value))); | 941 PromiseGetStatus_(value))); |
926 result.push(new InternalPropertyMirror("[[PromiseValue]]", | 942 result.push(new InternalPropertyMirror("[[PromiseValue]]", |
927 PromiseGetValue_(value))); | 943 PromiseGetValue_(value))); |
928 return result; | 944 return result; |
929 } | 945 } |
930 return []; | 946 return []; |
931 } | 947 } |
(...skipping 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3014 } | 3030 } |
3015 if (!NUMBER_IS_FINITE(value)) { | 3031 if (!NUMBER_IS_FINITE(value)) { |
3016 if (value > 0) { | 3032 if (value > 0) { |
3017 return 'Infinity'; | 3033 return 'Infinity'; |
3018 } else { | 3034 } else { |
3019 return '-Infinity'; | 3035 return '-Infinity'; |
3020 } | 3036 } |
3021 } | 3037 } |
3022 return value; | 3038 return value; |
3023 } | 3039 } |
OLD | NEW |