Skip to content

Commit

Permalink
More cosmetic changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mstange committed May 14, 2016
1 parent b93a71f commit e8e7238
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ module.exports = {
"generator-star-spacing": "error",
"no-duplicate-imports": "error",
"no-var": "error",
"prefer-const": "error"
"prefer-const": "error",
"array-bracket-spacing": "error"
},
"settings": {
"react": {
Expand Down
20 changes: 16 additions & 4 deletions src/components/ProfileViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,29 @@ class ProfileViewer extends Component {

_onSelectedFuncStackChange(newSelectedFuncStack) {
const { dispatch, viewOptions, profile } = this.props;
const { selectedThread } = viewOptions;
const thread = profile.threads[selectedThread];
const { selectedThread, jsOnly, invertCallstack } = viewOptions;
let thread = profile.threads[selectedThread];
if (jsOnly) {
thread = this._filterToJSOnly(thread);
}
if (invertCallstack) {
thread = this._invertCallStack(thread);
}
const funcStackInfo = this._getFuncStackInfo(selectedThread, thread);
dispatch(Actions.changeSelectedFuncStack(selectedThread,
getStackAsFuncArray(newSelectedFuncStack, funcStackInfo.funcStackTable)));
}

_onExpandedFuncStacksChange(newExpandedFuncStacks) {
const { dispatch, viewOptions, profile } = this.props;
const { selectedThread } = viewOptions;
const thread = profile.threads[selectedThread];
const { selectedThread, jsOnly, invertCallstack } = viewOptions;
let thread = profile.threads[selectedThread];
if (jsOnly) {
thread = this._filterToJSOnly(thread);
}
if (invertCallstack) {
thread = this._invertCallStack(thread);
}
const funcStackInfo = this._getFuncStackInfo(selectedThread, thread);
dispatch(Actions.changeExpandedFuncStacks(selectedThread,
newExpandedFuncStacks.map(funcStackIndex => getStackAsFuncArray(funcStackIndex, funcStackInfo.funcStackTable))));
Expand Down
11 changes: 6 additions & 5 deletions src/profile-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { timeCode } from './time-code';

/**
* Various helpers for dealing with the profile as a data structure.
* @module profile-data
*/

export const resourceTypes = {
Expand All @@ -16,11 +17,11 @@ export const resourceTypes = {
/**
* Takes the stack table and the frame table, creates a func stack table and
* fixes up the funcStack field in the samples data.
* @param {object} stackTable The thread's stackTable.
* @param {object} frameTable The thread's frameTable.
* @param {object} funcTable The thread's funcTable.
* @param {object} samples The thread's samples.
* @return {object} The funcStackTable and the new samples object.
* @param {Object} stackTable The thread's stackTable.
* @param {Object} frameTable The thread's frameTable.
* @param {Object} funcTable The thread's funcTable.
* @param {Object} samples The thread's samples.
* @return {Object} The funcStackTable and the new samples object.
*/
export function getFuncStackInfo(stackTable, frameTable, funcTable, samples) {
return timeCode('getFuncStackInfo', () => {
Expand Down

0 comments on commit e8e7238

Please sign in to comment.