Sha256: 0e9404db2c868e18c5895340e06e66f4fd8505fc466f21dc533c025f57cfcddb

Contents?: true

Size: 827 Bytes

Versions: 112

Compression:

Stored size: 827 Bytes

Contents

'use strict';

var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');

var GetPrototypeFromConstructor = require('./GetPrototypeFromConstructor');
var IsArray = require('./IsArray');
var OrdinaryObjectCreate = require('./OrdinaryObjectCreate');

// https://262.ecma-international.org/6.0/#sec-ordinarycreatefromconstructor

module.exports = function OrdinaryCreateFromConstructor(constructor, intrinsicDefaultProto) {
	GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic
	var proto = GetPrototypeFromConstructor(constructor, intrinsicDefaultProto);
	var slots = arguments.length < 3 ? [] : arguments[2];
	if (!IsArray(slots)) {
		throw new $TypeError('Assertion failed: if provided, `internalSlotsList` must be a List');
	}
	return OrdinaryObjectCreate(proto, slots);
};

Version data entries

112 entries across 30 versions & 4 rubygems

Version Path
immosquare-cleaner-0.1.32 node_modules/es-abstract/2022/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2023/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2021/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2020/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2022/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2020/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2023/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2021/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.30 node_modules/es-abstract/2021/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.30 node_modules/es-abstract/2022/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.30 node_modules/es-abstract/2020/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.30 node_modules/es-abstract/2023/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.29 node_modules/es-abstract/2022/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.29 node_modules/es-abstract/2020/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.29 node_modules/es-abstract/2021/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.29 node_modules/es-abstract/2023/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.28 node_modules/es-abstract/2020/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.28 node_modules/es-abstract/2021/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.28 node_modules/es-abstract/2022/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.28 node_modules/es-abstract/2023/OrdinaryCreateFromConstructor.js