| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 214e568 commit 3e7238e
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ | |||
| 36 | 36 | ||
| 37 | 37 | # Reset this number to 0 on major V8 upgrades. | |
| 38 | 38 | # Increment by one for each non-official patch applied to deps/v8. | |
| 39 | - 'v8_embedder_string': '-node.77', | ||
| 39 | + 'v8_embedder_string': '-node.78', | ||
| 40 | 40 | ||
| 41 | 41 | ##### V8 defaults for Node.js ##### | |
| 42 | 42 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -133,39 +133,39 @@ transitioning macro RunContextPromiseHookResolve(implicit context: Context)( | |||
| 133 | 133 | ||
| 134 | 134 | @export | |
| 135 | 135 | transitioning macro RunContextPromiseHookBefore(implicit context: Context)( | |
| 136 | - promiseOrCapability: JSPromise|PromiseCapability) { | ||
| 136 | + promiseOrCapability: JSPromise|PromiseCapability|Undefined) { | ||
| 137 | 137 | RunContextPromiseHook( | |
| 138 | 138 | NativeContextSlot::PROMISE_HOOK_BEFORE_FUNCTION_INDEX, promiseOrCapability, | |
| 139 | 139 | PromiseHookFlags()); | |
| 140 | 140 | } | |
| 141 | 141 | ||
| 142 | 142 | @export | |
| 143 | 143 | transitioning macro RunContextPromiseHookBefore(implicit context: Context)( | |
| 144 | - promiseOrCapability: JSPromise|PromiseCapability, flags: uint32) { | ||
| 144 | + promiseOrCapability: JSPromise|PromiseCapability|Undefined, flags: uint32) { | ||
| 145 | 145 | RunContextPromiseHook( | |
| 146 | 146 | NativeContextSlot::PROMISE_HOOK_BEFORE_FUNCTION_INDEX, promiseOrCapability, | |
| 147 | 147 | flags); | |
| 148 | 148 | } | |
| 149 | 149 | ||
| 150 | 150 | @export | |
| 151 | 151 | transitioning macro RunContextPromiseHookAfter(implicit context: Context)( | |
| 152 | - promiseOrCapability: JSPromise|PromiseCapability) { | ||
| 152 | + promiseOrCapability: JSPromise|PromiseCapability|Undefined) { | ||
| 153 | 153 | RunContextPromiseHook( | |
| 154 | 154 | NativeContextSlot::PROMISE_HOOK_AFTER_FUNCTION_INDEX, promiseOrCapability, | |
| 155 | 155 | PromiseHookFlags()); | |
| 156 | 156 | } | |
| 157 | 157 | ||
| 158 | 158 | @export | |
| 159 | 159 | transitioning macro RunContextPromiseHookAfter(implicit context: Context)( | |
| 160 | - promiseOrCapability: JSPromise|PromiseCapability, flags: uint32) { | ||
| 160 | + promiseOrCapability: JSPromise|PromiseCapability|Undefined, flags: uint32) { | ||
| 161 | 161 | RunContextPromiseHook( | |
| 162 | 162 | NativeContextSlot::PROMISE_HOOK_AFTER_FUNCTION_INDEX, promiseOrCapability, | |
| 163 | 163 | flags); | |
| 164 | 164 | } | |
| 165 | 165 | ||
| 166 | 166 | transitioning macro RunContextPromiseHook(implicit context: Context)( | |
| 167 | 167 | slot: NativeContextSlot, | |
| 168 | - promiseOrCapability: JSPromise|PromiseCapability, flags: uint32) { | ||
| 168 | + promiseOrCapability: JSPromise|PromiseCapability|Undefined, flags: uint32) { | ||
| 169 | 169 | if (!IsContextPromiseHookEnabled(flags)) return; | |
| 170 | 170 | const nativeContext: NativeContext = LoadNativeContext(context); | |
| 171 | 171 | const hook = Cast<JSFunction>(nativeContext[slot]) otherwise return; | |
@@ -178,6 +178,9 @@ transitioning macro RunContextPromiseHook(implicit context: Context)( | |||
| 178 | 178 | case (capability: PromiseCapability): { | |
| 179 | 179 | promise = Cast<JSPromise>(capability.promise) otherwise return; | |
| 180 | 180 | } | |
| 181 | + case (Undefined): { | ||
| 182 | + return; | ||
| 183 | + } | ||
| 181 | 184 | } | |
| 182 | 185 | ||
| 183 | 186 | try { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | // Copyright 2020 the V8 project authors. All rights reserved. | |
| 2 | 2 | // Use of this source code is governed by a BSD-style license that can be | |
| 3 | 3 | // found in the LICENSE file. | |
| 4 | - // | ||
| 4 | + | ||
| 5 | 5 | // Flags: --allow-natives-syntax --opt --no-always-opt --no-stress-opt --deopt-every-n-times=0 --ignore-unhandled-promises | |
| 6 | 6 | ||
| 7 | 7 | let log = []; | |
@@ -242,3 +242,13 @@ optimizerBailout(async () => { | |||
| 242 | 242 | }); | |
| 243 | 243 | basicTest(); | |
| 244 | 244 | exceptions(); | |
| 245 | + | ||
| 246 | + (function regress1126309() { | ||
| 247 | + function __f_16(test) { | ||
| 248 | + test(); | ||
| 249 | + d8.promise.setHooks( undefined, () => {}); | ||
| 250 | + %PerformMicrotaskCheckpoint(); | ||
| 251 | + d8.promise.setHooks(); | ||
| 252 | + } | ||
| 253 | + __f_16(async () => { await Promise.resolve()}); | ||
| 254 | + })(); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments