Fix install

This commit is contained in:
Luis Blanco 2019-08-06 16:51:55 +03:00
parent b71173820d
commit d75fb96f6b
2 changed files with 3 additions and 3 deletions

View File

@ -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<Napi::Object>(), name);
THIS_OBJ(that);
eventEmit(env, that, name);
}
```

View File

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