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:
594 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
[79a0317] | 3 | var callBound = require('call-bound');
|
---|
[d565449] | 4 | var SLOT = require('internal-slot');
|
---|
| 5 |
|
---|
| 6 | var $TypeError = require('es-errors/type');
|
---|
| 7 |
|
---|
| 8 | var ClearKeptObjects = require('./ClearKeptObjects');
|
---|
[79a0317] | 9 |
|
---|
| 10 | var isObject = require('../helpers/isObject');
|
---|
[d565449] | 11 |
|
---|
| 12 | var $push = callBound('Array.prototype.push');
|
---|
| 13 |
|
---|
| 14 | // https://262.ecma-international.org/12.0/#sec-addtokeptobjects
|
---|
| 15 |
|
---|
| 16 | module.exports = function AddToKeptObjects(object) {
|
---|
[79a0317] | 17 | if (!isObject(object)) {
|
---|
[d565449] | 18 | throw new $TypeError('Assertion failed: `object` must be an Object');
|
---|
| 19 | }
|
---|
| 20 | $push(SLOT.get(ClearKeptObjects, '[[es-abstract internal: KeptAlive]]'), object);
|
---|
| 21 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.