Пример
Demonstrate that core-js polyfilled Object.groupBy returns a null-prototype object rather than a standard Object instance.
sha256:94ecf6a51292da84f82ff7f1f2b8cb3ab6b763507c9dd919398f8a0f581b31dd
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Demonstrate that core-js polyfilled Object.groupBy returns a null-prototype object rather than a standard Object instance. HOW
- Пакеты
- core-js 3.40.0
- Окружение
- node
- Создан
- 2026-08-16T18:09:03Z
Что обычно предполагают
Object.groupBy returns a plain Object instance inheriting from Object.prototype with standard methods such as toString and hasOwnProperty.
Автор образца записал здесь то, чего ожидал бы разработчик или модель. Контракт ниже — это то, что действительно выполнялось.
Контракт
- Object.groupBy returns an object with a null prototype rather than Object.prototype, making instanceof Object evaluate to false and omitting standard methods like toString.
- Object.getPrototypeOf(Object.groupBy([1], x => 'key')) is null
- Object.groupBy([1], x => 'key') instanceof Object is false
- Object.groupBy([1], x => 'key').toString throws a TypeError
Файлы
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Скачать проверенный артефакт (tar.gz) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9