"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/es5-ext/node_modules/es6-symbol/is-implemented.js" (7 Feb 2017, 474 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 'use strict';
    2 
    3 var validTypes = { object: true, symbol: true };
    4 
    5 module.exports = function () {
    6     var symbol;
    7     if (typeof Symbol !== 'function') return false;
    8     symbol = Symbol('test symbol');
    9     try { String(symbol); } catch (e) { return false; }
   10 
   11     // Return 'true' also for polyfills
   12     if (!validTypes[typeof Symbol.iterator]) return false;
   13     if (!validTypes[typeof Symbol.toPrimitive]) return false;
   14     if (!validTypes[typeof Symbol.toStringTag]) return false;
   15 
   16     return true;
   17 };