summaryrefslogtreecommitdiff
path: root/src/node_zlib.cc
diff options
context:
space:
mode:
authorLeko <leko.noor@gmail.com>2017-11-27 16:16:32 +0900
committerAnna Henningsen <anna@addaleax.net>2017-12-01 20:37:58 +0100
commit19221d1d6f8a4371a3cef76b0aa9f5d5c7b5a2a9 (patch)
treea519a9a8a080183378e1a3d13e91f668c8198d4d /src/node_zlib.cc
parente9e9863ca7ba61ea4e1b5a28c18b29e449f87f00 (diff)
downloadandroid-node-v8-19221d1d6f8a4371a3cef76b0aa9f5d5c7b5a2a9.tar.gz
android-node-v8-19221d1d6f8a4371a3cef76b0aa9f5d5c7b5a2a9.tar.bz2
android-node-v8-19221d1d6f8a4371a3cef76b0aa9f5d5c7b5a2a9.zip
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: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Diffstat (limited to 'src/node_zlib.cc')
-rw-r--r--src/node_zlib.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node_zlib.cc b/src/node_zlib.cc
index 21145a0d5b..8ef4383e03 100644
--- a/src/node_zlib.cc
+++ b/src/node_zlib.cc
@@ -178,7 +178,7 @@ class ZCtx : public AsyncWrap {
} else {
CHECK(Buffer::HasInstance(args[1]));
Local<Object> in_buf;
- in_buf = args[1]->ToObject(env->isolate());
+ in_buf = args[1]->ToObject(env->context()).ToLocalChecked();
in_off = args[2]->Uint32Value();
in_len = args[3]->Uint32Value();
@@ -187,7 +187,7 @@ class ZCtx : public AsyncWrap {
}
CHECK(Buffer::HasInstance(args[4]));
- Local<Object> out_buf = args[4]->ToObject(env->isolate());
+ Local<Object> out_buf = args[4]->ToObject(env->context()).ToLocalChecked();
out_off = args[5]->Uint32Value();
out_len = args[6]->Uint32Value();
CHECK(Buffer::IsWithinBounds(out_off, out_len, Buffer::Length(out_buf)));