Skip to content

Commit

Permalink
[BUGFIX beta] Reduce false positives for HAS_NATIVE_SYMBOL with polyf…
Browse files Browse the repository at this point in the history
…ills.

Prior to this change the core.js polyfills would be detected as "native
symbols" (they monkey patch `Object.prototype.toString` to avoid detection by
our prior check).

Co-authored-by: Godfrey Chan <godfreykfc@gmail.com>
  • Loading branch information
rwjblue and chancancode committed Jul 31, 2019
1 parent c587dd9 commit c86f69f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/@ember/-internals/utils/lib/symbol-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ export const HAS_NATIVE_SYMBOL = (function() {
return false;
}

// use `Object`'s `.toString` directly to prevent us from detecting
// polyfills as native
return Object.prototype.toString.call(Symbol()) === '[object Symbol]';
return typeof Symbol() === 'symbol';
})();

0 comments on commit c86f69f

Please sign in to comment.