(entry)
| 103 | } |
| 104 | |
| 105 | selectRelatedEntries(entry) { |
| 106 | let entries = [entry]; |
| 107 | switch (entry.constructor) { |
| 108 | case SourcePosition: |
| 109 | entries = entries.concat(entry.entries); |
| 110 | break; |
| 111 | case MapLogEntry: |
| 112 | entries = this._state.icTimeline.filter(each => each.map === entry); |
| 113 | break; |
| 114 | case IcLogEntry: |
| 115 | if (entry.map) entries.push(entry.map); |
| 116 | break; |
| 117 | case DeoptLogEntry: |
| 118 | // TODO select map + code entries |
| 119 | if (entry.fileSourcePosition) entries.push(entry.fileSourcePosition); |
| 120 | break; |
| 121 | case Script: |
| 122 | entries = entry.entries.concat(entry.sourcePositions); |
| 123 | break; |
| 124 | case TimerLogEntry: |
| 125 | case CodeLogEntry: |
| 126 | case TickLogEntry: |
| 127 | case SharedLibLogEntry: |
| 128 | break; |
| 129 | default: |
| 130 | throw new Error(`Unknown selection type: ${entry.constructor?.name}`); |
| 131 | } |
| 132 | if (entry.sourcePosition) { |
| 133 | entries.push(entry.sourcePosition); |
| 134 | // TODO: find the matching Code log entries. |
| 135 | } |
| 136 | this.selectEntries(entries); |
| 137 | } |
| 138 | |
| 139 | static isClickable(object) { |
| 140 | if (typeof object !== 'object') return false; |
no test coverage detected