browserify / browserify/node-util

Inconsistent behaviour with node inherits

Open
#14 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
255
Forks
92
PR merge metrics
No merged PRs in 30d

Description

I have a node class that inherits Event emitter:

```
function MyClass() {
EventEmitter.call(this);
}
util.inherits(MyClass, EventEmitter);
```

This class also has it's prototype object with methods:

```
MyClass.prototype.foo = function() {};
```

When I run my code on node (5.4) everything runs smoothly, but once webpack'ed the MyClass prototype gets squashed and only the EventEmitter methods survive.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with the MyClass/EventEmitter inheritance snippet under Node 5.4 and after webpack bundling. Compare the resulting MyClass prototype in both environments; done means the custom foo method remains available alongside the inherited EventEmitter methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, webpack
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.