-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temporal API should throw TypeErrors for unexpected primitives
https://bugs.webkit.org/show_bug.cgi?id=264240 Reviewed by Yusuke Suzuki. As of the latest Temporal spec, we should never convert non-object, non-string values to a Temporal object. At our current stage of implementation, this applies to Duration, Instant, PlainDate, PlainTime, and PlainDateTime. Relatedly (namely, for the case of handling explicit undefined values), toIntegerOrInfinity is no longer used by Temporal and toIntegerWithoutRounding has been removed entirely. Spec-side, these have been replaced by toIntegerWithTruncation and toIntegerIfIntegral; here, we implement the former and inline the latter. * JSTests/test262/config.yaml: Move two tests over from expectations.yaml; even before this patch, these are hitting an assertion due to unimplemented parts of Temporal. * JSTests/test262/expectations.yaml: Mark 102 test cases passing. * JSTests/stress/temporal-duration.js: * JSTests/stress/temporal-plaindatetime.js: * Source/JavaScriptCore/runtime/JSCJSValue.h: * Source/JavaScriptCore/runtime/JSCJSValueInlines.h: (JSC::JSValue::toIntegerWithTruncation const): (JSC::JSValue::toIntegerOrInfinity const): (JSC::JSValue::toIntegerWithoutRounding const): Deleted. * Source/JavaScriptCore/runtime/TemporalDuration.cpp: (JSC::TemporalDuration::fromDurationLike): (JSC::TemporalDuration::toISO8601Duration): * Source/JavaScriptCore/runtime/TemporalDurationConstructor.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/TemporalInstant.cpp: * Source/JavaScriptCore/runtime/TemporalPlainDate.cpp: (JSC::TemporalPlainDate::from): * Source/JavaScriptCore/runtime/TemporalPlainDateConstructor.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/TemporalPlainDateTime.cpp: (JSC::TemporalPlainDateTime::from): * Source/JavaScriptCore/runtime/TemporalPlainTime.cpp: (JSC::TemporalPlainTime::from): Canonical link: https://commits.webkit.org/270262@main
- Loading branch information
Showing
13 changed files
with
46 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters