Task: Implement a minimal Temporal.PlainTime polyfill in the /app/ folder
What to build
Create a small Temporal API shim that exposes a global Temporal object with a PlainTime constructor.
Ensure the behavior matches the tests described below.
Requirements
Global API
Define a global Temporal object (accessible as globalThis.Temporal) with a PlainTime property.
PlainTime constructor
Implement a constructor function/class: new Temporal.PlainTime(hour)
It should store the provided hour value (e.g., 12) for later retrieval.
hour property (getter) on PlainTime.prototype
Implement a getter for hour on the prototype:
When called on a valid PlainTime instance, it returns the stored hour value.
When accessed with an invalid receiver (e.g., via Reflect.get(Temporal.PlainTime.prototype, "hour", "foo")), the getter should throw a TypeError with the exact message: "Not a Temporal.PlainTime".
The getter must validate the receiver using a check like: if (!(this instanceof Temporal.PlainTime)) { throw new TypeError("Not a Temporal.PlainTime"); }
Compatibility/export
The module should export a compatible object (e.g., module.exports = { Temporal }) so it can be required if needed, while also ensuring the global Temporal is set for test expectations.
Self-contained
All logic should reside in /app/, with no external dependencies.
Notes for validation
The tests will do:
const plainTime = new Temporal.PlainTime(12); expect(plainTime.hour).toBe(12);
Reflect.get(Temporal.PlainTime.prototype, "hour", "foo") shouldThrowWithMessage(TypeError, "Not a Temporal.PlainTime").
Deliverable
A single JavaScript file (e.g., /app/index.js) that implements the above and initializes the global Temporal.PlainTime as described.