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

Side by Side Diff: src/api.cc

Issue 2626793003: [promises] Remove unneeded PromiseCreate function from promise.js (Closed)
Patch Set: Created 3 years, 11 months 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 | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 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 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 7203 matching lines...) Expand 10 before | Expand all | Expand 10 after
7214 i::Handle<i::JSArray> result_array = 7214 i::Handle<i::JSArray> result_array =
7215 factory->NewJSArrayWithElements(result, i::FAST_ELEMENTS, length); 7215 factory->NewJSArrayWithElements(result, i::FAST_ELEMENTS, length);
7216 return Utils::ToLocal(result_array); 7216 return Utils::ToLocal(result_array);
7217 } 7217 }
7218 7218
7219 7219
7220 MaybeLocal<Promise::Resolver> Promise::Resolver::New(Local<Context> context) { 7220 MaybeLocal<Promise::Resolver> Promise::Resolver::New(Local<Context> context) {
7221 PREPARE_FOR_EXECUTION(context, Promise_Resolver, New, Resolver); 7221 PREPARE_FOR_EXECUTION(context, Promise_Resolver, New, Resolver);
7222 i::Handle<i::Object> result; 7222 i::Handle<i::Object> result;
7223 has_pending_exception = 7223 has_pending_exception =
7224 !i::Execution::Call(isolate, isolate->promise_create(), 7224 !i::Execution::Call(isolate, isolate->promise_internal_constructor(),
7225 isolate->factory()->undefined_value(), 0, NULL) 7225 isolate->factory()->undefined_value(), 0, NULL)
7226 .ToHandle(&result); 7226 .ToHandle(&result);
7227 RETURN_ON_FAILED_EXECUTION(Promise::Resolver); 7227 RETURN_ON_FAILED_EXECUTION(Promise::Resolver);
7228 RETURN_ESCAPED(Local<Promise::Resolver>::Cast(Utils::ToLocal(result))); 7228 RETURN_ESCAPED(Local<Promise::Resolver>::Cast(Utils::ToLocal(result)));
7229 } 7229 }
7230 7230
7231 7231
7232 Local<Promise::Resolver> Promise::Resolver::New(Isolate* isolate) { 7232 Local<Promise::Resolver> Promise::Resolver::New(Isolate* isolate) {
7233 RETURN_TO_LOCAL_UNCHECKED(New(isolate->GetCurrentContext()), 7233 RETURN_TO_LOCAL_UNCHECKED(New(isolate->GetCurrentContext()),
7234 Promise::Resolver); 7234 Promise::Resolver);
(...skipping 2741 matching lines...) Expand 10 before | Expand all | Expand 10 after
9976 Address callback_address = 9976 Address callback_address =
9977 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9977 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9978 VMState<EXTERNAL> state(isolate); 9978 VMState<EXTERNAL> state(isolate);
9979 ExternalCallbackScope call_scope(isolate, callback_address); 9979 ExternalCallbackScope call_scope(isolate, callback_address);
9980 callback(info); 9980 callback(info);
9981 } 9981 }
9982 9982
9983 9983
9984 } // namespace internal 9984 } // namespace internal
9985 } // namespace v8 9985 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698