browserify / browserify/node-util

Inconsistent behaviour with node inherits

未关闭
#14 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
255
派生
92
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先,在 Node 5.4 下以及经过 webpack 打包后,使用 MyClass/EventEmitter 继承代码片段复现该问题。比较两种环境中得到的 MyClass 原型;当自定义的 foo 方法与继承的 EventEmitter 方法同时保持可用时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, node.js, webpack
领域
tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。