@@ -35,7 +35,6 @@ const isWindows = process.platform === 'win32'; |
35 | 35 |
|
36 | 36 | const DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); |
37 | 37 | const errnoException = util._errnoException; |
38 | | -const printDeprecation = require('internal/util').printDeprecationMessage; |
39 | 38 |
|
40 | 39 | function throwOptionsError(options) { |
41 | 40 | throw new TypeError('Expected options to be either an object or a string, ' + |
@@ -585,14 +584,9 @@ fs.openSync = function(path, flags, mode) { |
585 | 584 | return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); |
586 | 585 | }; |
587 | 586 |
|
588 | | -var readWarned = false; |
589 | 587 | fs.read = function(fd, buffer, offset, length, position, callback) { |
590 | 588 | if (!(buffer instanceof Buffer)) { |
591 | 589 | // legacy string interface (fd, length, position, encoding, callback) |
592 | | - readWarned = printDeprecation('fs.read\'s legacy String interface ' + |
593 | | - 'is deprecated. Use the Buffer API as ' + |
594 | | - 'mentioned in the documentation instead.', |
595 | | - readWarned); |
596 | 590 | const cb = arguments[4]; |
597 | 591 | const encoding = arguments[3]; |
598 | 592 |
|
@@ -642,17 +636,12 @@ function tryToStringWithEnd(buf, encoding, end, callback) { |
642 | 636 | callback(e, buf, end); |
643 | 637 | } |
644 | 638 |
|
645 | | -var readSyncWarned = false; |
646 | 639 | fs.readSync = function(fd, buffer, offset, length, position) { |
647 | 640 | var legacy = false; |
648 | 641 | var encoding; |
649 | 642 |
|
650 | 643 | if (!(buffer instanceof Buffer)) { |
651 | 644 | // legacy string interface (fd, length, position, encoding, callback) |
652 | | - readSyncWarned = printDeprecation('fs.readSync\'s legacy String interface' + |
653 | | - 'is deprecated. Use the Buffer API as ' + |
654 | | - 'mentioned in the documentation instead.', |
655 | | - readSyncWarned); |
656 | 645 | legacy = true; |
657 | 646 | encoding = arguments[3]; |
658 | 647 |
|
|