Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Prevent crashes when working with ES2015 symbols #21

Merged
merged 1 commit into from
Mar 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion demo/src/js/DemoApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ class DemoApp extends React.Component {
<Button onClick={this.props.addFunction} style={styles.button}>
Add Function
</Button>
<Button onClick={this.props.addSymbol} style={styles.button}>
Add Symbol
</Button>
</div>
</div>
<div style={styles.links}>
Expand Down Expand Up @@ -155,6 +158,7 @@ export default connect(
type: 'HUGE_PAYLOAD',
payload: Array.from({ length: 10000 }).map((_, i) => i)
}),
addFunction: () => ({ type: 'ADD_FUNCTION' })
addFunction: () => ({ type: 'ADD_FUNCTION' }),
addSymbol: () => ({ type: 'ADD_SYMBOL' })
}
)(DemoApp);
4 changes: 3 additions & 1 deletion demo/src/js/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ export default combineReducers({
str => str + '!'
) : state,
addFunction: (state=null, action) => action.type === 'ADD_FUNCTION' ?
{ f: FUNC } : state
{ f: FUNC } : state,
addSymbol: (state=null, action) => action.type === 'ADD_SYMBOL' ?
{ s: Symbol('symbol') } : state
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"babel-runtime": "^6.3.19",
"dateformat": "^1.0.12",
"immutable": "^3.7.6",
"javascript-stringify": "^1.0.2",
"javascript-stringify": "^1.1.0",
"jsondiffpatch": "^0.1.41",
"jss": "^3.3.0",
"jss-nested": "^1.0.2",
Expand Down
2 changes: 2 additions & 0 deletions src/ActionPreview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ function getItemString(createTheme, type, data) {
return 'fn';
} else if (typeof val === 'string') {
return `"${val.substr(0, 10) + (val.length > 10 ? '…' : '')}"`
} else if (typeof val === 'symbol') {
return 'symbol'
} else {
return val;
}
Expand Down