Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix(data check, format): compare data with index, add semicolon
  • Loading branch information
Swordsman-Inaction committed Jun 10, 2016
commit 278e398a99c755099a92e970d0a350cad64ddd4c
19 changes: 10 additions & 9 deletions src/Reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,17 @@ function inject(state, action, props, scenes) {
return state;
}

let popNum = 1
let popNum = 1;
if (action.data) {
assert(typeof(action.data) === 'number', 'The data is the number of scenes you want to pop, it must be Number')
popNum = action.data
assert(popNum % 1 === 0,
'The data is the number of scenes you want to pop, it must be integer.')
assert(popNum > 1,
'The data is the number of scenes you want to pop, it must be bigger than 1.')
assert(popNum < state.children.length,
"The data is the number of scenes you want to pop, it must be smaller than scenes stack's length.")
assert(typeof(action.data) === 'number',
'The data is the number of scenes you want to pop, it must be Number');
popNum = action.data;
assert(popNum % 1 === 0,
'The data is the number of scenes you want to pop, it must be integer.');
assert(popNum > 1,
'The data is the number of scenes you want to pop, it must be bigger than 1.');
assert(popNum <= state.index,
"The data is the number of scenes you want to pop, it must be smaller than scenes stack's length.");
}

return {
Expand Down