Lines Matching defs:args

289   static void Close(const FunctionCallbackInfo<Value>& args) {
291 ASSIGN_OR_RETURN_UNWRAP(&ctx, args.Holder());
298 static void Write(const FunctionCallbackInfo<Value>& args) {
299 Environment* env = Environment::GetCurrent(args);
301 CHECK_EQ(args.Length(), 7);
307 CHECK_EQ(false, args[0]->IsUndefined() && "must provide flush value");
308 if (!args[0]->Uint32Value(context).To(&flush)) return;
319 if (args[1]->IsNull()) {
325 CHECK(Buffer::HasInstance(args[1]));
326 Local<Object> in_buf = args[1].As<Object>();
327 if (!args[2]->Uint32Value(context).To(&in_off)) return;
328 if (!args[3]->Uint32Value(context).To(&in_len)) return;
334 CHECK(Buffer::HasInstance(args[4]));
335 Local<Object> out_buf = args[4].As<Object>();
336 if (!args[5]->Uint32Value(context).To(&out_off)) return;
337 if (!args[6]->Uint32Value(context).To(&out_len)) return;
342 ASSIGN_OR_RETURN_UNWRAP(&ctx, args.Holder());
441 Local<Value> args[] = {
446 MakeCallback(env->onerror_string(), arraysize(args), args);
454 static void Reset(const FunctionCallbackInfo<Value> &args) {
456 ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
563 static void New(const FunctionCallbackInfo<Value>& args) {
564 Environment* env = Environment::GetCurrent(args);
565 CHECK(args[0]->IsInt32());
567 static_cast<node_zlib_mode>(args[0].As<Int32>()->Value());
568 new ZlibStream(env, args.This(), mode);
571 // just pull the ints out of the args and call the other Init
572 static void Init(const FunctionCallbackInfo<Value>& args) {
575 if (args.Length() == 5) {
583 CHECK(args.Length() == 7 &&
588 ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
590 Local<Context> context = args.GetIsolate()->GetCurrentContext();
596 if (!args[0]->Uint32Value(context).To(&window_bits)) return;
599 if (!args[1]->Int32Value(context).To(&level)) return;
602 if (!args[2]->Uint32Value(context).To(&mem_level)) return;
605 if (!args[3]->Uint32Value(context).To(&strategy)) return;
607 CHECK(args[4]->IsUint32Array());
608 Local<Uint32Array> array = args[4].As<Uint32Array>();
612 CHECK(args[5]->IsFunction());
613 Local<Function> write_js_callback = args[5].As<Function>();
616 if (Buffer::HasInstance(args[6])) {
618 reinterpret_cast<unsigned char*>(Buffer::Data(args[6]));
621 data + Buffer::Length(args[6]));
633 static void Params(const FunctionCallbackInfo<Value>& args) {
634 CHECK(args.Length() == 2 && "params(level, strategy)");
636 ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
637 Local<Context> context = args.GetIsolate()->GetCurrentContext();
639 if (!args[0]->Int32Value(context).To(&level)) return;
641 if (!args[1]->Int32Value(context).To(&strategy)) return;
669 static void New(const FunctionCallbackInfo<Value>& args) {
670 Environment* env = Environment::GetCurrent(args);
671 CHECK(args[0]->IsInt32());
673 static_cast<node_zlib_mode>(args[0].As<Int32>()->Value());
674 new BrotliCompressionStream(env, args.This(), mode);
677 static void Init(const FunctionCallbackInfo<Value>& args) {
679 ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
680 CHECK(args.Length() == 3 && "init(params, writeResult, writeCallback)");
682 CHECK(args[1]->IsUint32Array());
683 uint32_t* write_result = reinterpret_cast<uint32_t*>(Buffer::Data(args[1]));
685 CHECK(args[2]->IsFunction());
686 Local<Function> write_js_callback = args[2].As<Function>();
697 args.GetReturnValue().Set(false);
701 CHECK(args[0]->IsUint32Array());
702 const uint32_t* data = reinterpret_cast<uint32_t*>(Buffer::Data(args[0]));
703 size_t len = args[0].As<Uint32Array>()->Length();
711 args.GetReturnValue().Set(false);
716 args.GetReturnValue().Set(true);
719 static void Params(const FunctionCallbackInfo<Value>& args) {