Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vanquyettran committed Feb 1, 2023
1 parent 8d14984 commit e98d633
Show file tree
Hide file tree
Showing 21 changed files with 135 additions and 44 deletions.
7 changes: 3 additions & 4 deletions lib/core/cjs.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -1480,12 +1480,11 @@ let _reconcileOnlyChildOfDynamicNode = (current, alternate, isRenderRoot) => {
newContent = current.type_(current.props_);
flushCurrentlyProcessing();
} catch (error) {
// Must flush currently processing info right after an error occurred,
// because catchError may cause re-render at a higher level component
// TODO: Add tests for this case
newContent = null;
// Must flush currently processing info before catchError(),
// because catchError() may cause re-render at a higher level component
flushCurrentlyProcessing();
catchError(error, current);
newContent = null;
}

let newChild = createVNodeFromContent(newContent);
Expand Down
7 changes: 3 additions & 4 deletions lib/core/cjs.development.legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1458,12 +1458,11 @@ var _reconcileOnlyChildOfDynamicNode = function _reconcileOnlyChildOfDynamicNode
newContent = current.type_(current.props_);
flushCurrentlyProcessing();
} catch (error) {
// Must flush currently processing info right after an error occurred,
// because catchError may cause re-render at a higher level component
// TODO: Add tests for this case
newContent = null; // Must flush currently processing info before catchError(),
// because catchError() may cause re-render at a higher level component

flushCurrentlyProcessing();
catchError(error, current);
newContent = null;
}

var newChild = createVNodeFromContent(newContent);
Expand Down
2 changes: 1 addition & 1 deletion lib/core/cjs.development.legacy.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/core/cjs.development.min.js

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions lib/core/cjs.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -1480,12 +1480,11 @@ let _reconcileOnlyChildOfDynamicNode = (current, alternate, isRenderRoot) => {
newContent = current.type_(current.props_);
flushCurrentlyProcessing();
} catch (error) {
// Must flush currently processing info right after an error occurred,
// because catchError may cause re-render at a higher level component
// TODO: Add tests for this case
newContent = null;
// Must flush currently processing info before catchError(),
// because catchError() may cause re-render at a higher level component
flushCurrentlyProcessing();
catchError(error, current);
newContent = null;
}

let newChild = createVNodeFromContent(newContent);
Expand Down
7 changes: 3 additions & 4 deletions lib/core/cjs.production.legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1458,12 +1458,11 @@ var _reconcileOnlyChildOfDynamicNode = function _reconcileOnlyChildOfDynamicNode
newContent = current.type_(current.props_);
flushCurrentlyProcessing();
} catch (error) {
// Must flush currently processing info right after an error occurred,
// because catchError may cause re-render at a higher level component
// TODO: Add tests for this case
newContent = null; // Must flush currently processing info before catchError(),
// because catchError() may cause re-render at a higher level component

flushCurrentlyProcessing();
catchError(error, current);
newContent = null;
}

var newChild = createVNodeFromContent(newContent);
Expand Down
2 changes: 1 addition & 1 deletion lib/core/cjs.production.legacy.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/core/cjs.production.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions lib/core/esm.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -1476,12 +1476,11 @@ let _reconcileOnlyChildOfDynamicNode = (current, alternate, isRenderRoot) => {
newContent = current.type_(current.props_);
flushCurrentlyProcessing();
} catch (error) {
// Must flush currently processing info right after an error occurred,
// because catchError may cause re-render at a higher level component
// TODO: Add tests for this case
newContent = null;
// Must flush currently processing info before catchError(),
// because catchError() may cause re-render at a higher level component
flushCurrentlyProcessing();
catchError(error, current);
newContent = null;
}

let newChild = createVNodeFromContent(newContent);
Expand Down
7 changes: 3 additions & 4 deletions lib/core/esm.development.legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1453,12 +1453,11 @@ var _reconcileOnlyChildOfDynamicNode = function _reconcileOnlyChildOfDynamicNode
newContent = current.type_(current.props_);
flushCurrentlyProcessing();
} catch (error) {
// Must flush currently processing info right after an error occurred,
// because catchError may cause re-render at a higher level component
// TODO: Add tests for this case
newContent = null; // Must flush currently processing info before catchError(),
// because catchError() may cause re-render at a higher level component

flushCurrentlyProcessing();
catchError(error, current);
newContent = null;
}

var newChild = createVNodeFromContent(newContent);
Expand Down
Loading

0 comments on commit e98d633

Please sign in to comment.