Files
ai-course/node_modules/es-abstract/2019/ObjectCreate.js
KQL ce6aa207e9 fix: 修复图片路径以适配GitHub Pages base path
- 将所有图片路径从绝对路径改为使用 process.env.PUBLIC_URL
- 修复 HomePage.tsx 中所有图片引用
- 修复 CoursePage.tsx 中所有图片引用
- 确保图片在 GitHub Pages 上正确加载

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 09:24:45 +08:00

51 lines
1.3 KiB
JavaScript

'use strict';
var GetIntrinsic = require('get-intrinsic');
var $ObjectCreate = GetIntrinsic('%Object.create%', true);
var $TypeError = require('es-errors/type');
var $SyntaxError = require('es-errors/syntax');
var isObject = require('es-object-atoms/isObject');
var IsArray = require('./IsArray');
var forEach = require('../helpers/forEach');
var SLOT = require('internal-slot');
var hasProto = require('has-proto')();
// https://262.ecma-international.org/6.0/#sec-objectcreate
module.exports = function ObjectCreate(proto, internalSlotsList) {
if (proto !== null && !isObject(proto)) {
throw new $TypeError('Assertion failed: `proto` must be null or an object');
}
var slots = arguments.length < 2 ? [] : internalSlotsList; // step 1
if (arguments.length >= 2 && !IsArray(slots)) {
throw new $TypeError('Assertion failed: `internalSlotsList` must be an Array');
}
var O;
if (hasProto) {
O = { __proto__: proto };
} else if ($ObjectCreate) {
O = $ObjectCreate(proto);
} else {
if (proto === null) {
throw new $SyntaxError('native Object.create support is required to create null objects');
}
var T = function T() {};
T.prototype = proto;
O = new T();
}
if (slots.length > 0) {
forEach(slots, function (slot) {
SLOT.set(O, slot, void undefined);
});
}
return O; // step 6
};