Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary catch-clauses for try-finally #967

Merged
merged 1 commit into from
Feb 4, 2014
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
5 changes: 0 additions & 5 deletions src/core/ReactCompositeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,6 @@ var ReactCompositeComponentMixin = {
this._currentContext = nextFullContext;
this.context = nextContext;
}
} catch (e) {
throw e;
} finally {
this._compositeLifeCycleState = null;
}
Expand Down Expand Up @@ -1164,9 +1162,6 @@ var ReactCompositeComponentMixin = {
ReactCurrentOwner.current = this;
try {
renderedComponent = this.render();
} catch (error) {
// IE8 requires `catch` in order to use `finally`.
throw error;
} finally {
ReactContext.current = previousContext;
ReactCurrentOwner.current = null;
Expand Down
3 changes: 0 additions & 3 deletions src/core/ReactContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ var ReactContext = {
ReactContext.current = merge(previousContext, newContext);
try {
result = scopedCallback();
} catch (error) {
// IE8 requires `catch` in order to use `finally`.
throw error;
} finally {
ReactContext.current = previousContext;
}
Expand Down
3 changes: 0 additions & 3 deletions src/core/ReactUpdates.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ function flushBatchedUpdates() {
// Run these in separate functions so the JIT can optimize
try {
runBatchedUpdates();
} catch (e) {
// IE 8 requires catch to use finally.
throw e;
} finally {
clearDirtyComponents();
}
Expand Down
4 changes: 0 additions & 4 deletions src/core/__tests__/ReactCompositeComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -737,8 +737,6 @@ describe('ReactCompositeComponent', function() {
);

NamedComponent(); // Shut up lint
} catch (e) {
throw e;
} finally {
console.warn = warn;
}
Expand Down Expand Up @@ -780,8 +778,6 @@ describe('ReactCompositeComponent', function() {
'createClass(...): `childContextTypes` is now a static property and ' +
'should be defined inside "statics".'
);
} catch (e) {
throw e;
} finally {
console.warn = warn;
}
Expand Down