-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change Object.values/Object.entries to O from PF
- Loading branch information
1 parent
2e7c7fd
commit db8fd44
Showing
3 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
test/function/samples/tree-shake-object-with-sideeffctful-getter/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
}; |
13 changes: 13 additions & 0 deletions
13
test/function/samples/tree-shake-object-with-sideeffctful-getter/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |