* Update super property get/set/call in loose mode Follows the plan laid out in https://github.com/babel/babel/pull/7553#issuecomment-381434519. With #7691, this closes #7553, closes #4312. * Post #7772 * Memoized property
25 lines
401 B
JavaScript
25 lines
401 B
JavaScript
"use strict";
|
|
class Base {
|
|
test(...args) {
|
|
expect(this).toBe(obj);
|
|
expect(args).toEqual([1, 2, 3]);
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
class Obj extends Base {
|
|
call() {
|
|
super.test(1, 2, 3);
|
|
super.test(1, ...[2, 3]);
|
|
super.test(...[1, 2, 3]);
|
|
return super.test(...arguments);
|
|
}
|
|
|
|
test() {
|
|
throw new Error("called");
|
|
}
|
|
}
|
|
|
|
const obj = new Obj();
|
|
expect(obj.call(1, 2, 3)).toBe(1);
|