diff options
Diffstat (limited to 'src/node_util.cc')
-rw-r--r-- | src/node_util.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/node_util.cc b/src/node_util.cc index dad005d760..b7eba15510 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -13,12 +13,37 @@ using v8::Object; using v8::String; using v8::Value; + +static void IsRegExp(const FunctionCallbackInfo<Value>& args) { + CHECK_EQ(1, args.Length()); + args.GetReturnValue().Set(args[0]->IsRegExp()); +} + + +static void IsDate(const FunctionCallbackInfo<Value>& args) { + CHECK_EQ(1, args.Length()); + args.GetReturnValue().Set(args[0]->IsDate()); +} + + +static void IsMap(const FunctionCallbackInfo<Value>& args) { + CHECK_EQ(1, args.Length()); + args.GetReturnValue().Set(args[0]->IsMap()); +} + + static void IsMapIterator(const FunctionCallbackInfo<Value>& args) { CHECK_EQ(1, args.Length()); args.GetReturnValue().Set(args[0]->IsMapIterator()); } +static void IsSet(const FunctionCallbackInfo<Value>& args) { + CHECK_EQ(1, args.Length()); + args.GetReturnValue().Set(args[0]->IsSet()); +} + + static void IsSetIterator(const FunctionCallbackInfo<Value>& args) { CHECK_EQ(1, args.Length()); args.GetReturnValue().Set(args[0]->IsSetIterator()); @@ -68,7 +93,11 @@ void Initialize(Local<Object> target, Local<Value> unused, Local<Context> context) { Environment* env = Environment::GetCurrent(context); + env->SetMethod(target, "isRegExp", IsRegExp); + env->SetMethod(target, "isDate", IsDate); + env->SetMethod(target, "isMap", IsMap); env->SetMethod(target, "isMapIterator", IsMapIterator); + env->SetMethod(target, "isSet", IsSet); env->SetMethod(target, "isSetIterator", IsSetIterator); env->SetMethod(target, "isPromise", IsPromise); env->SetMethod(target, "isTypedArray", IsTypedArray); |