main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
659 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var $TypeError = require('es-errors/type');
|
---|
| 4 |
|
---|
| 5 | var CreateNonEnumerableDataPropertyOrThrow = require('./CreateNonEnumerableDataPropertyOrThrow');
|
---|
| 6 | var Get = require('./Get');
|
---|
| 7 | var HasProperty = require('./HasProperty');
|
---|
[79a0317] | 8 |
|
---|
| 9 | var isObject = require('../helpers/isObject');
|
---|
[d565449] | 10 |
|
---|
| 11 | // https://262.ecma-international.org/13.0/#sec-installerrorcause
|
---|
| 12 |
|
---|
| 13 | module.exports = function InstallErrorCause(O, options) {
|
---|
[79a0317] | 14 | if (!isObject(O)) {
|
---|
[d565449] | 15 | throw new $TypeError('Assertion failed: Type(O) is not Object');
|
---|
| 16 | }
|
---|
| 17 |
|
---|
[79a0317] | 18 | if (isObject(options) && HasProperty(options, 'cause')) {
|
---|
[d565449] | 19 | var cause = Get(options, 'cause');
|
---|
| 20 | CreateNonEnumerableDataPropertyOrThrow(O, 'cause', cause);
|
---|
| 21 | }
|
---|
| 22 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.