An ECMAScript spec-compliant Symbol.prototype.description
shim. Invoke its "shim" method to shim Symbol.prototype.description if it is unavailable.
Note: Symbol#description
requires a true ES6 environment, specifically one with native Symbols.
This package implements the es-shim API interface. It works in an ES6-supported environment and complies with the spec.
Most common usage:
var description = ; ;;;; // note: this should be the empty string, but in many engines,// it is impossible to distinguish Symbol() and Symbol('')// without globally replacing `Symbol`; if !Symbolprototypedescription description; ;;;; ; // this works fine!
Tests
Simply clone the repo, npm install
, and run npm test