mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
JS: Add test for flow to a closure body under a type guard
This commit is contained in:
@@ -38,6 +38,14 @@ function manualReducer(state, action) {
|
||||
if (action.type === 'manualAction') {
|
||||
return { ...state, manualValue2: action.payload };
|
||||
}
|
||||
if (action.type === 'manualAction') {
|
||||
return {
|
||||
...state,
|
||||
manualValue3: [1, 2, 3].map(x => {
|
||||
return action.payload + x;
|
||||
})
|
||||
};
|
||||
}
|
||||
return state;
|
||||
}
|
||||
const asyncAction = rt.createAsyncThunk('asyncAction', (x) => {
|
||||
@@ -65,6 +73,7 @@ function MyComponent(props) {
|
||||
sink(props.propFromToolkitAction); // NOT OK
|
||||
sink(props.propFromManualAction); // NOT OK
|
||||
sink(props.propFromManualAction2); // NOT OK
|
||||
sink(props.propFromManualAction3); // NOT OK
|
||||
sink(props.propFromAsync); // NOT OK
|
||||
|
||||
return <button onClick={{clickHandler}}/>
|
||||
@@ -75,7 +84,8 @@ function mapStateToProps(state) {
|
||||
propFromToolkitAction: state.toolkit.value,
|
||||
propFromAsync: state.toolkit.asyncValue,
|
||||
propFromManualAction: state.manual.manualValue,
|
||||
propFromManualAction2: state.manual.manualValue2
|
||||
propFromManualAction2: state.manual.manualValue2,
|
||||
propFromManualAction3: state.manual.manualValue3,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ reducerArg
|
||||
| exportedReducer.js:12:12:12:35 | (state, ... > state |
|
||||
| react-redux.jsx:12:33:17:9 | (state, ... } |
|
||||
| react-redux.jsx:18:41:23:9 | (state, ... } |
|
||||
| react-redux.jsx:51:30:54:2 | rt.comb ... cer,\\n}) |
|
||||
| react-redux.jsx:52:14:52:27 | toolkitReducer |
|
||||
| react-redux.jsx:53:13:53:25 | manualReducer |
|
||||
| react-redux.jsx:59:30:62:2 | rt.comb ... cer,\\n}) |
|
||||
| react-redux.jsx:60:14:60:27 | toolkitReducer |
|
||||
| react-redux.jsx:61:13:61:25 | manualReducer |
|
||||
| trivial.js:10:10:10:33 | (state, ... > state |
|
||||
| trivial.js:11:10:13:5 | {\\n ... ,\\n } |
|
||||
| trivial.js:12:14:12:37 | (state, ... > state |
|
||||
@@ -37,14 +37,14 @@ isTypeTagHandler
|
||||
| fooAction | trivial.js:32:73:32:96 | (state, ... > state |
|
||||
| toolkitAction | react-redux.jsx:12:33:17:9 | (state, ... } |
|
||||
isRootStateHandler
|
||||
| react-redux.jsx:51:30:54:2 | rt.comb ... cer,\\n}) |
|
||||
| react-redux.jsx:59:30:62:2 | rt.comb ... cer,\\n}) |
|
||||
| trivial.js:133:45:133:66 | combine ... Reducer |
|
||||
| trivial.js:134:56:134:79 | (state, ... > state |
|
||||
| trivial.js:136:14:136:37 | (state, ... > state |
|
||||
delegatingReducer
|
||||
| exportedReducer.js:11:30:13:2 | combine ... tate\\n}) |
|
||||
| react-redux.jsx:10:24:24:2 | rt.crea ... });\\n}) |
|
||||
| react-redux.jsx:51:30:54:2 | rt.comb ... cer,\\n}) |
|
||||
| react-redux.jsx:59:30:62:2 | rt.comb ... cer,\\n}) |
|
||||
| trivial.js:9:22:14:2 | require ... }\\n}) |
|
||||
| trivial.js:11:10:13:5 | {\\n ... ,\\n } |
|
||||
| trivial.js:15:26:20:2 | require ... }\\n}) |
|
||||
@@ -64,8 +64,8 @@ delegatingReducer
|
||||
| trivial.js:129:32:131:2 | require ... te),\\n}) |
|
||||
getStateHandlerArg
|
||||
| exportedReducer.js:11:30:13:2 | combine ... tate\\n}) | inner | exportedReducer.js:12:12:12:35 | (state, ... > state |
|
||||
| react-redux.jsx:51:30:54:2 | rt.comb ... cer,\\n}) | manual | react-redux.jsx:53:13:53:25 | manualReducer |
|
||||
| react-redux.jsx:51:30:54:2 | rt.comb ... cer,\\n}) | toolkit | react-redux.jsx:52:14:52:27 | toolkitReducer |
|
||||
| react-redux.jsx:59:30:62:2 | rt.comb ... cer,\\n}) | manual | react-redux.jsx:61:13:61:25 | manualReducer |
|
||||
| react-redux.jsx:59:30:62:2 | rt.comb ... cer,\\n}) | toolkit | react-redux.jsx:60:14:60:27 | toolkitReducer |
|
||||
| trivial.js:9:22:14:2 | require ... }\\n}) | bar | trivial.js:11:10:13:5 | {\\n ... ,\\n } |
|
||||
| trivial.js:9:22:14:2 | require ... }\\n}) | foo | trivial.js:10:10:10:33 | (state, ... > state |
|
||||
| trivial.js:11:10:13:5 | {\\n ... ,\\n } | baz | trivial.js:12:14:12:37 | (state, ... > state |
|
||||
@@ -95,35 +95,36 @@ getAPlainHandlerArg
|
||||
| trivial.js:42:25:42:109 | require ... cers1]) | trivial.js:42:66:42:89 | (state, ... > state |
|
||||
| trivial.js:42:25:42:109 | require ... cers1]) | trivial.js:42:92:42:107 | reducerReducers1 |
|
||||
getUseSite
|
||||
| react-redux.jsx:10:24:24:2 | rt.crea ... });\\n}) | react-redux.jsx:52:14:52:27 | toolkitReducer |
|
||||
| react-redux.jsx:51:30:54:2 | rt.comb ... cer,\\n}) | react-redux.jsx:51:30:54:2 | rt.comb ... cer,\\n}) |
|
||||
| react-redux.jsx:10:24:24:2 | rt.crea ... });\\n}) | react-redux.jsx:60:14:60:27 | toolkitReducer |
|
||||
| react-redux.jsx:59:30:62:2 | rt.comb ... cer,\\n}) | react-redux.jsx:59:30:62:2 | rt.comb ... cer,\\n}) |
|
||||
| trivial.js:11:10:13:5 | {\\n ... ,\\n } | trivial.js:11:10:13:5 | {\\n ... ,\\n } |
|
||||
| trivial.js:17:10:19:5 | {\\n ... ,\\n } | trivial.js:17:10:19:5 | {\\n ... ,\\n } |
|
||||
| trivial.js:23:10:25:5 | {\\n ... ,\\n } | trivial.js:23:10:25:5 | {\\n ... ,\\n } |
|
||||
| trivial.js:129:32:131:2 | require ... te),\\n}) | trivial.js:133:45:133:66 | combine ... Reducer |
|
||||
storeCreation
|
||||
| react-redux.jsx:51:15:54:3 | rt.crea ... er,\\n})) |
|
||||
| react-redux.jsx:59:15:62:3 | rt.crea ... er,\\n})) |
|
||||
| trivial.js:133:16:133:67 | require ... educer) |
|
||||
| trivial.js:134:16:134:80 | require ... state) |
|
||||
| trivial.js:135:16:137:2 | require ... tate\\n}) |
|
||||
taintFlow
|
||||
| react-redux.jsx:59:29:59:36 | source() | react-redux.jsx:65:10:65:36 | props.p ... tAction |
|
||||
| react-redux.jsx:61:31:61:38 | source() | react-redux.jsx:66:10:66:35 | props.p ... lAction |
|
||||
| react-redux.jsx:61:31:61:38 | source() | react-redux.jsx:67:10:67:36 | props.p ... Action2 |
|
||||
| react-redux.jsx:62:30:62:37 | source() | react-redux.jsx:68:10:68:28 | props.propFromAsync |
|
||||
| react-redux.jsx:67:29:67:36 | source() | react-redux.jsx:73:10:73:36 | props.p ... tAction |
|
||||
| react-redux.jsx:69:31:69:38 | source() | react-redux.jsx:74:10:74:35 | props.p ... lAction |
|
||||
| react-redux.jsx:69:31:69:38 | source() | react-redux.jsx:75:10:75:36 | props.p ... Action2 |
|
||||
| react-redux.jsx:69:31:69:38 | source() | react-redux.jsx:76:10:76:36 | props.p ... Action3 |
|
||||
| react-redux.jsx:70:30:70:37 | source() | react-redux.jsx:77:10:77:28 | props.propFromAsync |
|
||||
getAffectedStateAccessPath
|
||||
| react-redux.jsx:12:33:17:9 | (state, ... } | toolkit |
|
||||
| react-redux.jsx:18:41:23:9 | (state, ... } | toolkit |
|
||||
| react-redux.jsx:52:14:52:27 | toolkitReducer | toolkit |
|
||||
| react-redux.jsx:53:13:53:25 | manualReducer | manual |
|
||||
| react-redux.jsx:60:14:60:27 | toolkitReducer | toolkit |
|
||||
| react-redux.jsx:61:13:61:25 | manualReducer | manual |
|
||||
| trivial.js:130:14:130:46 | wrapper ... state) | wrapped |
|
||||
getADispatchFunctionReference
|
||||
| react-redux.jsx:57:20:57:32 | useDispatch() |
|
||||
| react-redux.jsx:65:20:65:32 | useDispatch() |
|
||||
getADispatchedValueSource
|
||||
| react-redux.jsx:26:1:31:1 | return of function manualAction |
|
||||
| react-redux.jsx:27:12:30:5 | {\\n ... x\\n } |
|
||||
| react-redux.jsx:61:18:61:39 | manualA ... urce()) |
|
||||
| react-redux.jsx:62:18:62:38 | asyncAc ... urce()) |
|
||||
| react-redux.jsx:69:18:69:39 | manualA ... urce()) |
|
||||
| react-redux.jsx:70:18:70:38 | asyncAc ... urce()) |
|
||||
getAnUntypedActionInReducer
|
||||
| exportedReducer.js:12:20:12:25 | action |
|
||||
| react-redux.jsx:32:31:32:36 | action |
|
||||
@@ -141,18 +142,21 @@ actionToReducerStep
|
||||
| react-redux.jsx:5:56:9:1 | return of anonymous function | react-redux.jsx:14:24:14:37 | action.payload |
|
||||
| react-redux.jsx:29:18:29:18 | x | react-redux.jsx:35:45:35:58 | action.payload |
|
||||
| react-redux.jsx:29:18:29:18 | x | react-redux.jsx:39:42:39:55 | action.payload |
|
||||
| react-redux.jsx:59:29:59:36 | source() | react-redux.jsx:5:57:5:57 | x |
|
||||
| react-redux.jsx:62:30:62:37 | source() | react-redux.jsx:43:57:43:57 | x |
|
||||
| react-redux.jsx:29:18:29:18 | x | react-redux.jsx:45:24:45:37 | action.payload |
|
||||
| react-redux.jsx:67:29:67:36 | source() | react-redux.jsx:5:57:5:57 | x |
|
||||
| react-redux.jsx:70:30:70:37 | source() | react-redux.jsx:51:57:51:57 | x |
|
||||
actionToReducerPromiseStep
|
||||
| react-redux.jsx:43:56:49:1 | return of anonymous function | react-redux.jsx:20:29:20:42 | action.payload |
|
||||
| react-redux.jsx:51:56:57:1 | return of anonymous function | react-redux.jsx:20:29:20:42 | action.payload |
|
||||
reducerToStateStep
|
||||
| react-redux.jsx:12:33:17:9 | return of anonymous function | react-redux.jsx:75:32:75:44 | state.toolkit |
|
||||
| react-redux.jsx:12:33:17:9 | return of anonymous function | react-redux.jsx:76:24:76:36 | state.toolkit |
|
||||
| react-redux.jsx:14:24:14:50 | action. ... itValue | react-redux.jsx:75:32:75:50 | state.toolkit.value |
|
||||
| react-redux.jsx:18:41:23:9 | return of anonymous function | react-redux.jsx:75:32:75:44 | state.toolkit |
|
||||
| react-redux.jsx:18:41:23:9 | return of anonymous function | react-redux.jsx:76:24:76:36 | state.toolkit |
|
||||
| react-redux.jsx:20:29:20:44 | action.payload.x | react-redux.jsx:76:24:76:47 | state.t ... ncValue |
|
||||
| react-redux.jsx:32:1:42:1 | return of function manualReducer | react-redux.jsx:77:31:77:42 | state.manual |
|
||||
| react-redux.jsx:32:1:42:1 | return of function manualReducer | react-redux.jsx:78:32:78:43 | state.manual |
|
||||
| react-redux.jsx:35:45:35:58 | action.payload | react-redux.jsx:77:31:77:54 | state.m ... alValue |
|
||||
| react-redux.jsx:39:42:39:55 | action.payload | react-redux.jsx:78:32:78:56 | state.m ... lValue2 |
|
||||
| react-redux.jsx:12:33:17:9 | return of anonymous function | react-redux.jsx:84:32:84:44 | state.toolkit |
|
||||
| react-redux.jsx:12:33:17:9 | return of anonymous function | react-redux.jsx:85:24:85:36 | state.toolkit |
|
||||
| react-redux.jsx:14:24:14:50 | action. ... itValue | react-redux.jsx:84:32:84:50 | state.toolkit.value |
|
||||
| react-redux.jsx:18:41:23:9 | return of anonymous function | react-redux.jsx:84:32:84:44 | state.toolkit |
|
||||
| react-redux.jsx:18:41:23:9 | return of anonymous function | react-redux.jsx:85:24:85:36 | state.toolkit |
|
||||
| react-redux.jsx:20:29:20:44 | action.payload.x | react-redux.jsx:85:24:85:47 | state.t ... ncValue |
|
||||
| react-redux.jsx:32:1:50:1 | return of function manualReducer | react-redux.jsx:86:31:86:42 | state.manual |
|
||||
| react-redux.jsx:32:1:50:1 | return of function manualReducer | react-redux.jsx:87:32:87:43 | state.manual |
|
||||
| react-redux.jsx:32:1:50:1 | return of function manualReducer | react-redux.jsx:88:32:88:43 | state.manual |
|
||||
| react-redux.jsx:35:45:35:58 | action.payload | react-redux.jsx:86:31:86:54 | state.m ... alValue |
|
||||
| react-redux.jsx:39:42:39:55 | action.payload | react-redux.jsx:87:32:87:56 | state.m ... lValue2 |
|
||||
| react-redux.jsx:44:27:46:14 | [1, 2, ... }) | react-redux.jsx:88:32:88:56 | state.m ... lValue3 |
|
||||
|
||||
Reference in New Issue
Block a user