From d75fb96f6b9d315d3da0a400da6109aca3fe103e Mon Sep 17 00:00:00 2001 From: Luis Blanco Date: Tue, 6 Aug 2019 16:51:55 +0300 Subject: [PATCH] Fix install --- README.md | 3 ++- install.js | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 23350bf..0bb5603 100644 --- a/README.md +++ b/README.md @@ -662,7 +662,8 @@ MyClass.prototype.__proto__ = EventEmitter.prototype; // C++ void MyClass::emit(const Napi::CallbackInfo& info, const char* name) { NAPI_ENV; - eventEmit(env, info.This().As(), name); + THIS_OBJ(that); + eventEmit(env, that, name); } ``` diff --git a/install.js b/install.js index 4412044..51a507f 100644 --- a/install.js +++ b/install.js @@ -19,10 +19,9 @@ const onError = msg => { const install = (url, count = 1) => { - url = url.toLowerCase(); const proto = protocols[url.match(/^https?/)[0]]; - const request = https.get(url, response => { + const request = proto.get(url, response => { // Handle redirects if ([301, 302, 303, 307].includes(response.statusCode)) {