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

Method overriding when extends #67

Closed
kalitine opened this issue Jan 12, 2017 · 1 comment
Closed

Method overriding when extends #67

kalitine opened this issue Jan 12, 2017 · 1 comment

Comments

@kalitine
Copy link

class MyEventSource extends EventSource {
  close() {
    console.log('My close function call')
  }
}

const es = new MyEventSource(...)
es.close()

In the Browser (Chrome or Firefox) the output is:

My close function call

But in the NodeJS the output is:

undefined

Because my close function does not override the EventSource.close function.

rexxars added a commit to rexxars/eventsource that referenced this issue May 17, 2017
rexxars added a commit that referenced this issue May 28, 2017
Make `close()` a prototype method. Closes #67.
@rexxars
Copy link
Member

rexxars commented May 28, 2017

Fixed in v1.0.2

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

No branches or pull requests

2 participants