mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
* clean * improve * tests * fix lint * old helpers * add fail test * fix * Update packages/babel-helpers/src/helpers/superPropGet.ts Co-authored-by: Nicolò Ribaudo <[email protected]> * review * fix lint * minVersion --------- Co-authored-by: Nicolò Ribaudo <[email protected]>
23 lines
424 B
JavaScript
23 lines
424 B
JavaScript
"use strict";
|
|
|
|
var _obj;
|
|
const Base = {
|
|
get test() {
|
|
return 1;
|
|
}
|
|
};
|
|
const obj = _obj = {
|
|
test: 2,
|
|
set() {
|
|
return babelHelpers.superPropSet(_obj, "test", 3, this, 1);
|
|
}
|
|
};
|
|
Object.setPrototypeOf(obj, Base);
|
|
expect(() => {
|
|
// this requires helpers to be in file (not external), so they
|
|
// are in "strict" mode code.
|
|
obj.set();
|
|
}).toThrow(TypeError);
|
|
expect(Base.test).toBe(1);
|
|
expect(obj.test).toBe(2);
|