Files
NapCatQQ/.pnpm-store/v3/files/85/c564ef8181ce2250279da1a181afefd24587d141b5dec162f8e157db99e552843fcce5ca25015a5d6723006935bbcb368d6424d0a186755e27004a2d504e79
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

39 lines
1.2 KiB
Plaintext

'use strict';
require('../auto');
var test = require('tape');
var defineProperties = require('define-properties');
var callBind = require('call-bind');
var hasStrictMode = require('has-strict-mode')();
var functionsHaveNames = require('functions-have-names')();
var isEnumerable = Object.prototype.propertyIsEnumerable;
var runTests = require('./tests');
test('shimmed', function (t) {
var fn = Array.prototype.toSorted;
t.equal(fn.length, 1, 'Array#toSorted has a length of 1');
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(fn.name, 'toSorted', 'Array#toSorted has name "toSorted"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Array.prototype, 'toSorted'), 'Array#toSorted is not enumerable');
et.end();
});
t.test('bad array/this value', { skip: !hasStrictMode }, function (st) {
/* eslint no-useless-call: 0 */
st['throws'](function () { return fn.call(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { return fn.call(null); }, TypeError, 'null is not an object');
st.end();
});
runTests(callBind(fn), t);
t.end();
});