This commit is contained in:
2022-07-18 02:50:52 +00:00
parent befd344ab0
commit 06181b34d6
8569 changed files with 818704 additions and 352705 deletions
+20
View File
@@ -0,0 +1,20 @@
'use strict';
var implementation = require('../implementation');
var callBind = require('call-bind');
var test = require('tape');
var hasStrictMode = require('has-strict-mode')();
var runTests = require('./tests');
test('as a function', function (t) {
t.test('bad array/this value', { skip: !hasStrictMode }, function (st) {
/* eslint no-useless-call: 0 */
st['throws'](function () { implementation.call(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { implementation.call(null); }, TypeError, 'null is not an object');
st.end();
});
runTests(callBind(implementation, Object), t);
t.end();
});
+2 -1
View File
@@ -1,7 +1,8 @@
'use strict';
require('../auto');
var getDescriptors = require('../');
getDescriptors.shim();
var test = require('tape');
var defineProperties = require('define-properties');
+3 -4
View File
@@ -1,5 +1,7 @@
'use strict';
var mockProperty = require('mock-property');
module.exports = function (getDescriptors, t) {
var enumDescriptor = {
configurable: true,
@@ -28,9 +30,7 @@ module.exports = function (getDescriptors, t) {
writable: true
};
/* eslint-disable no-extend-native, accessor-pairs */
Object.defineProperty(Object.prototype, key, { configurable: true, set: function (v) { throw new Error(v); } });
/* eslint-enable no-extend-native, accessor-pairs */
st.teardown(mockProperty(Object.prototype, key, { set: function (v) { throw new Error(v); } }));
var hasOwnNamesBug = false;
try {
@@ -102,7 +102,6 @@ module.exports = function (getDescriptors, t) {
st.end();
});
/* global Proxy */
var supportsProxy = typeof Proxy === 'function';
t.test('Proxies that return an undefined descriptor', { skip: !supportsProxy }, function (st) {
var obj = { foo: true };