From 0e10d02f506295debb5890fc429ba8b5d2e74643 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 22 Mar 2024 16:30:44 -0400 Subject: [PATCH] Fix GetDisposeMethod to match consensus (#217) --- spec.emu | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spec.emu b/spec.emu index e2bf4a5..d63e82f 100644 --- a/spec.emu +++ b/spec.emu @@ -1065,12 +1065,13 @@ contributors: Ron Buckton, Ecma International 1. Let _method_ be ? GetMethod(_V_, @@asyncDispose). 1. If _method_ is *undefined*, then 1. Set _method_ to ? GetMethod(_V_, @@dispose). - 1. Let _closure_ be a new Abstract Closure with no parameters that captures _method_ and performs the following steps when called: - 1. Let _O_ be the *this* value. - 1. Perform ? Call(_method_, _O_). - 1. Return *undefined*. - 1. NOTE: This function is not observable to user code. It is used to ensure that a Promise returned from a synchronous `@@dispose` method will not be awaited. - 1. Return CreateBuiltinFunction(_closure_, 0, *""*, « »). + 1. If _method_ is not *undefined*, then + 1. Let _closure_ be a new Abstract Closure with no parameters that captures _method_ and performs the following steps when called: + 1. Let _O_ be the *this* value. + 1. Perform ? Call(_method_, _O_). + 1. Return *undefined*. + 1. NOTE: This function is not observable to user code. It is used to ensure that a Promise returned from a synchronous `@@dispose` method will not be awaited. + 1. Return CreateBuiltinFunction(_closure_, 0, *""*, « »). 1. Else, 1. Let _method_ be ? GetMethod(_V_, @@dispose). 1. Return _method_.