1d10bf00024b02c0a0c9ee51b9dcf37be0ef49a79311add690a72f8bde2c31268f0a5c308749280b524a014ece5f66e31333cf0fdf13b5ca72489899c720b4 594 B

123456789101112131415161718192021
  1. 'use strict';
  2. var callBound = require('call-bound');
  3. var SLOT = require('internal-slot');
  4. var $TypeError = require('es-errors/type');
  5. var ClearKeptObjects = require('./ClearKeptObjects');
  6. var isObject = require('../helpers/isObject');
  7. var $push = callBound('Array.prototype.push');
  8. // https://262.ecma-international.org/12.0/#sec-addtokeptobjects
  9. module.exports = function AddToKeptObjects(object) {
  10. if (!isObject(object)) {
  11. throw new $TypeError('Assertion failed: `object` must be an Object');
  12. }
  13. $push(SLOT.get(ClearKeptObjects, '[[es-abstract internal: KeptAlive]]'), object);
  14. };