aboutsummaryrefslogtreecommitdiff
path: root/src/embind/embind.js
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-03-05 14:02:29 -0800
committerJukka Jylänki <jujjyl@gmail.com>2013-04-12 14:24:48 +0300
commit97373dc8c29bdc205ffc7f0674edaa9eff80fb0c (patch)
tree233507431ff6268e062056db9b45ec3b9de978c6 /src/embind/embind.js
parentececfcc02e2020c2c965cb0d6edc0fc321def581 (diff)
kinda start thinking about making isinstance work with base classes
Diffstat (limited to 'src/embind/embind.js')
-rwxr-xr-xsrc/embind/embind.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index 3ecea3e0..b33ff223 100755
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -42,7 +42,7 @@ function extendError(baseErrorType, errorName) {
return this.name + ': ' + this.message;
}
};
-
+
return errorClass;
}
@@ -698,7 +698,7 @@ function __embind_register_smart_ptr(
rawConstructor = FUNCTION_TABLE[rawConstructor];
rawDestructor = FUNCTION_TABLE[rawDestructor];
rawGetPointee = FUNCTION_TABLE[rawGetPointee];
-
+
var Handle = createNamedFunction(name, function(ptr) {
Object.defineProperty(this, '$$', {
value: {
@@ -713,7 +713,7 @@ function __embind_register_smart_ptr(
// TODO: test for SmartPtr.prototype.constructor property?
// We likely want it distinct from pointeeType.prototype.constructor
Handle.prototype = Object.create(pointeeType.Handle.prototype);
-
+
Handle.prototype.clone = function() {
if (!this.$$.ptr) {
throwBindingError(pointeeType.name + ' instance already deleted');
@@ -727,16 +727,16 @@ function __embind_register_smart_ptr(
ptr: this.$$.ptr,
},
});
-
+
clone.$$.count.value += 1;
return clone;
};
-
+
Handle.prototype['delete'] = function() {
if (!this.$$.ptr) {
throwBindingError(pointeeType.name + ' instance already deleted');
}
-
+
this.$$.count.value -= 1;
if (0 === this.$$.count.value) {
rawDestructor(this.$$.smartPtr);
@@ -757,6 +757,7 @@ function __embind_register_class(
rawType,
rawPointerType,
rawConstPointerType,
+ baseClassType,
isPolymorphic,
name,
rawDestructor