19 if (!IsUndefined(*
args.new_target(), isolate)) {
21 isolate, NewTypeError(MessageTemplate::kNotConstructor,
22 isolate->factory()->BigInt_string()));
27 if (IsJSReceiver(*value)) {
53 BigInt::FromObject(isolate, bigint_obj));
71 BigInt::FromObject(isolate, bigint_obj));
83 if (IsJSPrimitiveWrapper(*value)) {
92 NewTypeError(MessageTemplate::kNotGeneric,
93 isolate->factory()->NewStringFromAsciiChecked(caller),
94 isolate->factory()->BigInt_string()));
98 Isolate* isolate,
const char* builtin_name) {
100 DirectHandle<BigInt>
x;
102 isolate,
x, ThisBigIntValue(isolate,
receiver, builtin_name));
105 int radix_number = 10;
106 if (!IsUndefined(*radix, isolate)) {
112 if (radix_double < 2 || radix_double > 36) {
114 isolate, NewRangeError(MessageTemplate::kToRadixFormatRange));
116 radix_number =
static_cast<int>(radix_double);
127 const char* method_name =
"BigInt.prototype.toLocaleString";
128#ifdef V8_INTL_SUPPORT
132 isolate,
x, ThisBigIntValue(isolate,
args.receiver(), method_name));
137 args.atOrUndefined(isolate, 2), method_name));
141 return BigIntToStringImpl(
args.receiver(), radix, isolate, method_name);
147 return BigIntToStringImpl(
args.receiver(), radix, isolate,
148 "BigInt.prototype.toString");
155 ThisBigIntValue(isolate,
args.receiver(),
"BigInt.prototype.valueOf"));
static MaybeDirectHandle< BigInt > AsUintN(Isolate *isolate, uint64_t n, DirectHandle< BigInt > x)
static MaybeHandle< String > ToString(Isolate *isolate, DirectHandle< BigInt > bigint, int radix=10, ShouldThrow should_throw=kThrowOnError)
static DirectHandle< BigInt > AsIntN(Isolate *isolate, uint64_t n, DirectHandle< BigInt > x)
static V8_EXPORT_PRIVATE MaybeHandle< BigInt > FromNumber(Isolate *isolate, DirectHandle< Object > number)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< String > NumberToLocaleString(Isolate *isolate, Handle< Object > num, DirectHandle< Object > locales, DirectHandle< Object > options, const char *method_name)
static V8_WARN_UNUSED_RESULT HandleType< Object >::MaybeType ToPrimitive(Isolate *isolate, HandleType< JSReceiver > receiver, ToPrimitiveHint hint=ToPrimitiveHint::kDefault)
static V8_WARN_UNUSED_RESULT HandleType< Object >::MaybeType ToIndex(Isolate *isolate, HandleType< T > input, MessageTemplate error_index)
static double NumberValue(Tagged< Number > obj)
static V8_WARN_UNUSED_RESULT Maybe< double > IntegerValue(Isolate *isolate, HandleType< T > input)
#define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call)
#define THROW_NEW_ERROR(isolate, call)
#define THROW_NEW_ERROR_RETURN_FAILURE(isolate, call)
#define RETURN_RESULT_OR_FAILURE(isolate, call)
#define MAYBE_ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call)
base::Vector< const DirectHandle< Object > > args
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
bool IsNumber(Tagged< Object > obj)
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)