Skip to content

Commit a63a0c4

Browse files
Eyesonly88facebook-github-bot
authored andcommitted
Added groupCollapsed polyfill (facebook#21457)
Summary: `groupCollapsed` is used to group logs but collapsed which is very useful when the console has many logs (e.g. when using `redux-logger`). For developers who prefer to debug iOS apps using Safari JSC, the `groupCollapsed` was not polyfilled. Fixes facebook#21446 Pull Request resolved: facebook#21457 Differential Revision: D13761796 Pulled By: cpojer fbshipit-source-id: e7c4f1ff4728c6a7f6ffd6cc629f7fbc1aa67e87
1 parent b9c24ee commit a63a0c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Libraries/polyfills/console.js

+6
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,11 @@ function consoleGroupPolyfill(label) {
509509
groupStack.push(GROUP_PAD);
510510
}
511511

512+
function consoleGroupCollapsedPolyfill(label) {
513+
global.nativeLoggingHook(groupFormat(GROUP_CLOSE, label), LOG_LEVELS.info);
514+
groupStack.push(GROUP_PAD);
515+
}
516+
512517
function consoleGroupEndPolyfill() {
513518
groupStack.pop();
514519
global.nativeLoggingHook(groupFormat(GROUP_CLOSE), LOG_LEVELS.info);
@@ -534,6 +539,7 @@ if (global.nativeLoggingHook) {
534539
table: consoleTablePolyfill,
535540
group: consoleGroupPolyfill,
536541
groupEnd: consoleGroupEndPolyfill,
542+
groupCollapsed: consoleGroupCollapsedPolyfill,
537543
};
538544

539545
// If available, also call the original `console` method since that is

0 commit comments

Comments
 (0)