Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe0195f commit f281272Copy full SHA for f281272
src/node_buffer.cc
@@ -1061,8 +1061,9 @@ void IndexOfBuffer(const FunctionCallbackInfo<Value>& args) {
1061
1062
enum encoding enc = static_cast<enum encoding>(args[3].As<Int32>()->Value());
1063
1064
- THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]);
1065
- THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[1]);
+ Environment* env = Environment::GetCurrent(args);
+ THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]);
1066
+ THROW_AND_RETURN_UNLESS_BUFFER(env, args[1]);
1067
ArrayBufferViewContents<char> haystack_contents(args[0]);
1068
ArrayBufferViewContents<char> needle_contents(args[1]);
1069
int64_t offset_i64 = args[2].As<Integer>()->Value();
0 commit comments