mirror of
https://github.com/tc39/test262.git
synced 2025-07-12 00:24:38 +02:00
Merge pull request #1978 from tc39/eliminate-some-false-positives
Eliminate some false positives
This commit is contained in:
commit
31e654a339
@ -8,6 +8,8 @@ description: >
|
|||||||
features: [Array.prototype.flat]
|
features: [Array.prototype.flat]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(typeof Array.prototype.flat, 'function');
|
||||||
|
|
||||||
var a = [];
|
var a = [];
|
||||||
a.constructor = null;
|
a.constructor = null;
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
|
@ -7,6 +7,8 @@ description: >
|
|||||||
features: [Array.prototype.flat]
|
features: [Array.prototype.flat]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(typeof Array.prototype.flat, 'function');
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
[].flat.call(null);
|
[].flat.call(null);
|
||||||
}, 'null value');
|
}, 'null value');
|
||||||
|
@ -7,6 +7,8 @@ description: >
|
|||||||
features: [Array.prototype.flat]
|
features: [Array.prototype.flat]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(typeof Array.prototype.flat, 'function');
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
[].flat(Symbol());
|
[].flat(Symbol());
|
||||||
}, 'symbol value');
|
}, 'symbol value');
|
||||||
|
@ -7,6 +7,8 @@ description: >
|
|||||||
features: [Array.prototype.flatMap]
|
features: [Array.prototype.flatMap]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
assert(Array.prototype.flatMap);
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
[].flatMap({});
|
[].flatMap({});
|
||||||
}, 'non callable argument');
|
}, 'non callable argument');
|
||||||
|
@ -8,6 +8,8 @@ description: >
|
|||||||
features: [Array.prototype.flatMap]
|
features: [Array.prototype.flatMap]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(typeof Array.prototype.flatMap, 'function');
|
||||||
|
|
||||||
var a = [];
|
var a = [];
|
||||||
a.constructor = null;
|
a.constructor = null;
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
|
@ -7,6 +7,8 @@ description: >
|
|||||||
features: [Array.prototype.flatMap]
|
features: [Array.prototype.flatMap]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(typeof Array.prototype.flatMap, 'function');
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
[].flatMap.call(null);
|
[].flatMap.call(null);
|
||||||
}, 'null value');
|
}, 'null value');
|
||||||
|
@ -17,10 +17,12 @@ info: |
|
|||||||
b. Let exists be ? HasProperty(source, P).
|
b. Let exists be ? HasProperty(source, P).
|
||||||
c. If exists is true, then
|
c. If exists is true, then
|
||||||
i. Let element be ? Get(source, P).
|
i. Let element be ? Get(source, P).
|
||||||
features: [Array.prototype.flat]
|
features: [Array.prototype.flatMap]
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(typeof Array.prototype.flatMap, 'function');
|
||||||
|
|
||||||
const getCalls = [], hasCalls = [];
|
const getCalls = [], hasCalls = [];
|
||||||
const handler = {
|
const handler = {
|
||||||
get : function (t, p, r) { getCalls.push(p); return Reflect.get(t, p, r); },
|
get : function (t, p, r) { getCalls.push(p); return Reflect.get(t, p, r); },
|
||||||
|
@ -9,7 +9,8 @@ info: |
|
|||||||
2. Let bigint ? ToBigInt(bigint).
|
2. Let bigint ? ToBigInt(bigint).
|
||||||
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
||||||
---*/
|
---*/
|
||||||
|
assert.sameValue(typeof BigInt, 'function');
|
||||||
|
assert.sameValue(typeof BigInt.asIntN, 'function');
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
BigInt.asIntN(0, undefined);
|
BigInt.asIntN(0, undefined);
|
||||||
}, "ToBigInt: undefined => TypeError");
|
}, "ToBigInt: undefined => TypeError");
|
||||||
|
@ -9,7 +9,8 @@ info: |
|
|||||||
2. Let bigint ? ToBigInt(bigint).
|
2. Let bigint ? ToBigInt(bigint).
|
||||||
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
||||||
---*/
|
---*/
|
||||||
|
assert.sameValue(typeof BigInt, 'function');
|
||||||
|
assert.sameValue(typeof BigInt.asIntN, 'function');
|
||||||
function err() {
|
function err() {
|
||||||
throw new Test262Error();
|
throw new Test262Error();
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,8 @@ info: |
|
|||||||
1. Let bits be ? ToIndex(bits).
|
1. Let bits be ? ToIndex(bits).
|
||||||
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
||||||
---*/
|
---*/
|
||||||
|
assert.sameValue(typeof BigInt, 'function');
|
||||||
|
assert.sameValue(typeof BigInt.asIntN, 'function');
|
||||||
|
|
||||||
assert.throws(RangeError, function() {
|
assert.throws(RangeError, function() {
|
||||||
BigInt.asIntN(-1, 0n);
|
BigInt.asIntN(-1, 0n);
|
||||||
|
@ -9,6 +9,8 @@ info: |
|
|||||||
1. Let bits be ? ToIndex(bits).
|
1. Let bits be ? ToIndex(bits).
|
||||||
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
||||||
---*/
|
---*/
|
||||||
|
assert.sameValue(typeof BigInt, 'function');
|
||||||
|
assert.sameValue(typeof BigInt.asIntN, 'function');
|
||||||
|
|
||||||
function err() {
|
function err() {
|
||||||
throw new Test262Error();
|
throw new Test262Error();
|
||||||
|
@ -9,6 +9,8 @@ info: |
|
|||||||
2. Let bigint ? ToBigInt(bigint).
|
2. Let bigint ? ToBigInt(bigint).
|
||||||
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
||||||
---*/
|
---*/
|
||||||
|
assert.sameValue(typeof BigInt, 'function');
|
||||||
|
assert.sameValue(typeof BigInt.asUintN, 'function');
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
BigInt.asUintN(0, undefined);
|
BigInt.asUintN(0, undefined);
|
||||||
|
@ -9,6 +9,8 @@ info: |
|
|||||||
2. Let bigint ? ToBigInt(bigint).
|
2. Let bigint ? ToBigInt(bigint).
|
||||||
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
||||||
---*/
|
---*/
|
||||||
|
assert.sameValue(typeof BigInt, 'function');
|
||||||
|
assert.sameValue(typeof BigInt.asUintN, 'function');
|
||||||
|
|
||||||
function err() {
|
function err() {
|
||||||
throw new Test262Error();
|
throw new Test262Error();
|
||||||
|
@ -9,6 +9,8 @@ info: |
|
|||||||
1. Let bits be ? ToIndex(bits).
|
1. Let bits be ? ToIndex(bits).
|
||||||
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
||||||
---*/
|
---*/
|
||||||
|
assert.sameValue(typeof BigInt, 'function');
|
||||||
|
assert.sameValue(typeof BigInt.asUintN, 'function');
|
||||||
|
|
||||||
assert.throws(RangeError, function() {
|
assert.throws(RangeError, function() {
|
||||||
BigInt.asUintN(-1, 0n);
|
BigInt.asUintN(-1, 0n);
|
||||||
|
@ -9,6 +9,8 @@ info: |
|
|||||||
1. Let bits be ? ToIndex(bits).
|
1. Let bits be ? ToIndex(bits).
|
||||||
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
||||||
---*/
|
---*/
|
||||||
|
assert.sameValue(typeof BigInt, 'function');
|
||||||
|
assert.sameValue(typeof BigInt.asUintN, 'function');
|
||||||
|
|
||||||
function err() {
|
function err() {
|
||||||
throw new Test262Error();
|
throw new Test262Error();
|
||||||
|
@ -9,6 +9,7 @@ info: |
|
|||||||
...
|
...
|
||||||
features: [BigInt]
|
features: [BigInt]
|
||||||
---*/
|
---*/
|
||||||
|
assert.sameValue(typeof BigInt, 'function');
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
new BigInt();
|
new BigInt();
|
||||||
|
@ -15,6 +15,7 @@ info: |
|
|||||||
[[BigIntData]] internal slot.
|
[[BigIntData]] internal slot.
|
||||||
features: [BigInt]
|
features: [BigInt]
|
||||||
---*/
|
---*/
|
||||||
|
assert.sameValue(typeof BigInt, 'function');
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
BigInt.prototype.toString(1);
|
BigInt.prototype.toString(1);
|
||||||
|
@ -21,6 +21,8 @@ features: [BigInt, Symbol, Symbol.toPrimitive]
|
|||||||
|
|
||||||
var toString = BigInt.prototype.toString;
|
var toString = BigInt.prototype.toString;
|
||||||
|
|
||||||
|
assert.sameValue(typeof toString, 'function');
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
toString.call({
|
toString.call({
|
||||||
x: 1n
|
x: 1n
|
||||||
|
@ -20,6 +20,7 @@ features: [BigInt]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
var valueOf = BigInt.prototype.valueOf;
|
var valueOf = BigInt.prototype.valueOf;
|
||||||
|
assert.sameValue(typeof valueOf, 'function');
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
valueOf.call({});
|
valueOf.call({});
|
||||||
|
@ -21,6 +21,8 @@ features: [BigInt, Symbol]
|
|||||||
|
|
||||||
var valueOf = BigInt.prototype.valueOf;
|
var valueOf = BigInt.prototype.valueOf;
|
||||||
|
|
||||||
|
assert.sameValue(typeof valueOf, 'function');
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
valueOf.call(undefined);
|
valueOf.call(undefined);
|
||||||
}, "undefined");
|
}, "undefined");
|
||||||
|
@ -49,6 +49,7 @@ var iterable = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assert.sameValue(typeof Object.fromEntries, 'function');
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
Object.fromEntries(iterable);
|
Object.fromEntries(iterable);
|
||||||
});
|
});
|
||||||
|
@ -49,6 +49,7 @@ var iterable = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assert.sameValue(typeof Object.fromEntries, 'function');
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
Object.fromEntries(iterable);
|
Object.fromEntries(iterable);
|
||||||
});
|
});
|
||||||
|
@ -45,6 +45,7 @@ var iterable = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assert.sameValue(typeof Object.fromEntries, 'function');
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
Object.fromEntries(iterable);
|
Object.fromEntries(iterable);
|
||||||
});
|
});
|
||||||
|
@ -36,6 +36,7 @@ var iterable = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assert.sameValue(typeof Object.fromEntries, 'function');
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
Object.fromEntries(iterable);
|
Object.fromEntries(iterable);
|
||||||
});
|
});
|
||||||
|
@ -14,6 +14,7 @@ info: |
|
|||||||
features: [Object.fromEntries]
|
features: [Object.fromEntries]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(typeof Object.fromEntries, 'function');
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
Object.fromEntries();
|
Object.fromEntries();
|
||||||
});
|
});
|
||||||
|
@ -7,6 +7,7 @@ esid: sec-object.fromentries
|
|||||||
features: [Object.fromEntries]
|
features: [Object.fromEntries]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(typeof Object.fromEntries, 'function');
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
Object.fromEntries(['ab']);
|
Object.fromEntries(['ab']);
|
||||||
});
|
});
|
||||||
|
@ -8,6 +8,8 @@ esid: sec-promise.prototype.finally
|
|||||||
features: [Promise.prototype.finally]
|
features: [Promise.prototype.finally]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(typeof Promise.prototype.finally, 'function');
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
Promise.prototype.finally.call(undefined);
|
Promise.prototype.finally.call(undefined);
|
||||||
}, 'undefined');
|
}, 'undefined');
|
||||||
|
@ -8,6 +8,7 @@ description: >
|
|||||||
esid: sec-promise.prototype.finally
|
esid: sec-promise.prototype.finally
|
||||||
features: [Symbol, Promise.prototype.finally]
|
features: [Symbol, Promise.prototype.finally]
|
||||||
---*/
|
---*/
|
||||||
|
assert.sameValue(typeof Promise.prototype.finally, 'function');
|
||||||
|
|
||||||
var symbol = Symbol();
|
var symbol = Symbol();
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ var thisVal = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assert.sameValue(typeof String.prototype.trimEnd, 'function');
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
String.prototype.trimEnd.call(thisVal);
|
String.prototype.trimEnd.call(thisVal);
|
||||||
});
|
});
|
||||||
|
@ -51,6 +51,7 @@ var thisVal = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assert.sameValue(typeof String.prototype.trimEnd, 'function');
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
String.prototype.trimEnd.call(thisVal);
|
String.prototype.trimEnd.call(thisVal);
|
||||||
});
|
});
|
||||||
|
@ -52,6 +52,7 @@ var thisVal = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assert.sameValue(typeof String.prototype.trimEnd, 'function');
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
String.prototype.trimEnd.call(thisVal);
|
String.prototype.trimEnd.call(thisVal);
|
||||||
});
|
});
|
||||||
|
@ -33,6 +33,7 @@ var thisVal = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assert.sameValue(typeof String.prototype.trimStart, 'function');
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
String.prototype.trimStart.call(thisVal);
|
String.prototype.trimStart.call(thisVal);
|
||||||
});
|
});
|
||||||
|
@ -51,6 +51,7 @@ var thisVal = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assert.sameValue(typeof String.prototype.trimStart, 'function');
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
String.prototype.trimStart.call(thisVal);
|
String.prototype.trimStart.call(thisVal);
|
||||||
});
|
});
|
||||||
|
@ -52,6 +52,7 @@ var thisVal = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assert.sameValue(typeof String.prototype.trimStart, 'function');
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
String.prototype.trimStart.call(thisVal);
|
String.prototype.trimStart.call(thisVal);
|
||||||
});
|
});
|
||||||
|
@ -12,7 +12,7 @@ info: |
|
|||||||
are specific to TypedArray instance objects.
|
are specific to TypedArray instance objects.
|
||||||
features: [BigInt]
|
features: [BigInt]
|
||||||
---*/
|
---*/
|
||||||
|
assert.sameValue(typeof BigInt64Array, 'function');
|
||||||
assert.throws(TypeError, function () {
|
assert.throws(TypeError, function () {
|
||||||
BigInt64Array.prototype.buffer;
|
BigInt64Array.prototype.buffer;
|
||||||
});
|
});
|
||||||
|
@ -12,7 +12,7 @@ info: |
|
|||||||
are specific to TypedArray instance objects.
|
are specific to TypedArray instance objects.
|
||||||
features: [BigInt]
|
features: [BigInt]
|
||||||
---*/
|
---*/
|
||||||
|
assert.sameValue(typeof BigUint64Array, 'function');
|
||||||
assert.throws(TypeError, function () {
|
assert.throws(TypeError, function () {
|
||||||
BigUint64Array.prototype.buffer;
|
BigUint64Array.prototype.buffer;
|
||||||
});
|
});
|
||||||
|
@ -12,6 +12,8 @@ info: |
|
|||||||
features: [Intl.ListFormat]
|
features: [Intl.ListFormat]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(typeof Intl.ListFormat, "function");
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
Intl.ListFormat();
|
Intl.ListFormat();
|
||||||
});
|
});
|
||||||
|
@ -11,4 +11,7 @@ info: |
|
|||||||
features: [Intl.ListFormat]
|
features: [Intl.ListFormat]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.throws(TypeError, function() { new Intl.ListFormat([], null) })
|
assert.sameValue(typeof Intl.ListFormat, "function");
|
||||||
|
assert.throws(TypeError, function() {
|
||||||
|
new Intl.ListFormat([], null);
|
||||||
|
});
|
||||||
|
@ -12,14 +12,16 @@ info: |
|
|||||||
features: [Intl.ListFormat]
|
features: [Intl.ListFormat]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const fn = Intl.ListFormat.prototype.format;
|
const format = Intl.ListFormat.prototype.format;
|
||||||
|
|
||||||
assert.throws(TypeError, () => fn.call(undefined), "undefined");
|
assert.sameValue(typeof format, "function");
|
||||||
assert.throws(TypeError, () => fn.call(null), "null");
|
|
||||||
assert.throws(TypeError, () => fn.call(true), "true");
|
assert.throws(TypeError, () => format.call(undefined), "undefined");
|
||||||
assert.throws(TypeError, () => fn.call(""), "empty string");
|
assert.throws(TypeError, () => format.call(null), "null");
|
||||||
assert.throws(TypeError, () => fn.call(Symbol()), "symbol");
|
assert.throws(TypeError, () => format.call(true), "true");
|
||||||
assert.throws(TypeError, () => fn.call(1), "1");
|
assert.throws(TypeError, () => format.call(""), "empty string");
|
||||||
assert.throws(TypeError, () => fn.call({}), "plain object");
|
assert.throws(TypeError, () => format.call(Symbol()), "symbol");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.ListFormat), "Intl.ListFormat");
|
assert.throws(TypeError, () => format.call(1), "1");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.ListFormat.prototype), "Intl.ListFormat.prototype");
|
assert.throws(TypeError, () => format.call({}), "plain object");
|
||||||
|
assert.throws(TypeError, () => format.call(Intl.ListFormat), "Intl.ListFormat");
|
||||||
|
assert.throws(TypeError, () => format.call(Intl.ListFormat.prototype), "Intl.ListFormat.prototype");
|
||||||
|
@ -12,14 +12,15 @@ info: |
|
|||||||
features: [Intl.ListFormat]
|
features: [Intl.ListFormat]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const fn = Intl.ListFormat.prototype.formatToParts;
|
const formatToParts = Intl.ListFormat.prototype.formatToParts;
|
||||||
|
|
||||||
assert.throws(TypeError, () => fn.call(undefined), "undefined");
|
assert.sameValue(typeof formatToParts, "function");
|
||||||
assert.throws(TypeError, () => fn.call(null), "null");
|
assert.throws(TypeError, () => formatToParts.call(undefined), "undefined");
|
||||||
assert.throws(TypeError, () => fn.call(true), "true");
|
assert.throws(TypeError, () => formatToParts.call(null), "null");
|
||||||
assert.throws(TypeError, () => fn.call(""), "empty string");
|
assert.throws(TypeError, () => formatToParts.call(true), "true");
|
||||||
assert.throws(TypeError, () => fn.call(Symbol()), "symbol");
|
assert.throws(TypeError, () => formatToParts.call(""), "empty string");
|
||||||
assert.throws(TypeError, () => fn.call(1), "1");
|
assert.throws(TypeError, () => formatToParts.call(Symbol()), "symbol");
|
||||||
assert.throws(TypeError, () => fn.call({}), "plain object");
|
assert.throws(TypeError, () => formatToParts.call(1), "1");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.ListFormat), "Intl.ListFormat");
|
assert.throws(TypeError, () => formatToParts.call({}), "plain object");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.ListFormat.prototype), "Intl.ListFormat.prototype");
|
assert.throws(TypeError, () => formatToParts.call(Intl.ListFormat), "Intl.ListFormat");
|
||||||
|
assert.throws(TypeError, () => formatToParts.call(Intl.ListFormat.prototype), "Intl.ListFormat.prototype");
|
||||||
|
@ -12,14 +12,15 @@ info: |
|
|||||||
features: [Intl.ListFormat]
|
features: [Intl.ListFormat]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const fn = Intl.ListFormat.prototype.resolvedOptions;
|
const resolvedOptions = Intl.ListFormat.prototype.resolvedOptions;
|
||||||
|
|
||||||
assert.throws(TypeError, () => fn.call(undefined), "undefined");
|
assert.sameValue(typeof resolvedOptions, "function");
|
||||||
assert.throws(TypeError, () => fn.call(null), "null");
|
assert.throws(TypeError, () => resolvedOptions.call(undefined), "undefined");
|
||||||
assert.throws(TypeError, () => fn.call(true), "true");
|
assert.throws(TypeError, () => resolvedOptions.call(null), "null");
|
||||||
assert.throws(TypeError, () => fn.call(""), "empty string");
|
assert.throws(TypeError, () => resolvedOptions.call(true), "true");
|
||||||
assert.throws(TypeError, () => fn.call(Symbol()), "symbol");
|
assert.throws(TypeError, () => resolvedOptions.call(""), "empty string");
|
||||||
assert.throws(TypeError, () => fn.call(1), "1");
|
assert.throws(TypeError, () => resolvedOptions.call(Symbol()), "symbol");
|
||||||
assert.throws(TypeError, () => fn.call({}), "plain object");
|
assert.throws(TypeError, () => resolvedOptions.call(1), "1");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.ListFormat), "Intl.ListFormat");
|
assert.throws(TypeError, () => resolvedOptions.call({}), "plain object");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.ListFormat.prototype), "Intl.ListFormat.prototype");
|
assert.throws(TypeError, () => resolvedOptions.call(Intl.ListFormat), "Intl.ListFormat");
|
||||||
|
assert.throws(TypeError, () => resolvedOptions.call(Intl.ListFormat.prototype), "Intl.ListFormat.prototype");
|
||||||
|
@ -13,7 +13,10 @@ info: |
|
|||||||
features: [Intl.Locale]
|
features: [Intl.Locale]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const fn = Intl.Locale.prototype.maximize;
|
const maximize = Intl.Locale.prototype.maximize;
|
||||||
|
|
||||||
|
assert.sameValue(typeof maximize, "function");
|
||||||
|
|
||||||
const invalidValues = [
|
const invalidValues = [
|
||||||
undefined,
|
undefined,
|
||||||
null,
|
null,
|
||||||
@ -26,5 +29,5 @@ const invalidValues = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
for (const invalidValue of invalidValues) {
|
for (const invalidValue of invalidValues) {
|
||||||
assert.throws(TypeError, () => fn.call(invalidValue));
|
assert.throws(TypeError, () => maximize.call(invalidValue));
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,10 @@ info: |
|
|||||||
features: [Intl.Locale]
|
features: [Intl.Locale]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const fn = Intl.Locale.prototype.minimize;
|
const minimize = Intl.Locale.prototype.minimize;
|
||||||
|
|
||||||
|
assert.sameValue(typeof minimize, "function");
|
||||||
|
|
||||||
const invalidValues = [
|
const invalidValues = [
|
||||||
undefined,
|
undefined,
|
||||||
null,
|
null,
|
||||||
@ -26,5 +29,5 @@ const invalidValues = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
for (const invalidValue of invalidValues) {
|
for (const invalidValue of invalidValues) {
|
||||||
assert.throws(TypeError, () => fn.call(invalidValue));
|
assert.throws(TypeError, () => minimize.call(invalidValue));
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,10 @@ info: |
|
|||||||
features: [Intl.Locale]
|
features: [Intl.Locale]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const fn = Intl.Locale.prototype.toString;
|
const toString = Intl.Locale.prototype.toString;
|
||||||
|
|
||||||
|
assert.sameValue(typeof toString, "function");
|
||||||
|
|
||||||
const invalidValues = [
|
const invalidValues = [
|
||||||
undefined,
|
undefined,
|
||||||
null,
|
null,
|
||||||
@ -26,5 +29,5 @@ const invalidValues = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
for (const invalidValue of invalidValues) {
|
for (const invalidValue of invalidValues) {
|
||||||
assert.throws(TypeError, () => fn.call(invalidValue));
|
assert.throws(TypeError, () => toString.call(invalidValue));
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,10 @@ info: |
|
|||||||
features: [Intl.RelativeTimeFormat]
|
features: [Intl.RelativeTimeFormat]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const fn = Intl.RelativeTimeFormat.supportedLocalesOf;
|
const supportedLocalesOf = Intl.RelativeTimeFormat.supportedLocalesOf;
|
||||||
|
|
||||||
|
assert.sameValue(typeof supportedLocalesOf, "function");
|
||||||
|
|
||||||
const thisValues = [
|
const thisValues = [
|
||||||
undefined,
|
undefined,
|
||||||
null,
|
null,
|
||||||
@ -24,6 +27,6 @@ const thisValues = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
for (const thisValue of thisValues) {
|
for (const thisValue of thisValues) {
|
||||||
const result = fn.call(thisValue);
|
const result = supportedLocalesOf.call(thisValue);
|
||||||
assert.sameValue(Array.isArray(result), true);
|
assert.sameValue(Array.isArray(result), true);
|
||||||
}
|
}
|
||||||
|
@ -11,14 +11,16 @@ info: |
|
|||||||
features: [Intl.RelativeTimeFormat]
|
features: [Intl.RelativeTimeFormat]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const fn = Intl.RelativeTimeFormat.prototype.format;
|
const format = Intl.RelativeTimeFormat.prototype.format;
|
||||||
|
|
||||||
assert.throws(TypeError, () => fn.call(undefined), "undefined");
|
assert.sameValue(typeof format, "function");
|
||||||
assert.throws(TypeError, () => fn.call(null), "null");
|
|
||||||
assert.throws(TypeError, () => fn.call(true), "true");
|
assert.throws(TypeError, () => format.call(undefined), "undefined");
|
||||||
assert.throws(TypeError, () => fn.call(""), "empty string");
|
assert.throws(TypeError, () => format.call(null), "null");
|
||||||
assert.throws(TypeError, () => fn.call(Symbol()), "symbol");
|
assert.throws(TypeError, () => format.call(true), "true");
|
||||||
assert.throws(TypeError, () => fn.call(1), "1");
|
assert.throws(TypeError, () => format.call(""), "empty string");
|
||||||
assert.throws(TypeError, () => fn.call({}), "plain object");
|
assert.throws(TypeError, () => format.call(Symbol()), "symbol");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat");
|
assert.throws(TypeError, () => format.call(1), "1");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype");
|
assert.throws(TypeError, () => format.call({}), "plain object");
|
||||||
|
assert.throws(TypeError, () => format.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat");
|
||||||
|
assert.throws(TypeError, () => format.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype");
|
||||||
|
@ -11,14 +11,16 @@ info: |
|
|||||||
features: [Intl.RelativeTimeFormat]
|
features: [Intl.RelativeTimeFormat]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const fn = Intl.RelativeTimeFormat.prototype.formatToParts;
|
const formatToParts = Intl.RelativeTimeFormat.prototype.formatToParts;
|
||||||
|
|
||||||
assert.throws(TypeError, () => fn.call(undefined), "undefined");
|
assert.sameValue(typeof formatToParts, "function");
|
||||||
assert.throws(TypeError, () => fn.call(null), "null");
|
|
||||||
assert.throws(TypeError, () => fn.call(true), "true");
|
assert.throws(TypeError, () => formatToParts.call(undefined), "undefined");
|
||||||
assert.throws(TypeError, () => fn.call(""), "empty string");
|
assert.throws(TypeError, () => formatToParts.call(null), "null");
|
||||||
assert.throws(TypeError, () => fn.call(Symbol()), "symbol");
|
assert.throws(TypeError, () => formatToParts.call(true), "true");
|
||||||
assert.throws(TypeError, () => fn.call(1), "1");
|
assert.throws(TypeError, () => formatToParts.call(""), "empty string");
|
||||||
assert.throws(TypeError, () => fn.call({}), "plain object");
|
assert.throws(TypeError, () => formatToParts.call(Symbol()), "symbol");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat");
|
assert.throws(TypeError, () => formatToParts.call(1), "1");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype");
|
assert.throws(TypeError, () => formatToParts.call({}), "plain object");
|
||||||
|
assert.throws(TypeError, () => formatToParts.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat");
|
||||||
|
assert.throws(TypeError, () => formatToParts.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype");
|
||||||
|
@ -11,14 +11,16 @@ info: |
|
|||||||
features: [Intl.RelativeTimeFormat]
|
features: [Intl.RelativeTimeFormat]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const fn = Intl.RelativeTimeFormat.prototype.resolvedOptions;
|
const resolvedOptions = Intl.RelativeTimeFormat.prototype.resolvedOptions;
|
||||||
|
|
||||||
assert.throws(TypeError, () => fn.call(undefined), "undefined");
|
assert.sameValue(typeof resolvedOptions, "function");
|
||||||
assert.throws(TypeError, () => fn.call(null), "null");
|
|
||||||
assert.throws(TypeError, () => fn.call(true), "true");
|
assert.throws(TypeError, () => resolvedOptions.call(undefined), "undefined");
|
||||||
assert.throws(TypeError, () => fn.call(""), "empty string");
|
assert.throws(TypeError, () => resolvedOptions.call(null), "null");
|
||||||
assert.throws(TypeError, () => fn.call(Symbol()), "symbol");
|
assert.throws(TypeError, () => resolvedOptions.call(true), "true");
|
||||||
assert.throws(TypeError, () => fn.call(1), "1");
|
assert.throws(TypeError, () => resolvedOptions.call(""), "empty string");
|
||||||
assert.throws(TypeError, () => fn.call({}), "plain object");
|
assert.throws(TypeError, () => resolvedOptions.call(Symbol()), "symbol");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat");
|
assert.throws(TypeError, () => resolvedOptions.call(1), "1");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype");
|
assert.throws(TypeError, () => resolvedOptions.call({}), "plain object");
|
||||||
|
assert.throws(TypeError, () => resolvedOptions.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat");
|
||||||
|
assert.throws(TypeError, () => resolvedOptions.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype");
|
||||||
|
@ -10,7 +10,10 @@ info: |
|
|||||||
features: [Intl.Segmenter]
|
features: [Intl.Segmenter]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const fn = Intl.Segmenter.supportedLocalesOf;
|
const supportedLocalesOf = Intl.Segmenter.supportedLocalesOf;
|
||||||
|
|
||||||
|
assert.sameValue(typeof supportedLocalesOf, "function");
|
||||||
|
|
||||||
const thisValues = [
|
const thisValues = [
|
||||||
undefined,
|
undefined,
|
||||||
null,
|
null,
|
||||||
@ -24,6 +27,6 @@ const thisValues = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
for (const thisValue of thisValues) {
|
for (const thisValue of thisValues) {
|
||||||
const result = fn.call(thisValue);
|
const result = supportedLocalesOf.call(thisValue);
|
||||||
assert.sameValue(Array.isArray(result), true);
|
assert.sameValue(Array.isArray(result), true);
|
||||||
}
|
}
|
||||||
|
@ -11,14 +11,16 @@ info: |
|
|||||||
features: [Intl.Segmenter]
|
features: [Intl.Segmenter]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const fn = Intl.Segmenter.prototype.resolvedOptions;
|
const resolvedOptions = Intl.Segmenter.prototype.resolvedOptions;
|
||||||
|
|
||||||
assert.throws(TypeError, () => fn.call(undefined), "undefined");
|
assert.sameValue(typeof resolvedOptions, "function");
|
||||||
assert.throws(TypeError, () => fn.call(null), "null");
|
|
||||||
assert.throws(TypeError, () => fn.call(true), "true");
|
assert.throws(TypeError, () => resolvedOptions.call(undefined), "undefined");
|
||||||
assert.throws(TypeError, () => fn.call(""), "empty string");
|
assert.throws(TypeError, () => resolvedOptions.call(null), "null");
|
||||||
assert.throws(TypeError, () => fn.call(Symbol()), "symbol");
|
assert.throws(TypeError, () => resolvedOptions.call(true), "true");
|
||||||
assert.throws(TypeError, () => fn.call(1), "1");
|
assert.throws(TypeError, () => resolvedOptions.call(""), "empty string");
|
||||||
assert.throws(TypeError, () => fn.call({}), "plain object");
|
assert.throws(TypeError, () => resolvedOptions.call(Symbol()), "symbol");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.Segmenter), "Intl.Segmenter");
|
assert.throws(TypeError, () => resolvedOptions.call(1), "1");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.Segmenter.prototype), "Intl.Segmenter.prototype");
|
assert.throws(TypeError, () => resolvedOptions.call({}), "plain object");
|
||||||
|
assert.throws(TypeError, () => resolvedOptions.call(Intl.Segmenter), "Intl.Segmenter");
|
||||||
|
assert.throws(TypeError, () => resolvedOptions.call(Intl.Segmenter.prototype), "Intl.Segmenter.prototype");
|
||||||
|
@ -11,14 +11,16 @@ info: |
|
|||||||
features: [Intl.Segmenter]
|
features: [Intl.Segmenter]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const fn = Intl.Segmenter.prototype.segment;
|
const segment = Intl.Segmenter.prototype.segment;
|
||||||
|
|
||||||
assert.throws(TypeError, () => fn.call(undefined), "undefined");
|
assert.sameValue(typeof segment, "function");
|
||||||
assert.throws(TypeError, () => fn.call(null), "null");
|
|
||||||
assert.throws(TypeError, () => fn.call(true), "true");
|
assert.throws(TypeError, () => segment.call(undefined), "undefined");
|
||||||
assert.throws(TypeError, () => fn.call(""), "empty string");
|
assert.throws(TypeError, () => segment.call(null), "null");
|
||||||
assert.throws(TypeError, () => fn.call(Symbol()), "symbol");
|
assert.throws(TypeError, () => segment.call(true), "true");
|
||||||
assert.throws(TypeError, () => fn.call(1), "1");
|
assert.throws(TypeError, () => segment.call(""), "empty string");
|
||||||
assert.throws(TypeError, () => fn.call({}), "plain object");
|
assert.throws(TypeError, () => segment.call(Symbol()), "symbol");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.Segmenter), "Intl.Segmenter");
|
assert.throws(TypeError, () => segment.call(1), "1");
|
||||||
assert.throws(TypeError, () => fn.call(Intl.Segmenter.prototype), "Intl.Segmenter.prototype");
|
assert.throws(TypeError, () => segment.call({}), "plain object");
|
||||||
|
assert.throws(TypeError, () => segment.call(Intl.Segmenter), "Intl.Segmenter");
|
||||||
|
assert.throws(TypeError, () => segment.call(Intl.Segmenter.prototype), "Intl.Segmenter.prototype");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user