Skip to content

Commit

Permalink
Update test/built-ins/Function/prototype/arguments/prop-desc.js
Browse files Browse the repository at this point in the history
Co-authored-by: Richard Gibson <[email protected]>
  • Loading branch information
jdorfman and gibson042 authored Jan 20, 2025
1 parent 527fc5f commit e9b49de
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/built-ins/Function/prototype/arguments/prop-desc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,19 @@ assert.sameValue(typeof argumentsDesc.set, "function",
"Function.prototype.arguments has function setter");
assert.sameValue(argumentsDesc.get, argumentsDesc.set,
"Function.prototype.arguments property getter/setter are the same function");

var throwTypeError;
WellKnownIntrinsicObjects.forEach(function(record) {
if (record.name === "%ThrowTypeError%") {
throwTypeError = record.value;
}
});
if (throwTypeError) {
assert.sameValue(descriptor.set, throwTypeError, "Function.prototype.arguments getter is %ThrowTypeError%");
}
assert.throws(TypeError, function() {
return Function.prototype.arguments;
});
assert.throws(TypeError, function() {
Function.prototype.arguments = {};
});

0 comments on commit e9b49de

Please sign in to comment.