You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CheckObjectCoercible.js 356B

1234567891011121314
  1. 'use strict';
  2. var GetIntrinsic = require('../GetIntrinsic');
  3. var $TypeError = GetIntrinsic('%TypeError%');
  4. // http://www.ecma-international.org/ecma-262/5.1/#sec-9.10
  5. module.exports = function CheckObjectCoercible(value, optMessage) {
  6. if (value == null) {
  7. throw new $TypeError(optMessage || ('Cannot call method on ' + value));
  8. }
  9. return value;
  10. };