From 96d4bb47756d3ffc8a56425052a2692bf3ccf81e Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 27 Oct 2016 23:32:51 -0700 Subject: [PATCH] ircd::js: Add convenience functions to struct args. --- include/ircd/js/args.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/ircd/js/args.h b/include/ircd/js/args.h index 230ebe5f7..bd0335e30 100644 --- a/include/ircd/js/args.h +++ b/include/ircd/js/args.h @@ -28,6 +28,10 @@ namespace js { struct args :JS::CallArgs { + bool empty() const { return length() == 0; } + size_t size() const { return length(); } + bool has(const size_t &at) const { return size() > at; } + value operator[](const size_t &at) const; args(const unsigned &argc, JS::Value *const &argv);