Skip to content

Commit 1ff40cb

Browse files
committed
Changed a SupportsFunctionBindMethod test
1 parent 6e4884f commit 1ff40cb

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

test/JavaScriptEngineSwitcher.Tests/Es5TestsBase.cs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -394,18 +394,25 @@ public virtual void SupportsDateToIsoStringMethod()
394394
public virtual void SupportsFunctionBindMethod()
395395
{
396396
// Arrange
397-
const string initCode = @"var a = 5,
398-
module = {
399-
a: 12,
400-
getA: function() { return this.a; }
401-
},
402-
getA = module.getA
397+
const string initCode = @"var A = (function () {
398+
function A(a) {
399+
this.a = a;
400+
}
401+
402+
A.prototype.getA = function() {
403+
return this.a;
404+
};
405+
406+
return A;
407+
})(),
408+
a = new A(5),
409+
otherContext = { a: 12 }
403410
;";
404411

405-
const string input1 = "getA();";
412+
const string input1 = "a.getA();";
406413
const int targetOutput1 = 5;
407414

408-
const string input2 = "getA.bind(module)();";
415+
const string input2 = "a.getA.bind(otherContext)();";
409416
const int targetOutput2 = 12;
410417

411418
// Act

test/JavaScriptEngineSwitcher.Tests/Yantra/Es5Tests.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ protected override string EngineName
99
{
1010
get { return "YantraJsEngine"; }
1111
}
12-
13-
14-
#region Function methods
15-
16-
[Fact]
17-
public override void SupportsFunctionBindMethod()
18-
{ }
19-
20-
#endregion
2112
}
2213
}
2314
#endif

0 commit comments

Comments
 (0)