Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registry functions: add :date and :time #51

Merged
merged 9 commits into from
Apr 30, 2024
Prev Previous commit
Next Next commit
implement suggestions
  • Loading branch information
ryzokuken committed Apr 25, 2024
commit ca08087f2745e8fa97b91f58529ca4b07f67c914
24 changes: 13 additions & 11 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 324,16 @@ contributors: Eemeli Aro

<emu-alg>
1. If Type(_input_) is Object, then
1. If InstanceOfOperator(_input_, �te%) is *false*,then
1. If HasProperty(_input_, *"options"*) is *true*, then
1. Perform ? Call(Object.assign, *undefined*, « _opts_, Get(_input_, *"options"*) »).
1. If InstanceOfOperator(_input_, �te%) is *true*,then
1. Let _value_ be _input_.
1. Else,
1. Let _valueOf_ be ? Get(_input_, *"valueOf"*).
1. If IsCallable(_valueOf_) is *true*, set _input_ to Call(_valueOf_, _input_).
1. If Type(_input_) is Number or String, let _input_ be ? Construct(�te%, « _input_ »).
1. If InstanceOfOperator(_input_, �te%) is *false*, throw a *TypeError* exception.
1. Return _input_.
1. If IsCallable(_valueOf_) is *true*, let _value_ be Call(_valueOf_, _input_), else throw a *TypeError* exception.
1. If HasProperty(_input_, *"options"*) is *true*, then
1. Perform ? Call(Object.assign, *undefined*, « _opts_, Get(_input_, *"options"*) »).
1. Else if Type(_input_) is Number or String, then
1. Let _value_ be ? Construct(�te%, « _input_ »).
1. Return _value_.
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -563,10 565,10 @@ contributors: Eemeli Aro

<emu-alg>
1. Let _locale_ be ! Get(_funcCtx_, *"locale"*).
1. Let _localeMatcher_ be ! Get(_funcCtx_, *"localeMatcher"*).
1. Let _source_ be ! Get(_funcCtx_, *"source"*).
1. Let _opts_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_opt_, *"localeMatcher"*, _localeMatcher_).
1. Let _localeMatcher_ be ! Get(_funcCtx_, *"localeMatcher"*).
1. Perform ! CreateDataPropertyOrThrow(_opts_, *"localeMatcher"*, _localeMatcher_).
1. Let _value_ be ? HandleDateTimeInput(_input_, _opts_).
1. For each String _optName_ of ? EnumerableOwnProperties(_options_, ~key~),
1. If _optName_ is not *"locale"*, then
Expand Down Expand Up @@ -602,10 604,10 @@ contributors: Eemeli Aro

<emu-alg>
1. Let _locale_ be ! Get(_funcCtx_, *"locale"*).
1. Let _localeMatcher_ be ! Get(_funcCtx_, *"localeMatcher"*).
1. Let _source_ be ! Get(_funcCtx_, *"source"*).
1. Let _opts_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_opt_, *"localeMatcher"*, _localeMatcher_).
1. Let _localeMatcher_ be ! Get(_funcCtx_, *"localeMatcher"*).
1. Perform ! CreateDataPropertyOrThrow(_opts_, *"localeMatcher"*, _localeMatcher_).
1. Let _value_ be ? HandleDateTimeInput(_input_, _opts_).
1. Let _dateStyle_ be ! Get(_options_, *"style"*).
1. If _dateStyle_ is *null* or *undefined*, then
Expand Down