Skip to content

Commit 2cc660c

Browse files
authored
Merge pull request #85 from zenparsing/non-extensible-symbols
Don't attempt to polyfill symbol if Symbol is frozen
2 parents 96b8dcc + a2d4864 commit 2cc660c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Observable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const hasSymbols = () => typeof Symbol === 'function';
44
const hasSymbol = name => hasSymbols() && Boolean(Symbol[name]);
55
const getSymbol = name => hasSymbol(name) ? Symbol[name] : '@@' + name;
66

7-
if (hasSymbols() && !hasSymbol('observable')) {
7+
if (hasSymbols() && !hasSymbol('observable') && Object.isExtensible(Symbol)) {
88
Symbol.observable = Symbol('observable');
99
}
1010

0 commit comments

Comments
 (0)