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/builtins/builtins-utils.h" | 5 #include "src/builtins/builtins-utils.h" |
6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
7 | 7 |
8 #include "src/promise-utils.h" | 8 #include "src/promise-utils.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 return isolate->heap()->undefined_value(); | 59 return isolate->heap()->undefined_value(); |
60 } | 60 } |
61 | 61 |
62 // ES#sec-createresolvingfunctions | 62 // ES#sec-createresolvingfunctions |
63 // CreateResolvingFunctions ( promise ) | 63 // CreateResolvingFunctions ( promise ) |
64 BUILTIN(CreateResolvingFunctions) { | 64 BUILTIN(CreateResolvingFunctions) { |
65 HandleScope scope(isolate); | 65 HandleScope scope(isolate); |
66 DCHECK_EQ(3, args.length()); | 66 DCHECK_EQ(3, args.length()); |
67 | 67 |
68 Handle<JSObject> promise = args.at<JSObject>(1); | 68 Handle<JSObject> promise = args.at<JSObject>(1); |
69 Handle<Object> debug_event = args.at<Object>(2); | 69 Handle<Object> debug_event = args.at(2); |
70 Handle<JSFunction> resolve, reject; | 70 Handle<JSFunction> resolve, reject; |
71 | 71 |
72 PromiseUtils::CreateResolvingFunctions(isolate, promise, debug_event, | 72 PromiseUtils::CreateResolvingFunctions(isolate, promise, debug_event, |
73 &resolve, &reject); | 73 &resolve, &reject); |
74 | 74 |
75 Handle<FixedArray> result = isolate->factory()->NewFixedArray(2); | 75 Handle<FixedArray> result = isolate->factory()->NewFixedArray(2); |
76 result->set(0, *resolve); | 76 result->set(0, *resolve); |
77 result->set(1, *reject); | 77 result->set(1, *reject); |
78 | 78 |
79 return *isolate->factory()->NewJSArrayWithElements(result, FAST_ELEMENTS, 2, | 79 return *isolate->factory()->NewJSArrayWithElements(result, FAST_ELEMENTS, 2, |
80 NOT_TENURED); | 80 NOT_TENURED); |
81 } | 81 } |
82 | 82 |
83 } // namespace internal | 83 } // namespace internal |
84 } // namespace v8 | 84 } // namespace v8 |
OLD | NEW |