私が試したこと(クロムで動作します)
var class_str = "class Test {};";
var a = eval(class_str);
console.log(new a());
Firefox 46 で次のエラーが発生します。
TypeError: a is not a constructor
a
は未定義で、 return を使用していnew A()
ますReferenceError: A is not defined
。
Firefox との違いは何ですか?