Skip to content

Commit cb0d8e9

Browse files
committed
Function.prototype: Restore arguments/caller properties before use
1 parent eb7e471 commit cb0d8e9

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

test/built-ins/Function/prototype/arguments/prop-desc.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ includes: [propertyHelper.js, wellKnownIntrinsicObjects.js]
1414

1515
const argumentsDesc = Object.getOwnPropertyDescriptor(Function.prototype, 'arguments');
1616

17-
verifyProperty(Function.prototype, "arguments", {
18-
enumerable: false,
19-
configurable: true
20-
});
17+
verifyProperty(
18+
Function.prototype,
19+
"arguments",
20+
{ enumerable: false, configurable: true },
21+
{ restore: true }
22+
);
2123

2224
assert.sameValue(typeof argumentsDesc.get, "function",
2325
"Function.prototype.arguments has function getter");

test/built-ins/Function/prototype/caller/prop-desc.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ includes: [propertyHelper.js, wellKnownIntrinsicObjects.js]
1212

1313
const callerDesc = Object.getOwnPropertyDescriptor(Function.prototype, 'caller');
1414

15-
verifyProperty(Function.prototype, "caller", {
16-
enumerable: false,
17-
configurable: true
18-
});
15+
verifyProperty(
16+
Function.prototype,
17+
"caller",
18+
{ enumerable: false, configurable: true },
19+
{ restore: true }
20+
);
1921

2022
assert.sameValue(typeof callerDesc.get, "function",
2123
"Function.prototype.caller has function getter");

0 commit comments

Comments
 (0)