Remove print calls in sm/Proxy

This commit is contained in:
André Bargull 2025-04-30 14:16:04 +02:00 committed by Philip Chimento
parent 744a1b2c75
commit 40272ad39f
10 changed files with 10 additions and 129 deletions

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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);

View File

@ -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");

View File

@ -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; })));

View File

@ -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");

View File

@ -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");