OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 // Flags: --expose-debug-as debug --harmony-promises | 5 // Flags: --expose-debug-as debug |
6 // Test the mirror object for promises. | 6 // Test the mirror object for promises. |
7 | 7 |
8 function MirrorRefCache(json_refs) { | 8 function MirrorRefCache(json_refs) { |
9 var tmp = eval('(' + json_refs + ')'); | 9 var tmp = eval('(' + json_refs + ')'); |
10 this.refs_ = []; | 10 this.refs_ = []; |
11 for (var i = 0; i < tmp.length; i++) { | 11 for (var i = 0; i < tmp.length; i++) { |
12 this.refs_[tmp[i].handle] = tmp[i]; | 12 this.refs_[tmp[i].handle] = tmp[i]; |
13 } | 13 } |
14 } | 14 } |
15 | 15 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 var m2 = debug.MakeMirror(new Promise(function(resolve, reject) { reject(2) })); | 82 var m2 = debug.MakeMirror(new Promise(function(resolve, reject) { reject(2) })); |
83 ip = m2.internalProperties(); | 83 ip = m2.internalProperties(); |
84 assertEquals("rejected", ip[0].value().value()); | 84 assertEquals("rejected", ip[0].value().value()); |
85 assertEquals(2, ip[1].value().value()); | 85 assertEquals(2, ip[1].value().value()); |
86 | 86 |
87 var m3 = debug.MakeMirror(new Promise(function(resolve, reject) { })); | 87 var m3 = debug.MakeMirror(new Promise(function(resolve, reject) { })); |
88 ip = m3.internalProperties(); | 88 ip = m3.internalProperties(); |
89 assertEquals("pending", ip[0].value().value()); | 89 assertEquals("pending", ip[0].value().value()); |
90 assertEquals("undefined", typeof(ip[1].value().value())); | 90 assertEquals("undefined", typeof(ip[1].value().value())); |
OLD | NEW |