buffer: minor cleanup from rebase
authorTrevor Norris <trev.norris@gmail.com>
Wed, 17 Jun 2015 17:42:00 +0000 (11:42 -0600)
committerRod Vagg <rod@vagg.org>
Tue, 4 Aug 2015 18:56:13 +0000 (11:56 -0700)
PR-URL: https://github.com/nodejs/io.js/pull/2003
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
lib/internal/buffer_new.js

index 4bbb1a57a039b5b9c4aaff09d7647fbe2386ce22..3b3a20061466638c85b270add355440f9b3bdd92 100644 (file)
@@ -457,16 +457,7 @@ Buffer.prototype.write = function(string, offset, length, encoding) {
 
   // XXX legacy write(string, encoding, offset, length) - remove in v0.13
   } else {
-    if (!writeWarned) {
-      if (process.throwDeprecation)
-        throw new Error(writeMsg);
-      else if (process.traceDeprecation)
-        console.trace(writeMsg);
-      else
-        console.error(writeMsg);
-      writeWarned = true;
-    }
-
+    writeWarned = internalUtil.printDeprecationMessage(writeMsg, writeWarned);
     var swap = encoding;
     encoding = offset;
     offset = length >>> 0;