mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
feat: permission stack traces in ops (#26938)
This commit improves permission prompts by adding an option to print a full trace of where the permissions is being requested. Due to big performance hint of stack trace collection, this is only enabled when `DENO_TRACE_PERMISSIONS` env var is present. Closes https://github.com/denoland/deno/issues/20756 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
parent
8f72798622
commit
cf49599359
34 changed files with 294 additions and 181 deletions
|
@ -148,7 +148,7 @@ impl Resource for WsCancelResource {
|
|||
// This op is needed because creating a WS instance in JavaScript is a sync
|
||||
// operation and should throw error when permissions are not fulfilled,
|
||||
// but actual op that connects WS is async.
|
||||
#[op2]
|
||||
#[op2(stack_trace)]
|
||||
#[smi]
|
||||
pub fn op_ws_check_permission_and_cancel_handle<WP>(
|
||||
state: &mut OpState,
|
||||
|
@ -443,7 +443,7 @@ fn populate_common_request_headers(
|
|||
Ok(request)
|
||||
}
|
||||
|
||||
#[op2(async)]
|
||||
#[op2(async, stack_trace)]
|
||||
#[serde]
|
||||
pub async fn op_ws_create<WP>(
|
||||
state: Rc<RefCell<OpState>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue