From 30c0ad73add93fefe50f63bd32c880e1b4d4bea0 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Mon, 4 Dec 2023 11:03:03 -0700 Subject: [PATCH 1/2] replace RequireObjectCoercible with ToObject --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index df00d08..e0fe88f 100644 --- a/spec.html +++ b/spec.html @@ -118,7 +118,7 @@

- 1. Let _O_ be ? RequireObjectCoercible(*this* value). + 1. Let _O_ be ? ToObject(*this* value). 1. If _O_ is _home_, then 1. NOTE: Throwing here emulates assignment to a non-writable data property on the _home_ object in strict mode code. 1. Throw a *TypeError* exception. From bb9bf0be975d5ffd64fe2815986034a223ddd4f2 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Mon, 4 Dec 2023 11:19:15 -0700 Subject: [PATCH 2/2] throw if not already an object --- spec.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spec.html b/spec.html index f754a9f..fe1d867 100644 --- a/spec.html +++ b/spec.html @@ -119,15 +119,16 @@

- 1. Let _O_ be ? ToObject(_this_). - 1. If _O_ is _home_, then + 1. If _this_ is not an Object, then + 1. Throw a *TypeError* exception. + 1. If _this_ is _home_, then 1. NOTE: Throwing here emulates assignment to a non-writable data property on the _home_ object in strict mode code. 1. Throw a *TypeError* exception. - 1. Let _desc_ be ? _O_.[[GetOwnProperty]](_p_). + 1. Let _desc_ be ? _this_.[[GetOwnProperty]](_p_). 1. If _desc_ is *undefined*, then - 1. Perform ? CreateDataPropertyOrThrow(_O_, _p_, _v_). + 1. Perform ? CreateDataPropertyOrThrow(_this_, _p_, _v_). 1. Else, - 1. Perform ? Set(_O_, _p_, _v_, *true*). + 1. Perform ? Set(_this_, _p_, _v_, *true*). 1. Return ~unused~.