OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 (function (global, binding, v8) { | 5 (function (global, binding, v8) { |
6 'use strict'; | 6 'use strict'; |
7 binding.testExtraShouldReturnFive = function() { | 7 binding.testExtraShouldReturnFive = function() { |
8 return 5; | 8 return 5; |
9 }; | 9 }; |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 let promiseStates = promiseStateToString(new Promise(() => {})) + ' ' + | 86 let promiseStates = promiseStateToString(new Promise(() => {})) + ' ' + |
87 promiseStateToString(fulfilledPromise) + ' ' + | 87 promiseStateToString(fulfilledPromise) + ' ' + |
88 promiseStateToString(rejectedPromise); | 88 promiseStateToString(rejectedPromise); |
89 | 89 |
90 return { | 90 return { |
91 privateSymbol: v8.createPrivateSymbol('sym'), | 91 privateSymbol: v8.createPrivateSymbol('sym'), |
92 fulfilledPromise, // should be fulfilled with 1 | 92 fulfilledPromise, // should be fulfilled with 1 |
93 fulfilledPromise2, // should be fulfilled with 2 | 93 fulfilledPromise2, // should be fulfilled with 2 |
94 rejectedPromise, // should be rejected with 3 | 94 rejectedPromise, // should be rejected with 3 |
95 rejectedButHandledPromise, // should be rejected but have a handler | 95 rejectedButHandledPromise, // should be rejected but have a handler |
96 promiseStates // should be the string "pending fulfilled rejected" | 96 promiseStates, // should be the string "pending fulfilled rejected" |
| 97 promiseIsPromise: v8.isPromise(fulfilledPromise), // should be true |
| 98 thenableIsPromise: v8.isPromise({ then() { } }) // should be false |
97 }; | 99 }; |
98 }; | 100 }; |
99 }) | 101 }) |
OLD | NEW |