2021-04-12 16:04:44 +02:00
|
|
|
// Flags: --unhandled-rejections=none
|
2017-06-19 16:19:55 +08:00
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
|
|
|
|
function throwErr() {
|
|
|
|
throw new Error('Error from proxy');
|
|
|
|
}
|
|
|
|
|
|
|
|
const thorny = new Proxy({}, {
|
|
|
|
getPrototypeOf: throwErr,
|
|
|
|
setPrototypeOf: throwErr,
|
|
|
|
isExtensible: throwErr,
|
|
|
|
preventExtensions: throwErr,
|
|
|
|
getOwnPropertyDescriptor: throwErr,
|
|
|
|
defineProperty: throwErr,
|
|
|
|
has: throwErr,
|
|
|
|
get: throwErr,
|
|
|
|
set: throwErr,
|
|
|
|
deleteProperty: throwErr,
|
|
|
|
ownKeys: throwErr,
|
|
|
|
apply: throwErr,
|
|
|
|
construct: throwErr
|
|
|
|
});
|
|
|
|
|
2020-04-23 00:17:18 -07:00
|
|
|
process.on('warning', common.mustNotCall());
|
2017-06-19 16:19:55 +08:00
|
|
|
|
2019-03-22 03:44:26 +01:00
|
|
|
// Ensure this doesn't crash
|
2017-06-19 16:19:55 +08:00
|
|
|
Promise.reject(thorny);
|