Skip to content

Commit ab17463

Browse files
committed
Changed a SupportsFunctionBindMethod test
1 parent 7f7332c commit ab17463

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "7.0.202"
3+
"version": "7.0.203"
44
}
55
}

test/MsieJavaScriptEngine.Test.Common/Es5TestsBase.cs

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

404-
const string input1 = "getA();";
411+
const string input1 = "a.getA();";
405412
const int targetOutput1 = 5;
406413

407-
const string input2 = "getA.bind(module)();";
414+
const string input2 = "a.getA.bind(otherContext)();";
408415
const int targetOutput2 = 12;
409416

410417
// Act

0 commit comments

Comments
 (0)