| 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 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1728 PromiseOnStack* prev = tltop->promise_on_stack_->prev(); | 1728 PromiseOnStack* prev = tltop->promise_on_stack_->prev(); |
| 1729 Handle<Object> global_promise = tltop->promise_on_stack_->promise(); | 1729 Handle<Object> global_promise = tltop->promise_on_stack_->promise(); |
| 1730 delete tltop->promise_on_stack_; | 1730 delete tltop->promise_on_stack_; |
| 1731 tltop->promise_on_stack_ = prev; | 1731 tltop->promise_on_stack_ = prev; |
| 1732 global_handles()->Destroy(global_promise.location()); | 1732 global_handles()->Destroy(global_promise.location()); |
| 1733 } | 1733 } |
| 1734 | 1734 |
| 1735 bool Isolate::PromiseHasUserDefinedRejectHandler(Handle<Object> promise) { | 1735 bool Isolate::PromiseHasUserDefinedRejectHandler(Handle<Object> promise) { |
| 1736 Handle<JSFunction> fun = promise_has_user_defined_reject_handler(); | 1736 Handle<JSFunction> fun = promise_has_user_defined_reject_handler(); |
| 1737 Handle<Object> has_reject_handler; | 1737 Handle<Object> has_reject_handler; |
| 1738 // If we are, e.g., overflowing the stack, don't try to call out to JS |
| 1739 if (!AllowJavascriptExecution::IsAllowed(this)) return false; |
| 1740 // Call the registered function to check for a handler |
| 1738 if (Execution::TryCall(this, fun, promise, 0, NULL) | 1741 if (Execution::TryCall(this, fun, promise, 0, NULL) |
| 1739 .ToHandle(&has_reject_handler)) { | 1742 .ToHandle(&has_reject_handler)) { |
| 1740 return has_reject_handler->IsTrue(this); | 1743 return has_reject_handler->IsTrue(this); |
| 1741 } | 1744 } |
| 1742 // If an exception is thrown in the course of execution of this built-in | 1745 // If an exception is thrown in the course of execution of this built-in |
| 1743 // function, it indicates either a bug, or a synthetic uncatchable | 1746 // function, it indicates either a bug, or a synthetic uncatchable |
| 1744 // exception in the shutdown path. In either case, it's OK to predict either | 1747 // exception in the shutdown path. In either case, it's OK to predict either |
| 1745 // way in DevTools. | 1748 // way in DevTools. |
| 1746 return false; | 1749 return false; |
| 1747 } | 1750 } |
| (...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3317 // Then check whether this scope intercepts. | 3320 // Then check whether this scope intercepts. |
| 3318 if ((flag & intercept_mask_)) { | 3321 if ((flag & intercept_mask_)) { |
| 3319 intercepted_flags_ |= flag; | 3322 intercepted_flags_ |= flag; |
| 3320 return true; | 3323 return true; |
| 3321 } | 3324 } |
| 3322 return false; | 3325 return false; |
| 3323 } | 3326 } |
| 3324 | 3327 |
| 3325 } // namespace internal | 3328 } // namespace internal |
| 3326 } // namespace v8 | 3329 } // namespace v8 |
| OLD | NEW |