Unverified Commit 19221d1d authored by Leko's avatar Leko Committed by Anna Henningsen
Browse files

src: use non-deprecated versions of `->To*()` utils

Squashed from multiple commits:

- src: replace ->To*(isolate) with ->To*(context).ToLocalChecked()

- test: use .As<Object> on Exception::Error

  > Exception::Error always returns an object, so e.As<Object>() should also work fine
  See https://github.com/nodejs/node/pull/17343#discussion_r153232027

- test: use .As<Object> instead of ->ToObject

  we already checked that its a buffer

- src: use FromMaybe instead of ToLocalChecked

  It fixed this test case: 19a1b2e414

- src: pass context to Get()

  Dont pass Local<Context> is deprecated soon.
  So we migrate to maybe version.

- src: return if Get or ToObject return an empty before call ToLocalChecked

Refs: https://github.com/nodejs/node/issues/17244
PR-URL: https://github.com/nodejs/node/pull/17343


Reviewed-By: default avatarBen Noordhuis <info@bnoordhuis.nl>
Reviewed-By: default avatarMichaël Zasso <targos@protonmail.com>
Reviewed-By: default avatarJoyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: default avatarYuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarDaijiro Wachi <daijiro.wachi@gmail.com>
parent e9e9863c
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment