From 7b1eabb7932533d95fb6e8c71624c5786e97a675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Wed, 30 Apr 2025 14:16:18 +0200 Subject: [PATCH] Update a setter function source text test --- .../string-literal-getter-setter-decompilation.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/staging/sm/extensions/string-literal-getter-setter-decompilation.js b/test/staging/sm/extensions/string-literal-getter-setter-decompilation.js index dbb060c2af..326266430f 100644 --- a/test/staging/sm/extensions/string-literal-getter-setter-decompilation.js +++ b/test/staging/sm/extensions/string-literal-getter-setter-decompilation.js @@ -10,6 +10,7 @@ description: | pending esid: pending ---*/ + var f; try { @@ -29,14 +30,12 @@ assert.sameValue(fstr.indexOf("set") < fstr.indexOf("c d e"), true, assert.sameValue(fstr.indexOf("setter") < 0, true, "using old-style syntax?"); var o = f(); -var ostr = "" + o; assert.sameValue("c d e" in o, true, "missing the property?"); assert.sameValue("set" in Object.getOwnPropertyDescriptor(o, "c d e"), true, "'c d e' property not a setter?"); -// disabled because we still generate old-style syntax here (toSource -// decompilation is as yet unfixed) -// assert.sameValue(ostr.indexOf("set") < ostr.indexOf("c d e"), true, -// "should be using new-style syntax when getting the source of a " + -// "getter/setter while decompiling an object"); -// assert.sameValue(ostr.indexOf("setter") < 0, true, "using old-style syntax?"); +var ostr = Object.getOwnPropertyDescriptor(o, "c d e").set + o; +assert.sameValue(ostr.indexOf("set") < ostr.indexOf("c d e"), true, + "should be using new-style syntax when getting the source of a " + + "getter/setter while decompiling an object" + ostr); +assert.sameValue(ostr.indexOf("setter") < 0, true, "using old-style syntax?");