Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/embind/embind.js
Original file line number Diff line number Diff line change
Expand Up @@ -2098,29 +2098,29 @@ var LibraryEmbind = {
Object.defineProperty(this, '__parent', {
value: wrapperPrototype
});
this.__construct.apply(this, arraySlice.call(arguments));
this["__construct"].apply(this, arraySlice.call(arguments));
});

// It's a little nasty that we're modifying the wrapper prototype here.

wrapperPrototype.__construct = function __construct() {
wrapperPrototype["__construct"] = function __construct() {
if (this === wrapperPrototype) {
throwBindingError("Pass correct 'this' to __construct");
}

var inner = baseConstructor.implement.apply(
var inner = baseConstructor["implement"].apply(
undefined,
[this].concat(arraySlice.call(arguments)));
var $$ = inner.$$;
inner.notifyOnDestruction();
inner["notifyOnDestruction"]();
$$.preservePointerOnDelete = true;
Object.defineProperty(this, '$$', {
Object.defineProperties(this, { $$: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this change needed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, I had the same question. :)

value: $$
});
}});
registerInheritedInstance(registeredClass, $$.ptr, this);
};

wrapperPrototype.__destruct = function __destruct() {
wrapperPrototype["__destruct"] = function __destruct() {
if (this === wrapperPrototype) {
throwBindingError("Pass correct 'this' to __destruct");
}
Expand Down
Loading