Reland "Updates node_modules and update script"
This is a reland of 4df552c6524c91c8d94ed318eedcf288a72a064f
Original change's description:
> Updates node_modules and update script
>
> Change-Id: I3fcf49bc416301a030d298cfc48c448bfeba4335
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1878808
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Change-Id: I97d1442c21420488fadde3f17f67cd4e3b959be6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1880030
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
diff --git a/node_modules/buffer/index.js b/node_modules/buffer/index.js
index 92a3abb..19b0468 100644
--- a/node_modules/buffer/index.js
+++ b/node_modules/buffer/index.js
@@ -10,7 +10,10 @@
var base64 = require('base64-js')
var ieee754 = require('ieee754')
-var customInspectSymbol = typeof Symbol === 'function' ? Symbol.for('nodejs.util.inspect.custom') : null
+var customInspectSymbol =
+ (typeof Symbol === 'function' && typeof Symbol.for === 'function')
+ ? Symbol.for('nodejs.util.inspect.custom')
+ : null
exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
@@ -1065,7 +1068,7 @@
var out = ''
for (var i = start; i < end; ++i) {
- out += toHex(buf[i])
+ out += hexSliceLookupTable[buf[i]]
}
return out
}
@@ -1592,6 +1595,8 @@
}
} else if (typeof val === 'number') {
val = val & 255
+ } else if (typeof val === 'boolean') {
+ val = Number(val)
}
// Invalid ranges are not set to a default, so can range check early.
@@ -1649,11 +1654,6 @@
return str
}
-function toHex (n) {
- if (n < 16) return '0' + n.toString(16)
- return n.toString(16)
-}
-
function utf8ToBytes (string, units) {
units = units || Infinity
var codePoint
@@ -1783,3 +1783,17 @@
// For IE11 support
return obj !== obj // eslint-disable-line no-self-compare
}
+
+// Create lookup table for `toString('hex')`
+// See: https://github.com/feross/buffer/issues/219
+var hexSliceLookupTable = (function () {
+ var alphabet = '0123456789abcdef'
+ var table = new Array(256)
+ for (var i = 0; i < 16; ++i) {
+ var i16 = i * 16
+ for (var j = 0; j < 16; ++j) {
+ table[i16 + j] = alphabet[i] + alphabet[j]
+ }
+ }
+ return table
+})()