This commit improves the permission descriptor validation by explicitly checking for object types and using optional chaining when creating error messages in case the descriptor is not an object. Fixes: https://github.com/denoland/deno/issues/14675
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Co-authored-by: Erfan Safari <erfanshield@outlook.com>