source: imaps-frontend/node_modules/es-abstract/2021/AddToKeptObjects.js@ d565449

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

Update repo after prototype presentation

  • Property mode set to 100644
File size: 593 bytes
Line 
1'use strict';
2
3var callBound = require('call-bind/callBound');
4var SLOT = require('internal-slot');
5
6var $TypeError = require('es-errors/type');
7
8var ClearKeptObjects = require('./ClearKeptObjects');
9var Type = require('./Type');
10
11var $push = callBound('Array.prototype.push');
12
13// https://262.ecma-international.org/12.0/#sec-addtokeptobjects
14
15module.exports = function AddToKeptObjects(object) {
16 if (Type(object) !== 'Object') {
17 throw new $TypeError('Assertion failed: `object` must be an Object');
18 }
19 $push(SLOT.get(ClearKeptObjects, '[[es-abstract internal: KeptAlive]]'), object);
20};
Note: See TracBrowser for help on using the repository browser.