Remove unnecessary catch-clauses for try-finally
Andreas Svensson committed
Jan 24, 2014 at 20:32 UTC
f9bb6e46f17ca31ac52891199ae28c9195e6082b
4 files changed
-15
src/core/ReactCompositeComponent.js
-5
@@ -1001,8 +1001,6 @@ var ReactCompositeComponentMixin = {
1001
this._currentContext = nextFullContext;
1002
this.context = nextContext;
1003
}
1004
- } catch (e) {
1005
- throw e;
1004
} finally {
1005
this._compositeLifeCycleState = null;
1006
}
@@ -1164,9 +1162,6 @@ var ReactCompositeComponentMixin = {
1162
ReactCurrentOwner.current = this;
1163
try {
1164
renderedComponent = this.render();
1167
- } catch (error) {
1168
- // IE8 requires `catch` in order to use `finally`.
1169
- throw error;
1165
} finally {
1166
ReactContext.current = previousContext;
1167
ReactCurrentOwner.current = null;
src/core/ReactContext.js
-3
@@ -56,9 +56,6 @@ var ReactContext = {
56
ReactContext.current = merge(previousContext, newContext);
57
try {
58
result = scopedCallback();
59
- } catch (error) {
60
- // IE8 requires `catch` in order to use `finally`.
61
- throw error;
59
} finally {
60
ReactContext.current = previousContext;
61
}
src/core/ReactUpdates.js
-3
@@ -79,9 +79,6 @@ function flushBatchedUpdates() {
79
// Run these in separate functions so the JIT can optimize
80
try {
81
runBatchedUpdates();
82
- } catch (e) {
83
- // IE 8 requires catch to use finally.
84
- throw e;
82
} finally {
83
clearDirtyComponents();
84
}
src/core/__tests__/ReactCompositeComponent-test.js
-4
@@ -737,8 +737,6 @@ describe('ReactCompositeComponent', function() {
737
);
738
739
NamedComponent(); // Shut up lint
740
- } catch (e) {
741
- throw e;
740
} finally {
741
console.warn = warn;
742
}
@@ -780,8 +778,6 @@ describe('ReactCompositeComponent', function() {
778
'createClass(...): `childContextTypes` is now a static property and ' +
779
'should be defined inside "statics".'
780
);
783
- } catch (e) {
784
- throw e;
781
} finally {
782
console.warn = warn;
783
}