OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/debug/debug.h" | 7 #include "src/debug/debug.h" |
8 #include "src/elements.h" | 8 #include "src/elements.h" |
9 #include "src/promise-utils.h" | 9 #include "src/promise-utils.h" |
10 | 10 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 return isolate->heap()->undefined_value(); | 182 return isolate->heap()->undefined_value(); |
183 } | 183 } |
184 | 184 |
185 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { | 185 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { |
186 HandleScope scope(isolate); | 186 HandleScope scope(isolate); |
187 DCHECK(args.length() == 0); | 187 DCHECK(args.length() == 0); |
188 isolate->RunMicrotasks(); | 188 isolate->RunMicrotasks(); |
189 return isolate->heap()->undefined_value(); | 189 return isolate->heap()->undefined_value(); |
190 } | 190 } |
191 | 191 |
| 192 RUNTIME_FUNCTION(Runtime_CreateResolvingFunctions) { |
| 193 HandleScope scope(isolate); |
| 194 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); |
| 195 Handle<JSFunction> resolve, reject; |
| 196 |
| 197 PromiseUtils::CreateResolvingFunctions( |
| 198 isolate, promise, isolate->factory()->true_value(), &resolve, &reject); |
| 199 |
| 200 Handle<FixedArray> result = isolate->factory()->NewFixedArray(2); |
| 201 result->set(0, *resolve); |
| 202 result->set(1, *reject); |
| 203 |
| 204 return *result; |
| 205 } |
| 206 |
192 } // namespace internal | 207 } // namespace internal |
193 } // namespace v8 | 208 } // namespace v8 |
OLD | NEW |