From 40272ad39f73faa34b3984cfd497ae6170896833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Wed, 30 Apr 2025 14:16:04 +0200 Subject: [PATCH] Remove print calls in sm/Proxy --- test/staging/sm/Proxy/getPrototypeOf.js | 15 +-------------- ...tringify-replacer-array-revocable-proxy.js | 18 +----------------- test/staging/sm/Proxy/ownkeys-linear.js | 16 +--------------- .../sm/Proxy/ownkeys-trap-duplicates.js | 19 +------------------ test/staging/sm/Proxy/proxy-__proto__.js | 17 +---------------- .../sm/Proxy/proxy-with-revoked-arguments.js | 7 +------ .../sm/Proxy/revocable-proxy-prototype.js | 14 +------------- .../staging/sm/Proxy/revoke-as-side-effect.js | 3 +-- test/staging/sm/Proxy/setPrototypeOf.js | 15 +-------------- test/staging/sm/Proxy/trap-null.js | 15 +-------------- 10 files changed, 10 insertions(+), 129 deletions(-) diff --git a/test/staging/sm/Proxy/getPrototypeOf.js b/test/staging/sm/Proxy/getPrototypeOf.js index 0b8232cb67..9e0d405e80 100644 --- a/test/staging/sm/Proxy/getPrototypeOf.js +++ b/test/staging/sm/Proxy/getPrototypeOf.js @@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Scripted proxies' [[GetPrototypeOf]] behavior esid: pending ---*/ -var gTestfile = "getPrototypeOf.js"; -var BUGNUMBER = 888969; -var summary = "Scripted proxies' [[GetPrototypeOf]] behavior"; - -print(BUGNUMBER + ": " + summary); - -/************** - * BEGIN TEST * - **************/ const log = []; @@ -272,7 +263,3 @@ p = new Proxy(Object.preventExtensions(new Number(55)), { getPrototypeOf() { return Number.prototype; } }); assert.sameValue(Object.getPrototypeOf(p), Number.prototype); - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Proxy/json-stringify-replacer-array-revocable-proxy.js b/test/staging/sm/Proxy/json-stringify-replacer-array-revocable-proxy.js index a3c0cfda71..e747aab1a3 100644 --- a/test/staging/sm/Proxy/json-stringify-replacer-array-revocable-proxy.js +++ b/test/staging/sm/Proxy/json-stringify-replacer-array-revocable-proxy.js @@ -8,21 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Don't assert when JSON.stringify is passed a revocable proxy to an array, then that proxy is revoked midflight during stringification esid: pending ---*/ -var gTestfile = "json-stringify-replacer-array-revocable-proxy.js"; -//----------------------------------------------------------------------------- -var BUGNUMBER = 1196497; -var summary = - "Don't assert when JSON.stringify is passed a revocable proxy to an array, " + - "then that proxy is revoked midflight during stringification"; - -print(BUGNUMBER + ": " + summary); - -/************** - * BEGIN TEST * - **************/ var arr = []; var { proxy, revoke } = Proxy.revocable(arr, { @@ -40,7 +28,3 @@ var { proxy, revoke } = Proxy.revocable(arr, { }); assert.sameValue(JSON.stringify({a: 0}, proxy), "{}"); - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Proxy/ownkeys-linear.js b/test/staging/sm/Proxy/ownkeys-linear.js index 5227dbb362..9a8bac924e 100644 --- a/test/staging/sm/Proxy/ownkeys-linear.js +++ b/test/staging/sm/Proxy/ownkeys-linear.js @@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Scripted proxies' [[OwnPropertyKeys]] should have linear complexity esid: pending ---*/ -var gTestfile = 'ownkeys-linear.js'; -var BUGNUMBER = 1257779; -var summary = - "Scripted proxies' [[OwnPropertyKeys]] should have linear complexity"; - -print(BUGNUMBER + ": " + summary); - -/************** - * BEGIN TEST * - **************/ // Making this 50k makes cgc builds time out on tbpl. 5k takes 28s locally. // 10k takes 84s locally. So pick an intermediate number, with a generous @@ -69,7 +59,3 @@ var p = new Proxy(target, handler); // The test passes if it doesn't time out. assert.sameValue(Object.getOwnPropertyNames(p).length, HALF_COUNT * 2); - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Proxy/ownkeys-trap-duplicates.js b/test/staging/sm/Proxy/ownkeys-trap-duplicates.js index 7d374a11ce..c49b0c969a 100644 --- a/test/staging/sm/Proxy/ownkeys-trap-duplicates.js +++ b/test/staging/sm/Proxy/ownkeys-trap-duplicates.js @@ -8,22 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Scripted proxies' [[OwnPropertyKeys]] should not throw if the trap implementation returns duplicate properties and the object is non-extensible or has non-configurable properties. Revised (bug 1389752): Throw TypeError for duplicate properties. esid: pending ---*/ -var gTestfile = 'ownkeys-trap-duplicates.js'; -var BUGNUMBER = 1293995; -var summary = - "Scripted proxies' [[OwnPropertyKeys]] should not throw if the trap " + - "implementation returns duplicate properties and the object is " + - "non-extensible or has non-configurable properties." + - "Revised (bug 1389752): Throw TypeError for duplicate properties."; - -print(BUGNUMBER + ": " + summary); - -/************** - * BEGIN TEST * - **************/ var target = Object.preventExtensions({ a: 1 }); var proxy = new Proxy(target, { ownKeys(t) { return ["a", "a"]; } }); @@ -32,7 +19,3 @@ assert.throws(TypeError, () => Object.getOwnPropertyNames(proxy)); target = Object.freeze({ a: 1 }); proxy = new Proxy(target, { ownKeys(t) { return ["a", "a"]; } }); assert.throws(TypeError, () => Object.getOwnPropertyNames(proxy)); - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Proxy/proxy-__proto__.js b/test/staging/sm/Proxy/proxy-__proto__.js index 464ec7ced8..36dbf0e895 100644 --- a/test/staging/sm/Proxy/proxy-__proto__.js +++ b/test/staging/sm/Proxy/proxy-__proto__.js @@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Behavior of __proto__ on ES6 proxies esid: pending ---*/ -var gTestfile = 'proxy-__proto__.js'; -var BUGNUMBER = 950407; -var summary = "Behavior of __proto__ on ES6 proxies"; - -print(BUGNUMBER + ": " + summary); - -/************** - * BEGIN TEST * - **************/ var protoDesc = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__"); var protoGetter = protoDesc.get; @@ -27,8 +18,6 @@ var protoSetter = protoDesc.set; function testProxy(target, initialProto) { - print("Now testing behavior for new Proxy(" + ("" + target) + ", {})"); - var pobj = new Proxy(target, {}); // Check [[Prototype]] before attempted mutation @@ -58,7 +47,3 @@ testProxy(target, null); var callForCallOnly = function () { }; callForCallOnly.toString = function() { return "callable target"; }; testProxy(callForCallOnly, Function.prototype); - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Proxy/proxy-with-revoked-arguments.js b/test/staging/sm/Proxy/proxy-with-revoked-arguments.js index ad06921959..67ffb08153 100644 --- a/test/staging/sm/Proxy/proxy-with-revoked-arguments.js +++ b/test/staging/sm/Proxy/proxy-with-revoked-arguments.js @@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Proxy constructor should not throw if either the target or handler is a revoked proxy. esid: pending ---*/ -var BUGNUMBER = 1151149; -var summary = "Proxy constructor should not throw if either the target or handler is a revoked proxy."; - -print(BUGNUMBER + ": " + summary); var p = new Proxy({}, {}); @@ -59,4 +55,3 @@ g.eval(`r.revoke();`); new Proxy(p, {}); new Proxy({}, p); - diff --git a/test/staging/sm/Proxy/revocable-proxy-prototype.js b/test/staging/sm/Proxy/revocable-proxy-prototype.js index 94537f44a5..34ba918ff7 100644 --- a/test/staging/sm/Proxy/revocable-proxy-prototype.js +++ b/test/staging/sm/Proxy/revocable-proxy-prototype.js @@ -8,18 +8,10 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Accessing a revocable proxy's [[Prototype]] shouldn't crash esid: pending ---*/ -var gTestfile = 'revocable-proxy-prototype.js'; -var BUGNUMBER = 1052139; -var summary = "Accessing a revocable proxy's [[Prototype]] shouldn't crash"; -print(BUGNUMBER + ": " + summary); - -/************** - * BEGIN TEST * - **************/ function checkFunctionAppliedToRevokedProxy(fun) { var p = Proxy.revocable({}, {}); @@ -39,7 +31,3 @@ function checkFunctionAppliedToRevokedProxy(fun) checkFunctionAppliedToRevokedProxy(proxy => Object.getPrototypeOf(proxy)); checkFunctionAppliedToRevokedProxy(proxy => Object.setPrototypeOf(proxy, null)); - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Proxy/revoke-as-side-effect.js b/test/staging/sm/Proxy/revoke-as-side-effect.js index c88fdd8f0e..4887ee4629 100644 --- a/test/staging/sm/Proxy/revoke-as-side-effect.js +++ b/test/staging/sm/Proxy/revoke-as-side-effect.js @@ -9,10 +9,10 @@ description: | pending esid: pending ---*/ + function createProxy(proxyTarget) { var {proxy, revoke} = Proxy.revocable(proxyTarget, new Proxy({}, { get(target, propertyKey, receiver) { - print("trap get:", propertyKey); revoke(); } })); @@ -78,4 +78,3 @@ assert.sameValue(createProxy(function() { return "ok" })(), "ok"); // |new.target.prototype| to create the |this| for the construct operation, that // would be returned if |return obj;| didn't override it. assert.throws(TypeError, () => new (createProxy(function q(){ return obj; }))); - diff --git a/test/staging/sm/Proxy/setPrototypeOf.js b/test/staging/sm/Proxy/setPrototypeOf.js index aa2356800e..a6458b56ab 100644 --- a/test/staging/sm/Proxy/setPrototypeOf.js +++ b/test/staging/sm/Proxy/setPrototypeOf.js @@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Scripted proxies' [[SetPrototypeOf]] behavior esid: pending ---*/ -var gTestfile = "setPrototypeOf.js"; -var BUGNUMBER = 888969; -var summary = "Scripted proxies' [[SetPrototypeOf]] behavior"; - -print(BUGNUMBER + ": " + summary); - -/************** - * BEGIN TEST * - **************/ const log = []; @@ -246,7 +237,3 @@ assert.throws(TypeError, () => Reflect.setPrototypeOf(p, null)); // 14. Return true. assert.sameValue(Reflect.setPrototypeOf(p, Math), true); - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Proxy/trap-null.js b/test/staging/sm/Proxy/trap-null.js index 5daee692da..97cc1f40ae 100644 --- a/test/staging/sm/Proxy/trap-null.js +++ b/test/staging/sm/Proxy/trap-null.js @@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + null as a trap value on a handler should operate on the target esid: pending ---*/ -var gTestfile = 'trap-null.js'; -var BUGNUMBER = 1257102; -var summary = "null as a trap value on a handler should operate on the target"; - -print(BUGNUMBER + ": " + summary); - -/************** - * BEGIN TEST * - **************/ // This might seem like overkill, but this proxying trick caught typos of // several trap names before this test landed. \o/ /o\ @@ -102,7 +93,3 @@ var res = Reflect.construct(proxy, [" - "]); assert.sameValue(typeof res, "object"); assert.sameValue(res instanceof String, true); assert.sameValue(res.valueOf(), "@@@ - constructing"); - -/******************************************************************************/ - -print("Tests complete");