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:
593 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var callBound = require('call-bind/callBound');
|
---|
4 | var SLOT = require('internal-slot');
|
---|
5 |
|
---|
6 | var $TypeError = require('es-errors/type');
|
---|
7 |
|
---|
8 | var ClearKeptObjects = require('./ClearKeptObjects');
|
---|
9 | var Type = require('./Type');
|
---|
10 |
|
---|
11 | var $push = callBound('Array.prototype.push');
|
---|
12 |
|
---|
13 | // https://262.ecma-international.org/12.0/#sec-addtokeptobjects
|
---|
14 |
|
---|
15 | module.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.