Open Yi2255 opened 5 days ago
Right, this can happen. I'm not sure how big of an issue this is, but what we could do is create a dedicated SetPrototype
IL operation and always use guards for it so that we emit a try-catch in JavaScript.
I understand your point. Thank you for sharing this idea!
Problem
Code generators that use
setPrototype
may result in a cyclic assignment of__proto__
value.Example
const o10 = {
__proto__: 64,
};
const o11 = {
__proto__: o10,
};
o10.__proto__ = o11;
//TypeError: Cyclic__proto__
valueThe problem is more likely to be reproduced with the following generators weighting.
cyclic assignment.txt