Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

fix(chore): fixes webpack-stream error with missing catch var declaration #2291

Closed
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion meta/bundle-size-stats/Draft.js.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion meta/bundle-size-stats/Draft.min.js.json

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions src/component/selection/setDraftEditorSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
* @flow strict-local
* @emails oncall+draft_js
*/

Expand Down Expand Up @@ -329,7 +329,7 @@ function addPointToSelection(
// in this case we know that the call to 'range.setStart' is about to throw
DraftJsDebugLogging.logSelectionStateFailure({
anonymizedDom: getAnonymizedEditorDOM(node),
extraParams: JSON.stringify({offset: offset}),
extraParams: JSON.stringify({offset}),
selectionState: JSON.stringify(selectionState.toJS()),
});
DraftEffects.handleExtensionCausedError();
Expand All @@ -340,8 +340,11 @@ function addPointToSelection(
if (isIE) {
try {
selection.addRange(range);
} catch {
// ignore
} catch (e) {
if (__DEV__) {
/* eslint-disable-next-line no-console */
console.warn('Call to selection.addRange() threw exception: ', e);
}
}
} else {
selection.addRange(range);
Expand Down