bn.js 5.1.2 → 5.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 5.1.3 / 2020-08-14
2
+ ------------------
3
+
4
+ - Add support for defined but not implemented Symbol.for (#252)
5
+
1
6
  5.1.2 / 2020-05-20
2
7
  ------------------
3
8
 
package/lib/bn.js CHANGED
@@ -370,7 +370,11 @@
370
370
  // Check Symbol.for because not everywhere where Symbol defined
371
371
  // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility
372
372
  if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {
373
- BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;
373
+ try {
374
+ BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;
375
+ } catch (e) {
376
+ BN.prototype.inspect = inspect;
377
+ }
374
378
  } else {
375
379
  BN.prototype.inspect = inspect;
376
380
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bn.js",
3
- "version": "5.1.2",
3
+ "version": "5.1.3",
4
4
  "description": "Big number implementation in pure javascript",
5
5
  "keywords": [
6
6
  "BN",