Skip to content

Commit 9a5dea0

Browse files
committed
Update embind to work with Closure Compiler
Several names within the embind JavaScript itself need to be guarded from name mangling in the Closure Compiler. With this commit, the embind tests will now pass in the Closure Compiler test phase.
1 parent aaae64b commit 9a5dea0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/embind/embind.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,29 +2098,29 @@ var LibraryEmbind = {
20982098
Object.defineProperty(this, '__parent', {
20992099
value: wrapperPrototype
21002100
});
2101-
this.__construct.apply(this, arraySlice.call(arguments));
2101+
this["__construct"].apply(this, arraySlice.call(arguments));
21022102
});
21032103

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

2106-
wrapperPrototype.__construct = function __construct() {
2106+
wrapperPrototype["__construct"] = function __construct() {
21072107
if (this === wrapperPrototype) {
21082108
throwBindingError("Pass correct 'this' to __construct");
21092109
}
21102110

2111-
var inner = baseConstructor.implement.apply(
2111+
var inner = baseConstructor["implement"].apply(
21122112
undefined,
21132113
[this].concat(arraySlice.call(arguments)));
21142114
var $$ = inner.$$;
2115-
inner.notifyOnDestruction();
2115+
inner["notifyOnDestruction"]();
21162116
$$.preservePointerOnDelete = true;
2117-
Object.defineProperty(this, '$$', {
2117+
Object.defineProperties(this, { $$: {
21182118
value: $$
2119-
});
2119+
}});
21202120
registerInheritedInstance(registeredClass, $$.ptr, this);
21212121
};
21222122

2123-
wrapperPrototype.__destruct = function __destruct() {
2123+
wrapperPrototype["__destruct"] = function __destruct() {
21242124
if (this === wrapperPrototype) {
21252125
throwBindingError("Pass correct 'this' to __destruct");
21262126
}

0 commit comments

Comments
 (0)