diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/embind/embind.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js index fe784001..8947c76f 100644 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -1730,17 +1730,24 @@ function __embind_register_class_class_function( }); } -function __embind_create_inheriting_constructor(constructorName, wrapperType) { +function __embind_create_inheriting_constructor(constructorName, wrapperType, properties) { constructorName = readLatin1String(constructorName); wrapperType = requireRegisteredType(wrapperType, 'wrapper'); + properties = requireHandle(properties); + var registeredClass = wrapperType.registeredClass; var wrapperPrototype = registeredClass.instancePrototype; var baseConstructor = registeredClass.baseClass.constructor; var ctor = createNamedFunction(constructorName, function() { var inner = baseConstructor.implement(this); this.$$ = inner.$$; + this.initialize.apply(this, Array.prototype.slice.call(arguments)); }); ctor.prototype = Object.create(wrapperPrototype); + ctor.prototype.initialize = function initialize() {}; + for (var p in properties) { + ctor.prototype[p] = properties[p]; + } return __emval_register(ctor); } |