From 1d54761d48f943411e96ac465eae21f6babf7e23 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 1 Apr 2016 10:32:11 +0100 Subject: [PATCH] Fix comparison of Buffers (again) --- red/runtime/util.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/red/runtime/util.js b/red/runtime/util.js index c73745e02..efe7ec386 100644 --- a/red/runtime/util.js +++ b/red/runtime/util.js @@ -92,9 +92,9 @@ function compareObjects(obj1,obj2) { return false; } if (isBuffer1 && isBuffer2) { - if (Buffer.compare) { - // For node 4.x+ - use the native compare - return Buffer.equals(obj1,obj2); + if (obj1.equals) { + // For node 0.12+ - use the native equals + return obj1.equals(obj2); } else { if (obj1.length !== obj2.length) { return false;