Browse Source

Added better lineTo() / moveTo() exception messages

v1.x
Tj Holowaychuk 14 years ago
parent
commit
82919c9992
  1. 8
      src/CanvasRenderingContext2d.cc

8
src/CanvasRenderingContext2d.cc

@ -1497,9 +1497,9 @@ Context2d::LineTo(const Arguments &args) {
HandleScope scope; HandleScope scope;
if (!args[0]->IsNumber()) if (!args[0]->IsNumber())
return ThrowException(Exception::TypeError(String::New("x required"))); return ThrowException(Exception::TypeError(String::New("lineTo() x must be a number")));
if (!args[1]->IsNumber()) if (!args[1]->IsNumber())
return ThrowException(Exception::TypeError(String::New("y required"))); return ThrowException(Exception::TypeError(String::New("lineTo() y must be a number")));
Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This()); Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This());
cairo_line_to(context->context() cairo_line_to(context->context()
@ -1518,9 +1518,9 @@ Context2d::MoveTo(const Arguments &args) {
HandleScope scope; HandleScope scope;
if (!args[0]->IsNumber()) if (!args[0]->IsNumber())
return ThrowException(Exception::TypeError(String::New("x required"))); return ThrowException(Exception::TypeError(String::New("moveTo() x must be a number")));
if (!args[1]->IsNumber()) if (!args[1]->IsNumber())
return ThrowException(Exception::TypeError(String::New("y required"))); return ThrowException(Exception::TypeError(String::New("moveTo() y must be a number")));
Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This()); Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This());
cairo_move_to(context->context() cairo_move_to(context->context()

Loading…
Cancel
Save