Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define "requestsCount" var and "requests" hash unconditionally #490

Merged
merged 1 commit into from
Oct 20, 2016

Conversation

unclecheese
Copy link
Contributor

There are situations in which global.document can be defined after the file is loaded, but before a request is created. This kills Request.prototype.create here:

  if (global.document) {
    this.index = Request.requestsCount++;
    Request.requests[this.index] = this;
  }

As the global exists, but those static properties were never defined. Is there any harm in defining them unconditionally?

There are situations in which `global.document` can be defined after the file is loaded, but before a request is created. This kills `Request.prototype.create` here:

```js
  if (global.document) {
    this.index = Request.requestsCount++;
    Request.requests[this.index] = this;
  }
```

As the global exists, but those static properties were never defined. Is there any harm in defining them unconditionally?
@darrachequesne darrachequesne merged commit eb24245 into socketio:master Oct 20, 2016
@darrachequesne
Copy link
Member

@unclecheese thanks!

@darrachequesne darrachequesne added this to the 1.7.1 milestone Oct 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants