You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 12, 2022. It is now read-only.
I have found an error when there are two or more instances of different types. The error can be described with the next source code example:
function A() {}
function B() {}
A.prototype.public = function (b) {
console.log("Called A public method");
b.public(this);
};
B.prototype.public = function (a) {
console.log("Called B public method");
a._private(this);
};
A.prototype._private = function (b) {
console.log("Called A private method. It should not pass :(");
b._private(this);
};
B.prototype._private = function (a) {
console.log("Called B private method. It too should not pass :(");
};
protect(A);
protect(B);
var a = new A();
var b = new B();
a.public(b);
I try to solve this without success! I'm checking my own fork. I tried with the proxy pattern (https://en.wikipedia.org/wiki/Proxy_pattern) but I think that leads to more problems.
Hi @TremayneChrist
I have found an error when there are two or more instances of different types. The error can be described with the next source code example:
I try to solve this without success! I'm checking my own fork. I tried with the proxy pattern (https://en.wikipedia.org/wiki/Proxy_pattern) but I think that leads to more problems.
Best regards!