fuzzilli
fuzzilli copied to clipboard
Extend ExplorationMutator to explore `super` accesses
The ExplorationMutator could be extended to also be able to explore super in e.g. class definitions. This would likely require a new ExploreSuper operation which then looks at the prototype chain of this in contexts where super is valid. The following code shows how runtime introspection could be performed for the super binding:
class B {
a = 42;
get c() {
return this.b + 1;
}
}
class C extends B {
b = 43;
get c() {
return "foo"
}
m() {
console.log(Object.getOwnPropertyNames(this.__proto__.__proto__));
// The following two are identical.
return Reflect.get(this.__proto__.__proto__, 'c', this);
return super.c;
}
}
let o = new C;
console.log(o.m());