mirror of
https://github.com/hanzoai/babel.git
synced 2026-10-30 14:46:06 +00:00
12 lines
246 B
JavaScript
12 lines
246 B
JavaScript
let called = false;
|
|
let obj = {
|
|
get foo() { called = true }
|
|
};
|
|
|
|
let { foo, ...rest } = obj;
|
|
|
|
expect("foo" in rest).toBe(false);
|
|
|
|
// Without assuming that getters are pure (in this case it isn't), this should be true
|
|
expect(called).toBe(false);
|