Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Side by Side Diff: src/runtime/runtime-promise.cc

Issue 2497523002: [promises] Move promise constructor to TFS (Closed)
Patch Set: fix nits Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698