Skip to content

Commit

Permalink
change Object.values/Object.entries to O from PF
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Jul 25, 2023
1 parent 2e7c7fd commit db8fd44
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ast/nodes/shared/knownGlobals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ const knownGlobals: GlobalDescription = {
isSealed: PF,
keys: PF,
fromEntries: O,
entries: PF,
values: PF,
entries: O,
values: O,
prototype: O
},
parseFloat: PF,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
description: 'retain functions that accept a object with a getter that has side effects'
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
let effects = 0;

const obj = {
get foo() {
effects++;
return "foo";
}
};

Object.values(obj);
Object.entries(obj);

assert.equal(effects, 2);

0 comments on commit db8fd44

Please sign in to comment.