OLD | NEW |
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/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1923 | 1923 |
1924 if (queue->IsSymbol()) { | 1924 if (queue->IsSymbol()) { |
1925 return InternalPromiseHasUserDefinedRejectHandler( | 1925 return InternalPromiseHasUserDefinedRejectHandler( |
1926 isolate, Handle<JSPromise>::cast(deferred_promise)); | 1926 isolate, Handle<JSPromise>::cast(deferred_promise)); |
1927 } | 1927 } |
1928 | 1928 |
1929 Handle<FixedArray> queue_arr = Handle<FixedArray>::cast(queue); | 1929 Handle<FixedArray> queue_arr = Handle<FixedArray>::cast(queue); |
1930 Handle<FixedArray> deferred_promise_arr = | 1930 Handle<FixedArray> deferred_promise_arr = |
1931 Handle<FixedArray>::cast(deferred_promise); | 1931 Handle<FixedArray>::cast(deferred_promise); |
1932 for (int i = 0; i < deferred_promise_arr->length(); i++) { | 1932 for (int i = 0; i < deferred_promise_arr->length(); i++) { |
1933 Handle<JSReceiver> queue_item(JSReceiver::cast(queue_arr->get(i))); | |
1934 Handle<JSReceiver> deferred_promise_item( | 1933 Handle<JSReceiver> deferred_promise_item( |
1935 JSReceiver::cast(deferred_promise_arr->get(i))); | 1934 JSReceiver::cast(deferred_promise_arr->get(i))); |
1936 if (PromiseHandlerCheck(isolate, queue_item, deferred_promise_item)) { | 1935 if (queue_arr->get(i)->IsSymbol()) { |
1937 return true; | 1936 if (InternalPromiseHasUserDefinedRejectHandler( |
| 1937 isolate, Handle<JSPromise>::cast(deferred_promise_item))) { |
| 1938 return true; |
| 1939 } |
| 1940 } else { |
| 1941 Handle<JSReceiver> queue_item(JSReceiver::cast(queue_arr->get(i))); |
| 1942 if (PromiseHandlerCheck(isolate, queue_item, deferred_promise_item)) { |
| 1943 return true; |
| 1944 } |
1938 } | 1945 } |
1939 } | 1946 } |
1940 | 1947 |
1941 return false; | 1948 return false; |
1942 } | 1949 } |
1943 | 1950 |
1944 } // namespace | 1951 } // namespace |
1945 | 1952 |
1946 bool Isolate::PromiseHasUserDefinedRejectHandler(Handle<Object> promise) { | 1953 bool Isolate::PromiseHasUserDefinedRejectHandler(Handle<Object> promise) { |
1947 if (!promise->IsJSPromise()) return false; | 1954 if (!promise->IsJSPromise()) return false; |
(...skipping 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3731 // Then check whether this scope intercepts. | 3738 // Then check whether this scope intercepts. |
3732 if ((flag & intercept_mask_)) { | 3739 if ((flag & intercept_mask_)) { |
3733 intercepted_flags_ |= flag; | 3740 intercepted_flags_ |= flag; |
3734 return true; | 3741 return true; |
3735 } | 3742 } |
3736 return false; | 3743 return false; |
3737 } | 3744 } |
3738 | 3745 |
3739 } // namespace internal | 3746 } // namespace internal |
3740 } // namespace v8 | 3747 } // namespace v8 |
OLD | NEW |