base value of super reference doesn't indicate prototype object of the super class
Hello all,
I think that I found a issue on super reference of current draft. In the current draft, Super Reference is made with base value is result of calling GetHomeObject of env. But, HomeObject is prototype of derived class, we cannot find method of superclass.
So for example,
class Base {
say() {
console.log('base');
}
};
class Derived extends Base {
say() {
console.log('derived');
super();
}
};
let instance = new Derived;
instance.say();
then, because base of super reference becomes Derived.prototype, console.log('derived') is executed recursively and max recursion limit exceeded error is thrown.
So I suggest that using baseValue.[[Prototype]] for base of super reference.
If I missed something, I would appreciate it if you would inform me.
P.S. At first, I tried to send this mail from my gmail address (utatane.tea at gmail.com <mailto:utatane.tea at gmail.com>), but all mails
were blocked (I tried to send it 10 times), so I cannot send it to es-discuss from gmail. I send this mail from an alternative smtp server. I would like to know how to pass the filter of es-discuss...
, Yusuke Suzuki
On Jun 29, 2012, at 7:11 PM, Yusuke Suzuki wrote:
Hello all,
I think that I found a issue on super reference of current draft. In the current draft, Super Reference is made with base value is result of calling GetHomeObject of env. But, HomeObject is prototype of derived class, we cannot find method of superclass.
So for example,
class Base { say() { console.log('base'); } };
class Derived extends Base { say() { console.log('derived'); super(); } };
let instance = new Derived;
instance.say();
then, because base of super reference becomes Derived.prototype, console.log('derived') is executed recursively and max recursion limit exceeded error is thrown.
So I suggest that using baseValue.[[Prototype]] for base of super reference.
Yes, your suggestion is what it is supposed to be. I may refactor the algorithms slightly to place the [[Prototype]] access at a single place but your suggestion is conceptually correct.
Allen
If I missed something, I would appreciate it if you would inform me.
P.S. At first, I tried to send this mail from my gmail address (utatane.tea at gmail.com), but all mails were blocked (I tried to send it 10 times), so I cannot send it to es-discuss from gmail. I send this mail from an alternative smtp server. I would like to know how to pass the filter of es-discuss...
There is no filter that I'm aware of or at least one that is controllable by anybody associated Ecma or Mozilla. Somebody seems to occasionally block some mail traffic from some sources. I don't know of anyway to fix it other than use use an alternative STMP peering path. You may eventually get a bounce or failed to deliver message that may have some clues about the problem source in its mail headers.
Yes, your suggestion is what it is supposed to be. I may refactor the algorithms slightly to place the [[Prototype]] access at a single place but your suggestion is conceptually correct.
I've got it, so I suppose that super reference is constructed from baseValue.[[Prototype]] until new draft comes. Thanks.
There is no filter that I'm aware of or at least one that is controllable
by anybody associated Ecma or Mozilla. Somebody seems to occasionally block some mail traffic from some sources. I don't know of anyway to fix it other than use use an alternative STMP peering path. You may eventually get a bounce or failed to deliver message that may have some clues about the problem source in its mail headers.
Some mails are received later, sorry for duplicate mails. Some mails are still missing... Using an alternative SMTP server solved this, so I use it. Thanks for your advice.
, Yusuke Suzuki
Hello everyone,
I think that I found a issue on super reference of current draft. In the current draft, Super Reference is made with base value is result of calling GetHomeObject of env. But, HomeObject is prototype of derived class, we cannot find method of superclass.
So for example,
class Base { say() { console.log('base'); } };
class Derived extends Base { say() { console.log('derived'); super(); } };
let instance = new Derived;
instance.say();
then, because base of super reference becomes Derived.prototype, console.log('derived') is executed recursively and max recursion limit exceeded error is thrown.
So I suggest that using baseValue.[[Prototype]] for base of super reference.
If I missed something, I would appreciate it if you would inform me.
, Yusuke Suzuki