17 if (IsUndefined(*
args.new_target(), isolate)) {
19 isolate, NewTypeError(MessageTemplate::kConstructorNotFunction,
20 isolate->factory()->ShadowRealm_string()));
41 isolate->RunHostCreateShadowRealmContextCallback());
61MaybeDirectHandle<Object> GetWrappedValue(
62 Isolate* isolate, DirectHandle<NativeContext> creation_context,
65 if (!IsJSReceiver(*value)) {
70 if (!IsCallable(*value)) {
76 direct_handle(creation_context->type_error_function(), isolate),
77 MessageTemplate::kNotCallable, value),
95 Factory* factory = isolate->factory();
100 isolate, NewTypeError(MessageTemplate::kIncompatibleMethodReceiver));
105 if (!IsString(*source_text)) {
108 NewTypeError(MessageTemplate::kInvalidShadowRealmEvaluateSourceText));
124 bool unhandled_object;
125 std::tie(validated_source, unhandled_object) =
128 if (unhandled_object) {
131 NewTypeError(MessageTemplate::kInvalidShadowRealmEvaluateSourceText));
137 bool is_parse_failed =
false;
172 if (maybe_function.
is_null()) {
173 is_parse_failed =
true;
192 DCHECK(isolate->has_exception());
194 isolate->clear_internal_exception();
195 if (is_parse_failed) {
198 isolate, error_object, factory->message_string()));
200 return isolate->ReThrow(
201 *factory->
NewError(isolate->syntax_error_function(), message));
210 ShadowRealmNewTypeErrorCopy(
211 exception, MessageTemplate::kCallShadowRealmEvaluateThrew,
string));
216 isolate, wrapped_result,
217 GetWrappedValue(isolate, caller_context,
result.ToHandleChecked()));
218 return *wrapped_result;
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< JSFunction > GetFunctionFromValidatedString(DirectHandle< NativeContext > context, MaybeDirectHandle< String > source, ParseRestriction restriction, int parameters_end_pos)
static V8_WARN_UNUSED_RESULT std::pair< MaybeDirectHandle< String >, bool > ValidateDynamicCompilationSource(Isolate *isolate, DirectHandle< NativeContext > context, Handle< i::Object > source_object, bool is_code_like=false)
V8_EXPORT_PRIVATE static V8_WARN_UNUSED_RESULT MaybeHandle< Object > Call(Isolate *isolate, DirectHandle< Object > callable, DirectHandle< Object > receiver, base::Vector< const DirectHandle< Object > > args)
Handle< JSObject > NewError(DirectHandle< JSFunction > constructor, DirectHandle< String > message, DirectHandle< Object > options={})
static V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT MaybeHandle< JSObject > New(DirectHandle< JSFunction > constructor, DirectHandle< JSReceiver > new_target, DirectHandle< AllocationSite > site, NewJSObjectType=NewJSObjectType::kNoAPIWrapper)
static Handle< Object > GetDataProperty(Isolate *isolate, DirectHandle< JSReceiver > object, DirectHandle< Name > name)
static MaybeDirectHandle< Object > Create(Isolate *isolate, DirectHandle< NativeContext > creation_context, DirectHandle< JSReceiver > value)
V8_INLINE DirectHandle< T > ToHandleChecked() const
V8_INLINE bool is_null() const
static V8_EXPORT_PRIVATE DirectHandle< String > NoSideEffectsToString(Isolate *isolate, DirectHandle< Object > input)
#define THROW_NEW_ERROR_RETURN_VALUE(isolate, call, value)
#define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call)
#define THROW_NEW_ERROR_RETURN_FAILURE(isolate, call)
base::Vector< const DirectHandle< Object > > args
DirectHandle< Object > new_target
ZoneVector< RpoNumber > & result
constexpr int kNoSourcePosition
V8_INLINE DirectHandle< T > direct_handle(Tagged< T > object, Isolate *isolate)
!IsContextMap !IsContextMap native_context
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
#define DCHECK(condition)