Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Commit db64f93

Browse files
mrkevfacebook-github-bot
authored andcommitted
Make insertIntoList strict-local
Summary: It was mutating an argument. Simply added a level of indirection. Reviewed By: gkz Differential Revision: D16854301 fbshipit-source-id: d3da0dc84bcef4ff6f643ac0146bdbb6138aa943
1 parent 8473e41 commit db64f93

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/model/transaction/insertIntoList.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*
77
* @format
8-
* @flow
8+
* @flow strict-local
99
* @emails oncall+draft_js
1010
*/
1111

@@ -17,10 +17,11 @@ import type {List} from 'immutable';
1717
* Maintain persistence for target list when appending and prepending.
1818
*/
1919
function insertIntoList<T>(
20-
targetList: List<T>,
20+
targetListArg: List<T>,
2121
toInsert: List<T>,
2222
offset: number,
2323
): List<T> {
24+
let targetList = targetListArg;
2425
if (offset === targetList.count()) {
2526
toInsert.forEach(c => {
2627
targetList = targetList.push(c);

0 commit comments

Comments
 (0)