@@ -8970,100 +8970,6 @@ var es2020 = function ES2020(ES, ops, expectedMissing, skips) {
8970
8970
t.end();
8971
8971
});
8972
8972
8973
- test('CopyDataProperties', function (t) {
8974
- t.test('first argument: target', function (st) {
8975
- forEach(v.primitives, function (primitive) {
8976
- st['throws'](
8977
- function () { ES.CopyDataProperties(primitive, {}, []); },
8978
- TypeError,
8979
- debug(primitive) + ' is not an Object'
8980
- );
8981
- });
8982
- st.end();
8983
- });
8984
-
8985
- t.test('second argument: source', function (st) {
8986
- var frozenTarget = Object.freeze ? Object.freeze({}) : {};
8987
- forEach(v.nullPrimitives, function (nullish) {
8988
- st.equal(
8989
- ES.CopyDataProperties(frozenTarget, nullish, []),
8990
- frozenTarget,
8991
- debug(nullish) + ' "source" yields identical, unmodified target'
8992
- );
8993
- });
8994
-
8995
- forEach(v.nonNullPrimitives, function (objectCoercible) {
8996
- var target = {};
8997
- var result = ES.CopyDataProperties(target, objectCoercible, []);
8998
- st.equal(result, target, 'result === target');
8999
- st.deepEqual(keys(result), keys(Object(objectCoercible)), 'target ends up with keys of ' + debug(objectCoercible));
9000
- });
9001
-
9002
- st.test('enumerable accessor property', { skip: !$defineProperty }, function (s2t) {
9003
- var target = {};
9004
- var source = {};
9005
- defineProperty(source, 'a', {
9006
- enumerable: true,
9007
- get: function () { return 42; }
9008
- });
9009
- var result = ES.CopyDataProperties(target, source, []);
9010
- s2t.equal(result, target, 'result === target');
9011
- s2t.deepEqual(result, { a: 42 }, 'target ends up with enumerable accessor of source');
9012
- s2t.end();
9013
- });
9014
-
9015
- st.end();
9016
- });
9017
-
9018
- t.test('third argument: excludedItems', function (st) {
9019
- forEach(v.objects.concat(v.primitives), function (nonArray) {
9020
- st['throws'](
9021
- function () { ES.CopyDataProperties({}, {}, nonArray); },
9022
- TypeError,
9023
- debug(nonArray) + ' is not an Array'
9024
- );
9025
- });
9026
-
9027
- forEach(v.nonPropertyKeys, function (nonPropertyKey) {
9028
- st['throws'](
9029
- function () { ES.CopyDataProperties({}, {}, [nonPropertyKey]); },
9030
- TypeError,
9031
- debug(nonPropertyKey) + ' is not a Property Key'
9032
- );
9033
- });
9034
-
9035
- var result = ES.CopyDataProperties({}, { a: 1, b: 2, c: 3 }, ['b']);
9036
- st.deepEqual(keys(result).sort(), ['a', 'c'].sort(), 'excluded string keys are excluded');
9037
-
9038
- st.test('excluding symbols', { skip: !v.hasSymbols }, function (s2t) {
9039
- var source = {};
9040
- forEach(v.symbols, function (symbol) {
9041
- source[symbol] = true;
9042
- });
9043
-
9044
- var includedSymbols = v.symbols.slice(1);
9045
- var excludedSymbols = v.symbols.slice(0, 1);
9046
- var target = ES.CopyDataProperties({}, source, excludedSymbols);
9047
-
9048
- forEach(includedSymbols, function (symbol) {
9049
- s2t.equal(hasOwn(target, symbol), true, debug(symbol) + ' is included');
9050
- });
9051
-
9052
- forEach(excludedSymbols, function (symbol) {
9053
- s2t.equal(hasOwn(target, symbol), false, debug(symbol) + ' is excluded');
9054
- });
9055
-
9056
- s2t.end();
9057
- });
9058
-
9059
- st.end();
9060
- });
9061
-
9062
- // TODO: CopyDataProperties throws when copying fails
9063
-
9064
- t.end();
9065
- });
9066
-
9067
8973
test('CreateListFromArrayLike', { skip: !hasBigInts }, function (t) {
9068
8974
t.deepEqual(
9069
8975
ES.CreateListFromArrayLike({ length: 2, 0: BigInt(1), 1: 'b', 2: 'c' }),
0 commit comments