blob: 07a1f0a49cb16863c5921361f0adb1e14ec9b65a [file] [log] [blame]
var testCase = function (actual, expected, message) {
if (actual !== expected) {
throw message + ". Expected '" + expected + "', but was '" + actual + "'";
}
};
function run(count) {
var result = true;
for(var i=0; i<count; i++) {
var Obj = function (name) {
this.name = name;
this.getName = () => this.name;
};
var obj = new Obj("Item" + i);
if (obj.name !== obj.getName()) {
result = false;
}
}
return result;
}
testCase(run(1), true, "Error: Error: during execution of arrow function one time");
testCase(run(10), true, "Error: Error: during execution of arrow function 10 times");