diff options
Diffstat (limited to 'lib/smalloc.js')
-rw-r--r-- | lib/smalloc.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/smalloc.js b/lib/smalloc.js index b0226a0313..b6e9093472 100644 --- a/lib/smalloc.js +++ b/lib/smalloc.js @@ -39,15 +39,15 @@ function alloc(n, obj) { if (n > kMaxLength) throw new RangeError('n > kMaxLength'); - if (Array.isArray(obj)) + if (IS_ARRAY(obj)) throw new TypeError('Arrays are not supported'); - return smalloc.alloc(obj === undefined ? {} : obj, n); + return smalloc.alloc(IS_UNDEFINED(obj) ? {} : obj, n); } function dispose(obj) { - if (obj instanceof Buffer) + if (IS_BUFFER(obj)) throw new TypeError('obj cannot be a Buffer'); smalloc.dispose(obj); } |