diff options
Diffstat (limited to 'src/embind/embind.js')
-rwxr-xr-x | src/embind/embind.js | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js index 42aff0c4..205d7fdc 100755 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -820,8 +820,11 @@ var genericPointerToWireType = function(destructors, handle) { } } - if (!handle.$$ || !handle.$$.ptr) { - throwBindingError('Cannot pass deleted or null object'); + if (!handle.$$) { + throwBindingError('Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name); + } + if (!handle.$$.ptr) { + throwBindingError('Cannot pass deleted object as a pointer of type ' + this.name); } // TODO: this is not strictly true @@ -881,8 +884,11 @@ var nonConstNoSmartPtrRawPointerToWireType = function(destructors, handle) { return 0; } - if (!handle.$$ || !handle.$$.ptr) { - throwBindingError('Cannot pass deleted or null object'); + if (!handle.$$) { + throwBindingError('Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name); + } + if (!handle.$$.ptr) { + throwBindingError('Cannot pass deleted object as a pointer of type ' + this.name); } if (handle.$$.ptrType.isConst) { throwBindingError('Cannot convert argument of type ' + handle.$$.ptrType.name + ' to parameter type ' + this.name); @@ -900,8 +906,11 @@ var constNoSmartPtrRawPointerToWireType = function(destructors, handle) { return 0; } - if (!handle.$$ || !handle.$$.ptr) { - throwBindingError('Cannot pass deleted or null object'); + if (!handle.$$) { + throwBindingError('Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name); + } + if (!handle.$$.ptr) { + throwBindingError('Cannot pass deleted object as a pointer of type ' + this.name); } var handleClass = handle.$$.ptrType.registeredClass; var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass); |