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 3a9aca9 commit 8615ea6Copy full SHA for 8615ea6
src/node_buffer.cc
@@ -1046,8 +1046,9 @@ void IndexOfBuffer(const FunctionCallbackInfo<Value>& args) {
1046
1047
enum encoding enc = static_cast<enum encoding>(args[3].As<Int32>()->Value());
1048
1049
- THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]);
1050
- THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[1]);
+ Environment* env = Environment::GetCurrent(args);
+ THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]);
1051
+ THROW_AND_RETURN_UNLESS_BUFFER(env, args[1]);
1052
ArrayBufferViewContents<char> haystack_contents(args[0]);
1053
ArrayBufferViewContents<char> needle_contents(args[1]);
1054
int64_t offset_i64 = args[2].As<Integer>()->Value();
0 commit comments