From 3d2c622ba72484dcf9de0a10b263af1e21247410 Mon Sep 17 00:00:00 2001 From: Zeke Sikelianos Date: Sat, 10 Jun 2017 12:22:27 -0700 Subject: [PATCH] use new Buffer.from --- docs-translations/jp/api/protocol.md | 2 +- docs-translations/ko-KR/api/protocol.md | 2 +- docs-translations/zh-CN/api/protocol.md | 2 +- docs/api/protocol.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs-translations/jp/api/protocol.md b/docs-translations/jp/api/protocol.md index ceef317966..b8b57378a7 100644 --- a/docs-translations/jp/api/protocol.md +++ b/docs-translations/jp/api/protocol.md @@ -76,7 +76,7 @@ app.on('ready', function () { ```javascript protocol.registerBufferProtocol('atom', function (request, callback) { - callback({mimeType: 'text/html', data: new Buffer('
Response
')}) + callback({mimeType: 'text/html', data: Buffer.from('
Response
')}) }, function (error) { if (error) console.error('Failed to register protocol') }) diff --git a/docs-translations/ko-KR/api/protocol.md b/docs-translations/ko-KR/api/protocol.md index 38a17bed14..8712f279e5 100644 --- a/docs-translations/ko-KR/api/protocol.md +++ b/docs-translations/ko-KR/api/protocol.md @@ -130,7 +130,7 @@ app.on('ready', () => { const {protocol} = require('electron') protocol.registerBufferProtocol('atom', (request, callback) => { - callback({mimeType: 'text/html', data: new Buffer('
Response
')}) + callback({mimeType: 'text/html', data: Buffer.from('
Response
')}) }, (error) => { if (error) console.error('Failed to register protocol') }) diff --git a/docs-translations/zh-CN/api/protocol.md b/docs-translations/zh-CN/api/protocol.md index e188bc0fcd..bbfa48b351 100644 --- a/docs-translations/zh-CN/api/protocol.md +++ b/docs-translations/zh-CN/api/protocol.md @@ -124,7 +124,7 @@ app.on('ready', () => { const {protocol} = require('electron') protocol.registerBufferProtocol('atom', (request, callback) => { - callback({mimeType: 'text/html', data: new Buffer('
Response
')}) + callback({mimeType: 'text/html', data: Buffer.from('
Response
')}) }, (error) => { if (error) console.error('Failed to register protocol') }) diff --git a/docs/api/protocol.md b/docs/api/protocol.md index 3de153db48..485f14bd20 100644 --- a/docs/api/protocol.md +++ b/docs/api/protocol.md @@ -137,7 +137,7 @@ Example: const {protocol} = require('electron') protocol.registerBufferProtocol('atom', (request, callback) => { - callback({mimeType: 'text/html', data: new Buffer('
Response
')}) + callback({mimeType: 'text/html', data: Buffer.from('
Response
')}) }, (error) => { if (error) console.error('Failed to register protocol') })