Skip to content

Commit 08346dc

Browse files
authored
Remove getOffsetNanosecondsFor fallback from polyfill
1 parent 4770110 commit 08346dc

File tree

5 files changed

+4
-10
lines changed

5 files changed

+4
-10
lines changed

lib/ecmascript.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,8 +2179,8 @@ export function GetOffsetNanosecondsFor(
21792179
instant: TimeZoneProtocolParams['getOffsetNanosecondsFor'][0]
21802180
) {
21812181
let getOffsetNanosecondsFor = timeZone.getOffsetNanosecondsFor;
2182-
if (getOffsetNanosecondsFor === undefined) {
2183-
getOffsetNanosecondsFor = GetIntrinsic('%Temporal.TimeZone.prototype.getOffsetNanosecondsFor%');
2182+
if (typeof getOffsetNanosecondsFor !== 'function') {
2183+
throw new TypeError('getOffsetNanosecondsFor not callable');
21842184
}
21852185
const offsetNs = Reflect.apply(getOffsetNanosecondsFor, timeZone, [instant]);
21862186
if (typeof offsetNs !== 'number') {

lib/intrinsicclass.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ type TemporalIntrinsicPrototypeRegisteredKeys = {
3434

3535
interface StandaloneIntrinsics {
3636
'Temporal.Calendar.from': typeof Temporal.Calendar.from;
37-
'Temporal.TimeZone.prototype.getOffsetNanosecondsFor': typeof Temporal.TimeZone.prototype.getOffsetNanosecondsFor;
3837
}
3938
type RegisteredStandaloneIntrinsics = { [key in keyof StandaloneIntrinsics as `%${key}%`]: StandaloneIntrinsics[key] };
4039
const INTRINSICS: Partial<TemporalIntrinsicRegisteredKeys> &

lib/timezone.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DEBUG } from './debug';
22
import * as ES from './ecmascript';
3-
import { GetIntrinsic, MakeIntrinsicClass, DefineIntrinsic } from './intrinsicclass';
3+
import { GetIntrinsic, MakeIntrinsicClass } from './intrinsicclass';
44
import {
55
TIMEZONE_ID,
66
EPOCHNANOSECONDS,
@@ -158,4 +158,3 @@ export class TimeZone implements Temporal.TimeZone {
158158
}
159159

160160
MakeIntrinsicClass(TimeZone, 'Temporal.TimeZone');
161-
DefineIntrinsic('Temporal.TimeZone.prototype.getOffsetNanosecondsFor', TimeZone.prototype.getOffsetNanosecondsFor);

test/expected-failures.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
# polyfill, see expected-failures-transpiled.txt and
44
# expected-failures-optimized.txt respectively.
55

6-
# Blocked on https://github.com/tc39/test262/pull/3304
7-
built-ins/Temporal/Instant/prototype/round/options-wrong-type.js
8-
built-ins/Temporal/Duration/prototype/total/options-wrong-type.js
9-
106
# https://github.com/tc39/test262/pull/3316
117
intl402/Temporal/TimeZone/from/argument-invalid.js
128

test262

Submodule test262 updated 233 files

0 commit comments

Comments
 (0)