// Licensed Materials - Property of IBM
//
// IBM Watson Analytics
//
// (C) Copyright IBM Corp. 2015
//
// US Government Users Restricted Rights - Use, duplication or
// disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
module.exports = ( function()
{
"use strict";
var next = 0;
/**
* Create a "{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol Symbol}" which is
* actually just a string (so it works "like" a Symbol in older environments).
* Symbol is never used with new, it is meant to be invoked as a creator function:
*
* var key = Symbol( "description" );
* var obj = {};
* obj[key] = "value";
*
* @class module:barejs/polyfill.Symbol
* @throws {TypeError} Throws a TypeError if used as a constructor (with new).
* @param {string} [_description] Optional: a description of the Symbol that will provide a hint of what the
* Symbol is for. Only for debug, does not affect the actual Symbol in any way.
*/
return function Symbol( _description )
{
if ( this instanceof Symbol )
throw new TypeError( "Symbol is not a constructor" );
return "__" + ( ++next ) + "\x01Symbol(" + ( _description || "" ) + ")";
};
}() );