| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7e98845 commit 103bf20
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -547,7 +547,15 @@ void NativeContext::RunPromiseHook(PromiseHookType type, | |||
| 547 | 547 | ||
| 548 | 548 | Handle<Object> receiver = isolate->global_proxy(); | |
| 549 | 549 | ||
| 550 | - if (Execution::Call(isolate, hook, receiver, argc, argv).is_null()) { | ||
| 550 | + StackLimitCheck check(isolate); | ||
| 551 | + bool failed = false; | ||
| 552 | + if (check.HasOverflowed()) { | ||
| 553 | + isolate->StackOverflow(); | ||
| 554 | + failed = true; | ||
| 555 | + } else { | ||
| 556 | + failed = Execution::Call(isolate, hook, receiver, argc, argv).is_null(); | ||
| 557 | + } | ||
| 558 | + if (failed) { | ||
| 551 | 559 | DCHECK(isolate->has_pending_exception()); | |
| 552 | 560 | Handle<Object> exception(isolate->pending_exception(), isolate); | |
| 553 | 561 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -273,3 +273,11 @@ exceptions(); | |||
| 273 | 273 | ||
| 274 | 274 | d8.promise.setHooks(); | |
| 275 | 275 | })(); | |
| 276 | + | ||
| 277 | + (function overflow(){ | ||
| 278 | + d8.promise.setHooks(() => { new Promise(()=>{}) }); | ||
| 279 | + // Trigger overflow from JS code: | ||
| 280 | + Promise.all([Promise.resolve(1)]); | ||
| 281 | + %PerformMicrotaskCheckpoint(); | ||
| 282 | + d8.promise.setHooks(); | ||
| 283 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments