summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2014-05-02 13:57:47 -0700
committerBruce Mitchener <bruce.mitchener@gmail.com>2014-05-21 22:54:28 +0700
commita2487b69b6d5e0fc81ef67f062f61764fad5af00 (patch)
tree8ca876b7a7f42f22d5272c245252b254c137693c
parenta1a062d915d244cdbd681cf6eb4a0ca71a8c8a67 (diff)
instanceof passes
-rw-r--r--src/embind/embind.js5
-rw-r--r--tests/embind/embind.test.js2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index 57178810..fe784001 100644
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -1735,9 +1735,12 @@ function __embind_create_inheriting_constructor(constructorName, wrapperType) {
wrapperType = requireRegisteredType(wrapperType, 'wrapper');
var registeredClass = wrapperType.registeredClass;
var wrapperPrototype = registeredClass.instancePrototype;
+ var baseConstructor = registeredClass.baseClass.constructor;
var ctor = createNamedFunction(constructorName, function() {
- return new registeredClass.baseClass.constructor.implement(this);
+ var inner = baseConstructor.implement(this);
+ this.$$ = inner.$$;
});
+ ctor.prototype = Object.create(wrapperPrototype);
return __emval_register(ctor);
}
diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js
index f2e2b348..17abccbf 100644
--- a/tests/embind/embind.test.js
+++ b/tests/embind/embind.test.js
@@ -1707,6 +1707,7 @@ module({
instance.delete();
assert.equal("optionaljs_optional_123", result);
});
+*/
test("instanceof", function() {
var instance = new Empty;
@@ -1714,7 +1715,6 @@ module({
assert.instanceof(instance, cm.AbstractClass);
instance.delete();
});
-*/
});
BaseFixture.extend("registration order", function() {