Sha256: 9f0d4329e36c0f0fa2805c3b0a0975fb84680bdbe28d8382f8664e17250f02bc

Contents?: true

Size: 803 Bytes

Versions: 135

Compression:

Stored size: 803 Bytes

Contents

'use strict';

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

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

// 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 ObjectCreate(proto, slots);
};

Version data entries

135 entries across 27 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.11 node_modules/es-abstract/2015/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.11 node_modules/es-abstract/2018/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.11 node_modules/es-abstract/2019/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.11 node_modules/es-abstract/2017/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.11 node_modules/es-abstract/2016/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.10 node_modules/es-abstract/2018/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.10 node_modules/es-abstract/2019/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.10 node_modules/es-abstract/2017/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.10 node_modules/es-abstract/2016/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.10 node_modules/es-abstract/2015/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.9 node_modules/es-abstract/2016/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.9 node_modules/es-abstract/2019/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.9 node_modules/es-abstract/2015/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.9 node_modules/es-abstract/2018/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.9 node_modules/es-abstract/2017/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.8 node_modules/es-abstract/2015/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.8 node_modules/es-abstract/2016/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.8 node_modules/es-abstract/2017/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.8 node_modules/es-abstract/2018/OrdinaryCreateFromConstructor.js
immosquare-cleaner-0.1.8 node_modules/es-abstract/2019/OrdinaryCreateFromConstructor.js