Skip to content

Commit 1455648

Browse files
authored
Ensure callback interfaces don’t leak implementation through thisArg (#189)
This fixes up #172.
1 parent 06eb4ae commit 1455648

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/constructs/callback-interface.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class CallbackInterface {
8181
}
8282
8383
function callTheUserObjectsOperation(${argNames.join(", ")}) {
84-
let thisArg = this;
84+
let thisArg = utils.tryWrapperForImpl(this);
8585
let O = value;
8686
let X = O;
8787
`;

test/__snapshots__/test.js.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports.convert = function convert(value, { context = \\"The provided value\\" }
1212
}
1313

1414
function callTheUserObjectsOperation() {
15-
let thisArg = this;
15+
let thisArg = utils.tryWrapperForImpl(this);
1616
let O = value;
1717
let X = O;
1818

@@ -1176,7 +1176,7 @@ exports.convert = function convert(value, { context = \\"The provided value\\" }
11761176
}
11771177

11781178
function callTheUserObjectsOperation(event) {
1179-
let thisArg = this;
1179+
let thisArg = utils.tryWrapperForImpl(this);
11801180
let O = value;
11811181
let X = O;
11821182

@@ -1875,7 +1875,7 @@ exports.convert = function convert(value, { context = \\"The provided value\\" }
18751875
}
18761876

18771877
function callTheUserObjectsOperation(node) {
1878-
let thisArg = this;
1878+
let thisArg = utils.tryWrapperForImpl(this);
18791879
let O = value;
18801880
let X = O;
18811881

@@ -7353,7 +7353,7 @@ exports.convert = function convert(value, { context = \\"The provided value\\" }
73537353
}
73547354

73557355
function callTheUserObjectsOperation() {
7356-
let thisArg = this;
7356+
let thisArg = utils.tryWrapperForImpl(this);
73577357
let O = value;
73587358
let X = O;
73597359

@@ -8486,7 +8486,7 @@ exports.convert = function convert(value, { context = \\"The provided value\\" }
84868486
}
84878487

84888488
function callTheUserObjectsOperation(event) {
8489-
let thisArg = this;
8489+
let thisArg = utils.tryWrapperForImpl(this);
84908490
let O = value;
84918491
let X = O;
84928492

@@ -9184,7 +9184,7 @@ exports.convert = function convert(value, { context = \\"The provided value\\" }
91849184
}
91859185

91869186
function callTheUserObjectsOperation(node) {
9187-
let thisArg = this;
9187+
let thisArg = utils.tryWrapperForImpl(this);
91889188
let O = value;
91899189
let X = O;
91909190

0 commit comments

Comments
 (0)