From: Jordan Harband Date: Fri, 20 Dec 2019 07:13:14 +0000 (-0800) Subject: [Fix] `Symbol.for` is a syntax error in older browsers X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=5046ff75f4ea31d680c3e20a1b30c5dd310e4320;p=buffer.git [Fix] `Symbol.for` is a syntax error in older browsers For example, Opera 10.6. Introduced when fixing #241. --- diff --git a/index.js b/index.js index 19b0468..115e464 100644 --- a/index.js +++ b/index.js @@ -11,8 +11,8 @@ var base64 = require('base64-js') var ieee754 = require('ieee754') var customInspectSymbol = - (typeof Symbol === 'function' && typeof Symbol.for === 'function') - ? Symbol.for('nodejs.util.inspect.custom') + (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') + ? Symbol['for']('nodejs.util.inspect.custom') : null exports.Buffer = Buffer