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)) {