PIbd-22_Kaznacheeva.E.K_Int.../lab2/node_modules/es-abstract/5/CheckObjectCoercible.js

15 lines
345 B
JavaScript
Raw Normal View History

2023-11-24 14:53:57 +04:00
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
// http://262.ecma-international.org/5.1/#sec-9.10
module.exports = function CheckObjectCoercible(value, optMessage) {
if (value == null) {
throw new $TypeError(optMessage || ('Cannot call method on ' + value));
}
return value;
};