Skip to content

Commit c1058c3

Browse files
committed
Cordova support: Check for existence of Symbol.for
Fixes: feross/buffer#241 See: feross/buffer#204 (comment)
1 parent 88297f4 commit c1058c3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010

1111
var base64 = require('base64-js')
1212
var ieee754 = require('ieee754')
13-
var customInspectSymbol = typeof Symbol === 'function' ? Symbol.for('nodejs.util.inspect.custom') : null
13+
var customInspectSymbol =
14+
(typeof Symbol === 'function' && typeof Symbol.for === 'function')
15+
? Symbol.for('nodejs.util.inspect.custom')
16+
: null
1417

1518
exports.Buffer = Buffer
1619
exports.SlowBuffer = SlowBuffer

0 commit comments

Comments
 (0)