|
@@ -30,6 +30,9 @@ void InstantPrototype::initialize(GlobalObject& global_object)
|
|
|
|
|
|
// 8.3.2 Temporal.Instant.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.instant.prototype-@@tostringtag
|
|
// 8.3.2 Temporal.Instant.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.instant.prototype-@@tostringtag
|
|
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm.heap(), "Temporal.Instant"), Attribute::Configurable);
|
|
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm.heap(), "Temporal.Instant"), Attribute::Configurable);
|
|
|
|
+
|
|
|
|
+ u8 attr = Attribute::Writable | Attribute::Configurable;
|
|
|
|
+ define_native_function(vm.names.valueOf, value_of, 0, attr);
|
|
}
|
|
}
|
|
|
|
|
|
static Instant* typed_this(GlobalObject& global_object)
|
|
static Instant* typed_this(GlobalObject& global_object)
|
|
@@ -118,4 +121,12 @@ JS_DEFINE_NATIVE_FUNCTION(InstantPrototype::epoch_nanoseconds_getter)
|
|
return &ns;
|
|
return &ns;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// 8.3.16 Temporal.Instant.prototype.valueOf ( ), https://tc39.es/proposal-temporal/#sec-temporal.instant.prototype.valueof
|
|
|
|
+JS_DEFINE_NATIVE_FUNCTION(InstantPrototype::value_of)
|
|
|
|
+{
|
|
|
|
+ // 1. Throw a TypeError exception.
|
|
|
|
+ vm.throw_exception<TypeError>(global_object, ErrorType::Convert, "Temporal.Instant", "a primitive value");
|
|
|
|
+ return {};
|
|
|
|
+}
|
|
|
|
+
|
|
}
|
|
}
|