サンプル
luxon 3.6.1: Luxon 3.6.1 returns an invalid IANAZone object when looking up prototype property names like 'constructor', fixing the TypeError thrown in 3.6.0.
検証済みサンプル — npm luxon 3.6.1: Luxon 3.6.1 returns an invalid IANAZone object when looking up prototype property names like 'constructor', fixing the TypeError…
sha256:330359b7abe15220a3437e9368f82e892b03f266fd5ab347c83565d63b1f5d61
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 2
- ビルドした署名鍵
- 2
宣言された環境
node linux x64 node node npm
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1 |
2026-08-17 |
| node 22 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1 |
2026-08-18 |
ケース
HOW- ゴール
- Luxon 3.6.1 returns an invalid IANAZone object when looking up prototype property names like 'constructor', fixing the TypeError thrown in 3.6.0.
- パッケージ
- シンボル
-
- luxon.IANAZone.create
- luxon.DateTime.setZone
- 環境
- node
- 作成日
- 2026-08-17T01:57:26Z
コントラクト
- IANAZone.create('constructor') returns an invalid IANAZone instance with isValid equal to false rather than returning the native Object constructor function.
- DateTime.now().setZone('constructor') returns an invalid DateTime object with isValid equal to false without throwing a TypeError.
ファイル
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
ソース
search_known_solution returned sample sha256:6c12ec9c508cd79b6da35f22471840c1ca3aebeecdcc564bbcdd7f28bc67edbc ("Prevent Luxon ESM imports from breaking after a patch release"), which covers Luxon 3.7.1 vs 3.7.2 ESM packaging exports.
In Luxon 3.6.0, IANAZone.create('constructor') evaluates cache['constructor'] on an internal object map that inherits Object.prototype.constructor, returning the native Object constructor function instead of an invalid IANAZone instance. Calling DateTime#setZone('constructor') on 3.6.0 subsequently throws TypeError: zone.equals is not a function when trying to call .equals() on the Object constructor. In Luxon 3.6.1, timezone object caches safely handle prototype property keys, returning an invalid IANAZone object with isValid equal to false and allowing DateTime#setZone('constructor') to return an invalid DateTime without throwing.
{"case":{"believed":"Looking up an invalid IANA timezone string such as 'constructor' in Luxon returns an invalid IANAZone object rather than the native Object constructor function.","caseId":"case:sha256:ce28d9cdfd31ad9ef3308d8216c9e2737170436456a8fff870f54a0431c98f5e","contract":["IANAZone.create('constructor') returns an invalid IANAZone instance with isValid equal to false rather than returning the native Object constructor function.","DateTime.now().setZone('constructor') returns an invalid DateTime object with isValid equal to false without throwing a TypeError."],"goal":"Luxon 3.6.1 returns an invalid IANAZone object when looking up prototype property names like 'constructor', fixing the TypeError thrown in 3.6.0.","kind":"HOW","packages":["pkg:npm/luxon@3.6.1"],"schemaVersion":1,"symbols":["luxon.IANAZone.create","luxon.DateTime.setZone"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","ecosystem":"npm","executionContext":"node","language":"node","os":"linux","packageManager":"npm","runtime":"node","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/luxon@3.6.1"],"schemaVersion":1,"symbols":["luxon.IANAZone.create","luxon.DateTime.setZone"],"verifierAdapter":"node-typescript@1"}
{
"name": "luxon-sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "luxon-sample",
"version": "1.0.0",
"dependencies": {
"luxon": "3.6.1"
}
},
"node_modules/luxon": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.6.1.tgz",
"integrity": "sha512-tJLxrKJhO2ukZ5z0gyjY1zPh3Rh88Ej9P7jNrZiHMUXHae1yvI2imgOZtL1TO8TW6biMMKfTtAOoEJANgtWBMQ==",
"license": "MIT",
"engines": {
"node": ">=12"
}
}
}
}
{
"name": "luxon-sample",
"version": "1.0.0",
"type": "module",
"dependencies": {
"luxon": "3.6.1"
}
}
import assert from "node:assert/strict";
import { IANAZone, DateTime } from "luxon";
const zone = IANAZone.create("constructor");
// Assert IANAZone.create('constructor') returns an invalid IANAZone instance, not Object constructor function
assert.equal(typeof zone, "object");
assert.notEqual(zone, Object);
assert.equal(zone instanceof IANAZone, true);
assert.equal(zone.isValid, false);
assert.equal(zone.type, "iana");
// Assert DateTime#setZone('constructor') yields an invalid DateTime object instead of throwing TypeError
const dt = DateTime.now().setZone("constructor");
assert.equal(dt.isValid, false);
assert.equal(dt.invalidReason, "unsupported zone");