Skip to content

Update embind to work with the Closure Compiler #3084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 7, 2015
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