mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
05df701e70
Use the --unhandled-rejections=none CLI flag instead. PR-URL: https://github.com/nodejs/node/pull/38210 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
29 lines
609 B
JavaScript
29 lines
609 B
JavaScript
// Flags: --unhandled-rejections=none
|
|
'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
|
|
});
|
|
|
|
process.on('warning', common.mustNotCall());
|
|
|
|
// Ensure this doesn't crash
|
|
Promise.reject(thorny);
|