diff options
author | Chad Austin <chad@imvu.com> | 2013-04-08 13:58:34 -0700 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-18 20:08:05 +0300 |
commit | 927c8a5e44da6c5cc539fa7d4e0a2168dafa3d36 (patch) | |
tree | 19a4f9a1f76e4c65912c1cc1a559a06ecca82061 /src | |
parent | f554c2fac03138bf6d3c25180b6dc6771fb80166 (diff) |
Kill validateThis for methods
Diffstat (limited to 'src')
-rwxr-xr-x | src/embind/embind.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js index 03af7010..b8bd5fcf 100755 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -640,9 +640,15 @@ RegisteredPointer.prototype.toWireType = function(destructors, handle) { return 0; } } + if (!(handle instanceof this.registeredClass.constructor)) { throwBindingError('Expected null or instance of ' + this.name + ', got ' + _embind_repr(handle)); } + + if (!handle.$$.ptr) { + throwBindingError('Cannot pass deleted object'); + } + // TODO: this is not strictly true // We could support BY_EMVAL conversions from raw pointers to smart pointers // because the smart pointer can hold a reference to the handle @@ -1079,8 +1085,6 @@ function __embind_register_class_function( throwBindingError(humanName + ' called with ' + arguments.length + ' arguments, expected ' + (argCount-2)); } - validateThis(this, classType, humanName); - var destructors = []; var args = new Array(argCount + 1); args[0] = context; |