Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d0744c6

Browse filesBrowse files
Renegade334aduh95
authored andcommitted
lib: add Temporal to frozen intrinsics
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk> PR-URL: #63029 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Jordan Harband <ljharb@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent c73aba0 commit d0744c6
Copy full SHA for d0744c6

1 file changed

+15Lines changed: 15 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/freeze_intrinsics.js‎

Copy file name to clipboardExpand all lines: lib/internal/freeze_intrinsics.js
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ const {
132132
const {
133133
Intl,
134134
SharedArrayBuffer,
135+
Temporal,
135136
WebAssembly,
136137
} = globalThis;
137138

@@ -372,6 +373,20 @@ module.exports = function() {
372373
ArrayPrototypePush(intrinsics, Intl);
373374
}
374375

376+
if (typeof Temporal !== 'undefined') {
377+
ArrayPrototypePush(intrinsicPrototypes,
378+
Temporal.Duration.prototype,
379+
Temporal.Instant.prototype,
380+
Temporal.PlainDate.prototype,
381+
Temporal.PlainDateTime.prototype,
382+
Temporal.PlainMonthDay.prototype,
383+
Temporal.PlainTime.prototype,
384+
Temporal.PlainYearMonth.prototype,
385+
Temporal.ZonedDateTime.prototype,
386+
);
387+
ArrayPrototypePush(intrinsics, Temporal);
388+
}
389+
375390
ArrayPrototypeForEach(intrinsicPrototypes, enableDerivedOverrides);
376391

377392
const frozenSet = new WeakSet();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.