Skip to content

Commit f7abc6b

Browse files
committed
Add Symbol polyfill to make pretty-format happy
1 parent 488bcbc commit f7abc6b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/jsx.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import './polyfills';
12
import renderToString from '.';
23
import { indent, encodeEntities, assign } from './util';
34
import prettyFormat from 'pretty-format';

src/polyfills.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
if (typeof Symbol!=='function') {
2+
let c = 0;
3+
Symbol = function(s) { // eslint-disable-line
4+
return `@@${s}${++c}`;
5+
};
6+
Symbol.for = s => `@@${s}`;
7+
}

0 commit comments

Comments
 (0)