| 380 | if (decimal.size() > static_cast<size_t>(v8::String::kMaxLength)) { |
| 381 | exceptionTracker.onError("BigInt decimal exceeds V8's string capacity"); |
| 382 | return {}; |
| 383 | } |
| 384 | |
| 385 | v8::TryCatch catcher(_isolate); |
| 386 | auto context = _context.Get(_isolate); |
| 387 | v8::Context::Scope contextScope(context); |
| 388 | v8::Local<v8::String> string; |
| 389 | if (!v8::String::NewFromUtf8(_isolate, decimal.data(), v8::NewStringType::kNormal, static_cast<int>(decimal.size())) |
| 390 | .ToLocal(&string)) { |
| 391 | storeCaughtException(catcher, "Cannot create BigInt decimal string", exceptionTracker); |
| 392 | return {}; |
| 393 | } |
| 394 | v8::Local<v8::Value> argument = string; |
| 395 | v8::Local<v8::Value> result; |
| 396 | if (!_bigIntConstructor.Get(_isolate)->Call(context, v8::Undefined(_isolate), 1, &argument).ToLocal(&result)) { |
no test coverage detected