From e9b49ded97a7a510ef8dbdc87a76b747edfe4718 Mon Sep 17 00:00:00 2001 From: Justin Dorfman Date: Sun, 19 Jan 2025 16:53:22 -0800 Subject: [PATCH] Update test/built-ins/Function/prototype/arguments/prop-desc.js Co-authored-by: Richard Gibson --- .../Function/prototype/arguments/prop-desc.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/built-ins/Function/prototype/arguments/prop-desc.js b/test/built-ins/Function/prototype/arguments/prop-desc.js index aa08554e8b..9f41182594 100644 --- a/test/built-ins/Function/prototype/arguments/prop-desc.js +++ b/test/built-ins/Function/prototype/arguments/prop-desc.js @@ -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 = {}; +});