LibJS: Add missing spec links

This commit is contained in:
Linus Groh 2021-08-08 11:04:30 +01:00
parent 0e21bf0f23
commit 16c38788c3
Notes: sideshowbarker 2024-07-18 07:15:04 +09:00
10 changed files with 12 additions and 12 deletions

View File

@ -308,7 +308,7 @@ bool validate_and_apply_property_descriptor(Object* object, PropertyName const&
return true;
}
// 10.1.14 GetPrototypeFromConstructor ( constructor, intrinsicDefaultProto )
// 10.1.14 GetPrototypeFromConstructor ( constructor, intrinsicDefaultProto ), https://tc39.es/ecma262/#sec-getprototypefromconstructor
Object* get_prototype_from_constructor(GlobalObject& global_object, FunctionObject const& constructor, Object* (GlobalObject::*intrinsic_default_prototype)())
{
auto& vm = global_object.vm();
@ -357,7 +357,7 @@ Object* get_super_constructor(VM& vm)
return super_constructor;
}
// 13.3.7.3 MakeSuperPropertyReference ( actualThis, propertyKey, strict )
// 13.3.7.3 MakeSuperPropertyReference ( actualThis, propertyKey, strict ), https://tc39.es/ecma262/#sec-makesuperpropertyreference
Reference make_super_property_reference(GlobalObject& global_object, Value actual_this, StringOrSymbol const& property_key, bool strict)
{
auto& vm = global_object.vm();

View File

@ -78,7 +78,7 @@ CodePoint code_point_at(Utf16View const& string, size_t position)
return { code_point, 2, false };
}
// 6.1.4.1 StringIndexOf ( string, searchValue, fromIndex )
// 6.1.4.1 StringIndexOf ( string, searchValue, fromIndex ), https://tc39.es/ecma262/#sec-stringindexof
static Optional<size_t> string_index_of(Utf16View const& string, Utf16View const& search_value, size_t from_index)
{
size_t string_length = string.length_in_code_units();

View File

@ -300,7 +300,7 @@ double constrain_to_range(double x, double minimum, double maximum)
return min(max(x, minimum), maximum);
}
// 13.32 RoundNumberToIncrement ( x, increment, roundingMode )
// 13.32 RoundNumberToIncrement ( x, increment, roundingMode ), https://tc39.es/proposal-temporal/#sec-temporal-roundnumbertoincrement
BigInt* round_number_to_increment(GlobalObject& global_object, BigInt const& x, u64 increment, String const& rounding_mode)
{
auto& heap = global_object.heap();

View File

@ -59,7 +59,7 @@ bool is_builtin_calendar(String const& identifier)
return true;
}
// 12.1.3 GetBuiltinCalendar ( id )
// 12.1.3 GetBuiltinCalendar ( id ), https://tc39.es/proposal-temporal/#sec-temporal-getbuiltincalendar
Calendar* get_builtin_calendar(GlobalObject& global_object, String const& identifier)
{
auto& vm = global_object.vm();

View File

@ -137,7 +137,7 @@ TemporalDuration to_temporal_duration_record(GlobalObject& global_object, Object
return result;
}
// 7.5.3 DurationSign ( years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds )
// 7.5.3 DurationSign ( years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds ), https://tc39.es/proposal-temporal/#sec-temporal-durationsign
i8 duration_sign(double years, double months, double weeks, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds)
{
// 1. For each value v of « years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds », do
@ -155,7 +155,7 @@ i8 duration_sign(double years, double months, double weeks, double days, double
return 0;
}
// 7.5.4 IsValidDuration ( years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds )
// 7.5.4 IsValidDuration ( years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds ), https://tc39.es/proposal-temporal/#sec-temporal-isvalidduration
bool is_valid_duration(double years, double months, double weeks, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds)
{
// 1. Let sign be ! DurationSign(years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds).

View File

@ -145,7 +145,7 @@ BigInt* parse_temporal_instant(GlobalObject& global_object, String const& iso_st
return js_bigint(vm, utc->big_integer().minus(Crypto::SignedBigInteger::create_from(offset_nanoseconds)));
}
// 8.5.5 CompareEpochNanoseconds ( epochNanosecondsOne, epochNanosecondsTwo )
// 8.5.5 CompareEpochNanoseconds ( epochNanosecondsOne, epochNanosecondsTwo ), https://tc39.es/proposal-temporal/#sec-temporal-compareepochnanoseconds
i32 compare_epoch_nanoseconds(BigInt const& epoch_nanoseconds_one, BigInt const& epoch_nanoseconds_two)
{
// 1. If epochNanosecondsOne > epochNanosecondsTwo, return 1.

View File

@ -226,7 +226,7 @@ PlainDateTime* system_date_time(GlobalObject& global_object, Value temporal_time
return builtin_time_zone_get_plain_date_time_for(global_object, time_zone, *instant, *calendar);
}
// 2.3.5 SystemZonedDateTime ( temporalTimeZoneLike, calendarLike )
// 2.3.5 SystemZonedDateTime ( temporalTimeZoneLike, calendarLike ), https://tc39.es/proposal-temporal/#sec-temporal-systemzoneddatetime
ZonedDateTime* system_zoned_date_time(GlobalObject& global_object, Value temporal_time_zone_like, Value calendar_like)
{
auto& vm = global_object.vm();

View File

@ -147,7 +147,7 @@ JS_DEFINE_NATIVE_FUNCTION(PlainTimePrototype::nanosecond_getter)
return Value(temporal_time->iso_nanosecond());
}
// 4.3.17 Temporal.PlainTime.prototype.toPlainDateTime ( temporalDate )
// 4.3.17 Temporal.PlainTime.prototype.toPlainDateTime ( temporalDate ), https://tc39.es/proposal-temporal/#sec-temporal.plaintime.prototype.toplaindatetime
JS_DEFINE_NATIVE_FUNCTION(PlainTimePrototype::to_plain_date_time)
{
// 1. Let temporalTime be the this value.

View File

@ -415,7 +415,7 @@ double get_offset_nanoseconds_for(GlobalObject& global_object, Value time_zone,
return offset_nanoseconds;
}
// 11.6.12 BuiltinTimeZoneGetOffsetStringFor ( timeZone, instant )
// 11.6.12 BuiltinTimeZoneGetOffsetStringFor ( timeZone, instant ), https://tc39.es/proposal-temporal/#sec-temporal-builtintimezonegetoffsetstringfor
Optional<String> builtin_time_zone_get_offset_string_for(GlobalObject& global_object, Object& time_zone, Instant& instant)
{
auto& vm = global_object.vm();

View File

@ -82,7 +82,7 @@ Value TimeZoneConstructor::construct(FunctionObject& new_target)
return create_temporal_time_zone(global_object, canonical, &new_target);
}
// 11.3.2 Temporal.TimeZone.from ( item )
// 11.3.2 Temporal.TimeZone.from ( item ), https://tc39.es/proposal-temporal/#sec-temporal.timezone.from
JS_DEFINE_NATIVE_FUNCTION(TimeZoneConstructor::from)
{
auto item = vm.argument(0);