diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/embind/embind.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js index 27dfa928..6f905d55 100644 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -1823,6 +1823,10 @@ function __embind_create_inheriting_constructor(constructorName, wrapperType, pr // It's a little nasty that we're modifying the wrapper prototype here. wrapperPrototype.__construct = function __construct() { + if (this === wrapperPrototype) { + throwBindingError("Pass correct 'this' to __construct"); + } + var inner = baseConstructor.__$implement.apply( undefined, [this].concat(arraySlice.call(arguments))); @@ -1835,6 +1839,10 @@ function __embind_create_inheriting_constructor(constructorName, wrapperType, pr }; wrapperPrototype.__destruct = function __destruct() { + if (this === wrapperPrototype) { + throwBindingError("Pass correct 'this' to __destruct"); + } + unregisterInheritedInstance(registeredClass, this.$$.ptr); }; |