mirror of
https://github.com/tc39/test262.git
synced 2025-10-18 22:33:56 +02:00
Remove print calls in sm/Proxy
This commit is contained in:
parent
744a1b2c75
commit
40272ad39f
@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Scripted proxies' [[GetPrototypeOf]] behavior
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var gTestfile = "getPrototypeOf.js";
|
|
||||||
var BUGNUMBER = 888969;
|
|
||||||
var summary = "Scripted proxies' [[GetPrototypeOf]] behavior";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
const log = [];
|
const log = [];
|
||||||
|
|
||||||
@ -272,7 +263,3 @@ p = new Proxy(Object.preventExtensions(new Number(55)),
|
|||||||
{ getPrototypeOf() { return Number.prototype; } });
|
{ getPrototypeOf() { return Number.prototype; } });
|
||||||
|
|
||||||
assert.sameValue(Object.getPrototypeOf(p), Number.prototype);
|
assert.sameValue(Object.getPrototypeOf(p), Number.prototype);
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -8,21 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
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
|
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 arr = [];
|
||||||
var { proxy, revoke } = Proxy.revocable(arr, {
|
var { proxy, revoke } = Proxy.revocable(arr, {
|
||||||
@ -40,7 +28,3 @@ var { proxy, revoke } = Proxy.revocable(arr, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
assert.sameValue(JSON.stringify({a: 0}, proxy), "{}");
|
assert.sameValue(JSON.stringify({a: 0}, proxy), "{}");
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Scripted proxies' [[OwnPropertyKeys]] should have linear complexity
|
||||||
esid: pending
|
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.
|
// 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
|
// 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.
|
// The test passes if it doesn't time out.
|
||||||
assert.sameValue(Object.getOwnPropertyNames(p).length, HALF_COUNT * 2);
|
assert.sameValue(Object.getOwnPropertyNames(p).length, HALF_COUNT * 2);
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -8,22 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
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
|
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 target = Object.preventExtensions({ a: 1 });
|
||||||
var proxy = new Proxy(target, { ownKeys(t) { return ["a", "a"]; } });
|
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 });
|
target = Object.freeze({ a: 1 });
|
||||||
proxy = new Proxy(target, { ownKeys(t) { return ["a", "a"]; } });
|
proxy = new Proxy(target, { ownKeys(t) { return ["a", "a"]; } });
|
||||||
assert.throws(TypeError, () => Object.getOwnPropertyNames(proxy));
|
assert.throws(TypeError, () => Object.getOwnPropertyNames(proxy));
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Behavior of __proto__ on ES6 proxies
|
||||||
esid: pending
|
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 protoDesc = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__");
|
||||||
var protoGetter = protoDesc.get;
|
var protoGetter = protoDesc.get;
|
||||||
@ -27,8 +18,6 @@ var protoSetter = protoDesc.set;
|
|||||||
|
|
||||||
function testProxy(target, initialProto)
|
function testProxy(target, initialProto)
|
||||||
{
|
{
|
||||||
print("Now testing behavior for new Proxy(" + ("" + target) + ", {})");
|
|
||||||
|
|
||||||
var pobj = new Proxy(target, {});
|
var pobj = new Proxy(target, {});
|
||||||
|
|
||||||
// Check [[Prototype]] before attempted mutation
|
// Check [[Prototype]] before attempted mutation
|
||||||
@ -58,7 +47,3 @@ testProxy(target, null);
|
|||||||
var callForCallOnly = function () { };
|
var callForCallOnly = function () { };
|
||||||
callForCallOnly.toString = function() { return "callable target"; };
|
callForCallOnly.toString = function() { return "callable target"; };
|
||||||
testProxy(callForCallOnly, Function.prototype);
|
testProxy(callForCallOnly, Function.prototype);
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Proxy constructor should not throw if either the target or handler is a revoked proxy.
|
||||||
esid: pending
|
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({}, {});
|
var p = new Proxy({}, {});
|
||||||
|
|
||||||
@ -59,4 +55,3 @@ g.eval(`r.revoke();`);
|
|||||||
|
|
||||||
new Proxy(p, {});
|
new Proxy(p, {});
|
||||||
new Proxy({}, p);
|
new Proxy({}, p);
|
||||||
|
|
||||||
|
@ -8,18 +8,10 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Accessing a revocable proxy's [[Prototype]] shouldn't crash
|
||||||
esid: pending
|
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)
|
function checkFunctionAppliedToRevokedProxy(fun)
|
||||||
{
|
{
|
||||||
var p = Proxy.revocable({}, {});
|
var p = Proxy.revocable({}, {});
|
||||||
@ -39,7 +31,3 @@ function checkFunctionAppliedToRevokedProxy(fun)
|
|||||||
|
|
||||||
checkFunctionAppliedToRevokedProxy(proxy => Object.getPrototypeOf(proxy));
|
checkFunctionAppliedToRevokedProxy(proxy => Object.getPrototypeOf(proxy));
|
||||||
checkFunctionAppliedToRevokedProxy(proxy => Object.setPrototypeOf(proxy, null));
|
checkFunctionAppliedToRevokedProxy(proxy => Object.setPrototypeOf(proxy, null));
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -9,10 +9,10 @@ description: |
|
|||||||
pending
|
pending
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function createProxy(proxyTarget) {
|
function createProxy(proxyTarget) {
|
||||||
var {proxy, revoke} = Proxy.revocable(proxyTarget, new Proxy({}, {
|
var {proxy, revoke} = Proxy.revocable(proxyTarget, new Proxy({}, {
|
||||||
get(target, propertyKey, receiver) {
|
get(target, propertyKey, receiver) {
|
||||||
print("trap get:", propertyKey);
|
|
||||||
revoke();
|
revoke();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@ -78,4 +78,3 @@ assert.sameValue(createProxy(function() { return "ok" })(), "ok");
|
|||||||
// |new.target.prototype| to create the |this| for the construct operation, that
|
// |new.target.prototype| to create the |this| for the construct operation, that
|
||||||
// would be returned if |return obj;| didn't override it.
|
// would be returned if |return obj;| didn't override it.
|
||||||
assert.throws(TypeError, () => new (createProxy(function q(){ return obj; })));
|
assert.throws(TypeError, () => new (createProxy(function q(){ return obj; })));
|
||||||
|
|
||||||
|
@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Scripted proxies' [[SetPrototypeOf]] behavior
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var gTestfile = "setPrototypeOf.js";
|
|
||||||
var BUGNUMBER = 888969;
|
|
||||||
var summary = "Scripted proxies' [[SetPrototypeOf]] behavior";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
const log = [];
|
const log = [];
|
||||||
|
|
||||||
@ -246,7 +237,3 @@ assert.throws(TypeError, () => Reflect.setPrototypeOf(p, null));
|
|||||||
// 14. Return true.
|
// 14. Return true.
|
||||||
|
|
||||||
assert.sameValue(Reflect.setPrototypeOf(p, Math), true);
|
assert.sameValue(Reflect.setPrototypeOf(p, Math), true);
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
null as a trap value on a handler should operate on the target
|
||||||
esid: pending
|
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
|
// This might seem like overkill, but this proxying trick caught typos of
|
||||||
// several trap names before this test landed. \o/ /o\
|
// 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(typeof res, "object");
|
||||||
assert.sameValue(res instanceof String, true);
|
assert.sameValue(res instanceof String, true);
|
||||||
assert.sameValue(res.valueOf(), "@@@ - constructing");
|
assert.sameValue(res.valueOf(), "@@@ - constructing");
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user