Skip to content

Commit

Permalink
fix(napi): remove wrong length check in napi_create_function (denolan…
Browse files Browse the repository at this point in the history
…d#17614)

This check is not needed. 

This PR + denoland#17613 makes `npm:ref-napi` work with Deno.
  • Loading branch information
littledivy committed Feb 1, 2023
1 parent 524bccd commit 690b6ac
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions cli/napi/js_native_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,6 @@ fn napi_create_function(
check_arg!(env, result);
check_arg_option!(env, cb);

if length > INT_MAX as _ {
return Err(Error::InvalidArg);
}

let name = name
.as_ref()
.map(|_| check_new_from_utf8_len(env, name, length))
Expand Down

0 comments on commit 690b6ac

Please sign in to comment.