WebStorm IDEで行にelement is not exported
という文字列を受け取っている理由がわかりません。WebStormのJavaScript用の要素の警告が表示されない
function FooBar(userId, email) {
if (!util.isString(userId) || !userId.length) {
throw Error('FooBar(): requires a non-empty userId:String');
}
if (this instanceof FooBar) {
this.id = generateId();
this.userId = userId;
this.email = email;
this.curStep = WORKER_STEPS[0];
this.completed = false;
this.failed = false;
this.createDate = new Date();
this.errors = {};
for (let step of WORKER_STEPS) {
this.errors[step] = 0;
}
} else {
return new FooBar(userId, email);
}
}
ただ一つの質問、それはv.6.x.xをNodeJSのですか? – num8er
それはES6をサポートすることを幸運! (; https://nodejs.org/en/blog/release/v4.0.0/ – num8er