Permalink
Browse files

Throw an exception if no arguments are passed to mktime()

  • Loading branch information...
1 parent f03c378 commit e2f3d6ea9d50f09e79eb6e3ce647d0cd119dd628 @TooTallNate committed Mar 15, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/time.cc
View
@@ -105,7 +105,8 @@ class Time {
static Handle<Value> Mktime(const Arguments& args) {
HandleScope scope;
if (args.Length() < 1) {
- return Undefined();
+ Local<String> message = String::New("localtime() Object expected");
+ return ThrowException(Exception::TypeError(message));
}
Local<Object> arg = args[0]->ToObject();

0 comments on commit e2f3d6e

Please sign in to comment.