代码拉取完成,页面将自动刷新
'use strict';
var GetIntrinsic = require('../GetIntrinsic');
var $ObjectCreate = GetIntrinsic('%Object.create%', true);
var $TypeError = GetIntrinsic('%TypeError%');
var $SyntaxError = GetIntrinsic('%SyntaxError%');
var Type = require('./Type');
var hasProto = !({ __proto__: null } instanceof Object);
// https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate
module.exports = function ObjectCreate(proto, internalSlotsList) {
if (proto !== null && Type(proto) !== 'Object') {
throw new $TypeError('Assertion failed: `proto` must be null or an object');
}
var slots = arguments.length < 2 ? [] : internalSlotsList;
if (slots.length > 0) {
throw new $SyntaxError('es-abstract does not yet support internal slots');
}
if ($ObjectCreate) {
return $ObjectCreate(proto);
}
if (hasProto) {
return { __proto__: proto };
}
if (proto === null) {
throw new $SyntaxError('native Object.create support is required to create null objects');
}
var T = function T() {};
T.prototype = proto;
return new T();
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。