From 27a619246ffdc57090c2fcabb30991f0de52b939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E9=87=8C=E5=88=87=E7=BD=97?= Date: Tue, 28 Nov 2017 16:32:58 +0800 Subject: [PATCH] Add `btoa` back to domstubs.js --- examples/node/domstubs.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/node/domstubs.js b/examples/node/domstubs.js index fcd54c8ea..2efa7c0ac 100644 --- a/examples/node/domstubs.js +++ b/examples/node/domstubs.js @@ -197,6 +197,10 @@ DOMElementSerializer.prototype = { }, }; +function btoa (chars) { + return Buffer.from(chars, 'binary').toString('base64'); +} + const document = { childNodes : [], @@ -241,6 +245,7 @@ Image.prototype = { } } +exports.btoa = btoa; exports.document = document; exports.Image = Image;