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

Fix DevTools crash when inspecting document.all #19619

Merged
merged 8 commits into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions packages/react-devtools-shared/src/hydration.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export function dehydrate(
),
);

case 'html_all_collection':
case 'typed_array':
case 'iterator':
isPathAllowedCheck = isPathAllowed(path);
Expand Down
9 changes: 9 additions & 0 deletions packages/react-devtools-shared/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ export type DataType =
| 'data_view'
| 'date'
| 'function'
| 'html_all_collection'
| 'html_element'
| 'infinity'
| 'iterator'
Expand Down Expand Up @@ -405,6 +406,14 @@ export function getDataType(data: Object): DataType {
return 'html_element';
}

if (
// $FlowFixMe Flow doesn't know about HTMLAllCollection
typeof HTMLAllCollection !== 'undefined' &&
data instanceof HTMLAllCollection
omarsy marked this conversation as resolved.
Show resolved Hide resolved
) {
return 'html_all_collection';
}

const type = typeof data;
switch (type) {
case 'bigint':
Expand Down