source: imaps-frontend/node_modules/es-abstract/2023/InstallErrorCause.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 658 bytes
Line 
1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var CreateNonEnumerableDataPropertyOrThrow = require('./CreateNonEnumerableDataPropertyOrThrow');
6var Get = require('./Get');
7var HasProperty = require('./HasProperty');
8var Type = require('./Type');
9
10// https://262.ecma-international.org/13.0/#sec-installerrorcause
11
12module.exports = function InstallErrorCause(O, options) {
13 if (Type(O) !== 'Object') {
14 throw new $TypeError('Assertion failed: Type(O) is not Object');
15 }
16
17 if (Type(options) === 'Object' && HasProperty(options, 'cause')) {
18 var cause = Get(options, 'cause');
19 CreateNonEnumerableDataPropertyOrThrow(O, 'cause', cause);
20 }
21};
Note: See TracBrowser for help on using the repository browser.