mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 14:58:11 +00:00
LibJS: Do not invoke Cell::vm in constructors before Cell is constructed
In a subclass of Cell, we cannot use Cell::vm() before the base Cell object itself is constructed. Use the Realm's VM instead. This was caught by UBSAN with vptr sanitation enabled.
This commit is contained in:
parent
3efe611dbf
commit
85e313077a
46 changed files with 97 additions and 97 deletions
|
@ -14,7 +14,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
ArrayBufferConstructor::ArrayBufferConstructor(Realm& realm)
|
ArrayBufferConstructor::ArrayBufferConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.ArrayBuffer.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.ArrayBuffer.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
ArrayConstructor::ArrayConstructor(Realm& realm)
|
ArrayConstructor::ArrayConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Array.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Array.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
AsyncFunctionConstructor::AsyncFunctionConstructor(Realm& realm)
|
AsyncFunctionConstructor::AsyncFunctionConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.AsyncFunction.as_string(), *realm.intrinsics().function_constructor())
|
: NativeFunction(realm.vm().names.AsyncFunction.as_string(), *realm.intrinsics().function_constructor())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
AsyncGeneratorFunctionConstructor::AsyncGeneratorFunctionConstructor(Realm& realm)
|
AsyncGeneratorFunctionConstructor::AsyncGeneratorFunctionConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.AsyncGeneratorFunction.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.AsyncGeneratorFunction.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace JS {
|
||||||
static const Crypto::SignedBigInteger BIGINT_ONE { 1 };
|
static const Crypto::SignedBigInteger BIGINT_ONE { 1 };
|
||||||
|
|
||||||
BigIntConstructor::BigIntConstructor(Realm& realm)
|
BigIntConstructor::BigIntConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.BigInt.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.BigInt.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
BooleanConstructor::BooleanConstructor(Realm& realm)
|
BooleanConstructor::BooleanConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Boolean.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Boolean.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
DataViewConstructor::DataViewConstructor(Realm& realm)
|
DataViewConstructor::DataViewConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.DataView.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.DataView.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ static double parse_date_string(String const& date_string)
|
||||||
}
|
}
|
||||||
|
|
||||||
DateConstructor::DateConstructor(Realm& realm)
|
DateConstructor::DateConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Date.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Date.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
ErrorConstructor::ErrorConstructor(Realm& realm)
|
ErrorConstructor::ErrorConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Error.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Error.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,57 +61,57 @@ ThrowCompletionOr<Object*> ErrorConstructor::construct(FunctionObject& new_targe
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \
|
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \
|
||||||
ConstructorName::ConstructorName(Realm& realm) \
|
ConstructorName::ConstructorName(Realm& realm) \
|
||||||
: NativeFunction(vm().names.ClassName.as_string(), *static_cast<Object*>(realm.intrinsics().error_constructor())) \
|
: NativeFunction(realm.vm().names.ClassName.as_string(), *static_cast<Object*>(realm.intrinsics().error_constructor())) \
|
||||||
{ \
|
{ \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
void ConstructorName::initialize(Realm& realm) \
|
void ConstructorName::initialize(Realm& realm) \
|
||||||
{ \
|
{ \
|
||||||
auto& vm = this->vm(); \
|
auto& vm = this->vm(); \
|
||||||
NativeFunction::initialize(realm); \
|
NativeFunction::initialize(realm); \
|
||||||
\
|
\
|
||||||
/* 20.5.6.2.1 NativeError.prototype, https://tc39.es/ecma262/#sec-nativeerror.prototype */ \
|
/* 20.5.6.2.1 NativeError.prototype, https://tc39.es/ecma262/#sec-nativeerror.prototype */ \
|
||||||
define_direct_property(vm.names.prototype, realm.intrinsics().snake_name##_prototype(), 0); \
|
define_direct_property(vm.names.prototype, realm.intrinsics().snake_name##_prototype(), 0); \
|
||||||
\
|
\
|
||||||
define_direct_property(vm.names.length, Value(1), Attribute::Configurable); \
|
define_direct_property(vm.names.length, Value(1), Attribute::Configurable); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
ConstructorName::~ConstructorName() = default; \
|
ConstructorName::~ConstructorName() = default; \
|
||||||
\
|
\
|
||||||
/* 20.5.6.1.1 NativeError ( message [ , options ] ), https://tc39.es/ecma262/#sec-nativeerror */ \
|
/* 20.5.6.1.1 NativeError ( message [ , options ] ), https://tc39.es/ecma262/#sec-nativeerror */ \
|
||||||
ThrowCompletionOr<Value> ConstructorName::call() \
|
ThrowCompletionOr<Value> ConstructorName::call() \
|
||||||
{ \
|
{ \
|
||||||
/* 1. If NewTarget is undefined, let newTarget be the active function object; else let newTarget be NewTarget. */ \
|
/* 1. If NewTarget is undefined, let newTarget be the active function object; else let newTarget be NewTarget. */ \
|
||||||
return TRY(construct(*this)); \
|
return TRY(construct(*this)); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
/* 20.5.6.1.1 NativeError ( message [ , options ] ), https://tc39.es/ecma262/#sec-nativeerror */ \
|
/* 20.5.6.1.1 NativeError ( message [ , options ] ), https://tc39.es/ecma262/#sec-nativeerror */ \
|
||||||
ThrowCompletionOr<Object*> ConstructorName::construct(FunctionObject& new_target) \
|
ThrowCompletionOr<Object*> ConstructorName::construct(FunctionObject& new_target) \
|
||||||
{ \
|
{ \
|
||||||
auto& vm = this->vm(); \
|
auto& vm = this->vm(); \
|
||||||
\
|
\
|
||||||
auto message = vm.argument(0); \
|
auto message = vm.argument(0); \
|
||||||
auto options = vm.argument(1); \
|
auto options = vm.argument(1); \
|
||||||
\
|
\
|
||||||
/* 2. Let O be ? OrdinaryCreateFromConstructor(newTarget, "%NativeError.prototype%", « [[ErrorData]] »). */ \
|
/* 2. Let O be ? OrdinaryCreateFromConstructor(newTarget, "%NativeError.prototype%", « [[ErrorData]] »). */ \
|
||||||
auto* error = TRY(ordinary_create_from_constructor<ClassName>(vm, new_target, &Intrinsics::snake_name##_prototype)); \
|
auto* error = TRY(ordinary_create_from_constructor<ClassName>(vm, new_target, &Intrinsics::snake_name##_prototype)); \
|
||||||
\
|
\
|
||||||
/* 3. If message is not undefined, then */ \
|
/* 3. If message is not undefined, then */ \
|
||||||
if (!message.is_undefined()) { \
|
if (!message.is_undefined()) { \
|
||||||
/* a. Let msg be ? ToString(message). */ \
|
/* a. Let msg be ? ToString(message). */ \
|
||||||
auto msg = TRY(message.to_string(vm)); \
|
auto msg = TRY(message.to_string(vm)); \
|
||||||
\
|
\
|
||||||
/* b. Perform CreateNonEnumerableDataPropertyOrThrow(O, "message", msg). */ \
|
/* b. Perform CreateNonEnumerableDataPropertyOrThrow(O, "message", msg). */ \
|
||||||
error->create_non_enumerable_data_property_or_throw(vm.names.message, js_string(vm, move(msg))); \
|
error->create_non_enumerable_data_property_or_throw(vm.names.message, js_string(vm, move(msg))); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
/* 4. Perform ? InstallErrorCause(O, options). */ \
|
/* 4. Perform ? InstallErrorCause(O, options). */ \
|
||||||
TRY(error->install_error_cause(options)); \
|
TRY(error->install_error_cause(options)); \
|
||||||
\
|
\
|
||||||
/* 5. Return O. */ \
|
/* 5. Return O. */ \
|
||||||
return error; \
|
return error; \
|
||||||
}
|
}
|
||||||
|
|
||||||
JS_ENUMERATE_NATIVE_ERRORS
|
JS_ENUMERATE_NATIVE_ERRORS
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
FinalizationRegistryConstructor::FinalizationRegistryConstructor(Realm& realm)
|
FinalizationRegistryConstructor::FinalizationRegistryConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.FinalizationRegistry.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.FinalizationRegistry.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
FunctionConstructor::FunctionConstructor(Realm& realm)
|
FunctionConstructor::FunctionConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Function.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Function.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ static ThrowCompletionOr<Collator*> initialize_collator(VM& vm, Collator& collat
|
||||||
|
|
||||||
// 10.1 The Intl.Collator Constructor, https://tc39.es/ecma402/#sec-the-intl-collator-constructor
|
// 10.1 The Intl.Collator Constructor, https://tc39.es/ecma402/#sec-the-intl-collator-constructor
|
||||||
CollatorConstructor::CollatorConstructor(Realm& realm)
|
CollatorConstructor::CollatorConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Collator.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Collator.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace JS::Intl {
|
||||||
|
|
||||||
// 11.1 The Intl.DateTimeFormat Constructor, https://tc39.es/ecma402/#sec-intl-datetimeformat-constructor
|
// 11.1 The Intl.DateTimeFormat Constructor, https://tc39.es/ecma402/#sec-intl-datetimeformat-constructor
|
||||||
DateTimeFormatConstructor::DateTimeFormatConstructor(Realm& realm)
|
DateTimeFormatConstructor::DateTimeFormatConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.DateTimeFormat.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.DateTimeFormat.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace JS::Intl {
|
||||||
|
|
||||||
// 12.1 The Intl.DisplayNames Constructor, https://tc39.es/ecma402/#sec-intl-displaynames-constructor
|
// 12.1 The Intl.DisplayNames Constructor, https://tc39.es/ecma402/#sec-intl-displaynames-constructor
|
||||||
DisplayNamesConstructor::DisplayNamesConstructor(Realm& realm)
|
DisplayNamesConstructor::DisplayNamesConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.DisplayNames.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.DisplayNames.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace JS::Intl {
|
||||||
|
|
||||||
// 1.2 The Intl.DurationFormat Constructor, https://tc39.es/proposal-intl-duration-format/#sec-intl-durationformat-constructor
|
// 1.2 The Intl.DurationFormat Constructor, https://tc39.es/proposal-intl-duration-format/#sec-intl-durationformat-constructor
|
||||||
DurationFormatConstructor::DurationFormatConstructor(Realm& realm)
|
DurationFormatConstructor::DurationFormatConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.DurationFormat.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.DurationFormat.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace JS::Intl {
|
||||||
|
|
||||||
// 13.1 The Intl.ListFormat Constructor, https://tc39.es/ecma402/#sec-intl-listformat-constructor
|
// 13.1 The Intl.ListFormat Constructor, https://tc39.es/ecma402/#sec-intl-listformat-constructor
|
||||||
ListFormatConstructor::ListFormatConstructor(Realm& realm)
|
ListFormatConstructor::ListFormatConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.ListFormat.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.ListFormat.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -217,7 +217,7 @@ static LocaleAndKeys apply_unicode_extension_to_tag(StringView tag, LocaleAndKey
|
||||||
|
|
||||||
// 14.1 The Intl.Locale Constructor, https://tc39.es/ecma402/#sec-intl-locale-constructor
|
// 14.1 The Intl.Locale Constructor, https://tc39.es/ecma402/#sec-intl-locale-constructor
|
||||||
LocaleConstructor::LocaleConstructor(Realm& realm)
|
LocaleConstructor::LocaleConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Locale.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Locale.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace JS::Intl {
|
||||||
|
|
||||||
// 15.1 The Intl.NumberFormat Constructor, https://tc39.es/ecma402/#sec-intl-numberformat-constructor
|
// 15.1 The Intl.NumberFormat Constructor, https://tc39.es/ecma402/#sec-intl-numberformat-constructor
|
||||||
NumberFormatConstructor::NumberFormatConstructor(Realm& realm)
|
NumberFormatConstructor::NumberFormatConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.NumberFormat.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.NumberFormat.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace JS::Intl {
|
||||||
|
|
||||||
// 16.1 The Intl.PluralRules Constructor, https://tc39.es/ecma402/#sec-intl-pluralrules-constructor
|
// 16.1 The Intl.PluralRules Constructor, https://tc39.es/ecma402/#sec-intl-pluralrules-constructor
|
||||||
PluralRulesConstructor::PluralRulesConstructor(Realm& realm)
|
PluralRulesConstructor::PluralRulesConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.PluralRules.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.PluralRules.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace JS::Intl {
|
||||||
|
|
||||||
// 17.1 The Intl.RelativeTimeFormat Constructor, https://tc39.es/ecma402/#sec-intl-relativetimeformat-constructor
|
// 17.1 The Intl.RelativeTimeFormat Constructor, https://tc39.es/ecma402/#sec-intl-relativetimeformat-constructor
|
||||||
RelativeTimeFormatConstructor::RelativeTimeFormatConstructor(Realm& realm)
|
RelativeTimeFormatConstructor::RelativeTimeFormatConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.RelativeTimeFormat.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.RelativeTimeFormat.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace JS::Intl {
|
||||||
|
|
||||||
// 18.1 The Intl.Segmenter Constructor, https://tc39.es/ecma402/#sec-intl-segmenter-constructor
|
// 18.1 The Intl.Segmenter Constructor, https://tc39.es/ecma402/#sec-intl-segmenter-constructor
|
||||||
SegmenterConstructor::SegmenterConstructor(Realm& realm)
|
SegmenterConstructor::SegmenterConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Segmenter.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Segmenter.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
MapConstructor::MapConstructor(Realm& realm)
|
MapConstructor::MapConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Map.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Map.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ constexpr double const MIN_SAFE_INTEGER_VALUE { -(__builtin_exp2(53) - 1) };
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
NumberConstructor::NumberConstructor(Realm& realm)
|
NumberConstructor::NumberConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Number.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Number.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
ObjectConstructor::ObjectConstructor(Realm& realm)
|
ObjectConstructor::ObjectConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Object.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Object.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -240,7 +240,7 @@ static ThrowCompletionOr<Value> perform_promise_race(VM& vm, Iterator& iterator_
|
||||||
}
|
}
|
||||||
|
|
||||||
PromiseConstructor::PromiseConstructor(Realm& realm)
|
PromiseConstructor::PromiseConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Promise.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Promise.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ static ThrowCompletionOr<ProxyObject*> proxy_create(VM& vm, Value target, Value
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxyConstructor::ProxyConstructor(Realm& realm)
|
ProxyConstructor::ProxyConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Proxy.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Proxy.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
RegExpConstructor::RegExpConstructor(Realm& realm)
|
RegExpConstructor::RegExpConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.RegExp.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.RegExp.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
SetConstructor::SetConstructor(Realm& realm)
|
SetConstructor::SetConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Set.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Set.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace JS {
|
||||||
|
|
||||||
// 3.2 The ShadowRealm Constructor, https://tc39.es/proposal-shadowrealm/#sec-shadowrealm-constructor
|
// 3.2 The ShadowRealm Constructor, https://tc39.es/proposal-shadowrealm/#sec-shadowrealm-constructor
|
||||||
ShadowRealmConstructor::ShadowRealmConstructor(Realm& realm)
|
ShadowRealmConstructor::ShadowRealmConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.ShadowRealm.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.ShadowRealm.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
StringConstructor::StringConstructor(Realm& realm)
|
StringConstructor::StringConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.String.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.String.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
SymbolConstructor::SymbolConstructor(Realm& realm)
|
SymbolConstructor::SymbolConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Symbol.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Symbol.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace JS::Temporal {
|
||||||
|
|
||||||
// 12.2 The Temporal.Calendar Constructor, https://tc39.es/proposal-temporal/#sec-temporal-calendar-constructor
|
// 12.2 The Temporal.Calendar Constructor, https://tc39.es/proposal-temporal/#sec-temporal-calendar-constructor
|
||||||
CalendarConstructor::CalendarConstructor(Realm& realm)
|
CalendarConstructor::CalendarConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Calendar.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Calendar.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace JS::Temporal {
|
||||||
|
|
||||||
// 7.1 The Temporal.Duration Constructor, https://tc39.es/proposal-temporal/#sec-temporal-duration-constructor
|
// 7.1 The Temporal.Duration Constructor, https://tc39.es/proposal-temporal/#sec-temporal-duration-constructor
|
||||||
DurationConstructor::DurationConstructor(Realm& realm)
|
DurationConstructor::DurationConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Duration.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Duration.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace JS::Temporal {
|
||||||
|
|
||||||
// 8.1 The Temporal.Instant Constructor, https://tc39.es/proposal-temporal/#sec-temporal-instant-constructor
|
// 8.1 The Temporal.Instant Constructor, https://tc39.es/proposal-temporal/#sec-temporal-instant-constructor
|
||||||
InstantConstructor::InstantConstructor(Realm& realm)
|
InstantConstructor::InstantConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.Instant.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.Instant.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace JS::Temporal {
|
||||||
|
|
||||||
// 3.1 The Temporal.PlainDate Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plaindate-constructor
|
// 3.1 The Temporal.PlainDate Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plaindate-constructor
|
||||||
PlainDateConstructor::PlainDateConstructor(Realm& realm)
|
PlainDateConstructor::PlainDateConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.PlainDate.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.PlainDate.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace JS::Temporal {
|
||||||
|
|
||||||
// 5.1 The Temporal.PlainDateTime Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plaindatetime-constructor
|
// 5.1 The Temporal.PlainDateTime Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plaindatetime-constructor
|
||||||
PlainDateTimeConstructor::PlainDateTimeConstructor(Realm& realm)
|
PlainDateTimeConstructor::PlainDateTimeConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.PlainDateTime.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.PlainDateTime.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace JS::Temporal {
|
||||||
|
|
||||||
// 10.1 The Temporal.PlainMonthDay Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plainmonthday-constructor
|
// 10.1 The Temporal.PlainMonthDay Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plainmonthday-constructor
|
||||||
PlainMonthDayConstructor::PlainMonthDayConstructor(Realm& realm)
|
PlainMonthDayConstructor::PlainMonthDayConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.PlainMonthDay.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.PlainMonthDay.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace JS::Temporal {
|
||||||
|
|
||||||
// 4.1 The Temporal.PlainTime Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plaintime-constructor
|
// 4.1 The Temporal.PlainTime Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plaintime-constructor
|
||||||
PlainTimeConstructor::PlainTimeConstructor(Realm& realm)
|
PlainTimeConstructor::PlainTimeConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.PlainTime.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.PlainTime.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace JS::Temporal {
|
||||||
|
|
||||||
// 9.1 The Temporal.PlainYearMonth Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plainyearmonth-constructor
|
// 9.1 The Temporal.PlainYearMonth Constructor, https://tc39.es/proposal-temporal/#sec-temporal-plainyearmonth-constructor
|
||||||
PlainYearMonthConstructor::PlainYearMonthConstructor(Realm& realm)
|
PlainYearMonthConstructor::PlainYearMonthConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.PlainYearMonth.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.PlainYearMonth.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace JS::Temporal {
|
||||||
|
|
||||||
// 11.2 The Temporal.TimeZone Constructor, https://tc39.es/proposal-temporal/#sec-temporal-timezone-constructor
|
// 11.2 The Temporal.TimeZone Constructor, https://tc39.es/proposal-temporal/#sec-temporal-timezone-constructor
|
||||||
TimeZoneConstructor::TimeZoneConstructor(Realm& realm)
|
TimeZoneConstructor::TimeZoneConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.TimeZone.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.TimeZone.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace JS::Temporal {
|
||||||
|
|
||||||
// 6.1 The Temporal.ZonedDateTime Constructor, https://tc39.es/proposal-temporal/#sec-temporal-zoneddatetime-constructor
|
// 6.1 The Temporal.ZonedDateTime Constructor, https://tc39.es/proposal-temporal/#sec-temporal-zoneddatetime-constructor
|
||||||
ZonedDateTimeConstructor::ZonedDateTimeConstructor(Realm& realm)
|
ZonedDateTimeConstructor::ZonedDateTimeConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.ZonedDateTime.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.ZonedDateTime.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -478,7 +478,7 @@ void TypedArrayBase::visit_edges(Visitor& visitor)
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
ConstructorName::ConstructorName(Realm& realm) \
|
ConstructorName::ConstructorName(Realm& realm) \
|
||||||
: TypedArrayConstructor(vm().names.ClassName.as_string(), *realm.intrinsics().typed_array_constructor()) \
|
: TypedArrayConstructor(realm.vm().names.ClassName.as_string(), *realm.intrinsics().typed_array_constructor()) \
|
||||||
{ \
|
{ \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
|
|
|
@ -17,7 +17,7 @@ TypedArrayConstructor::TypedArrayConstructor(FlyString const& name, Object& prot
|
||||||
}
|
}
|
||||||
|
|
||||||
TypedArrayConstructor::TypedArrayConstructor(Realm& realm)
|
TypedArrayConstructor::TypedArrayConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.TypedArray.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.TypedArray.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
WeakMapConstructor::WeakMapConstructor(Realm& realm)
|
WeakMapConstructor::WeakMapConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.WeakMap.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.WeakMap.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
WeakRefConstructor::WeakRefConstructor(Realm& realm)
|
WeakRefConstructor::WeakRefConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.WeakRef.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.WeakRef.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
WeakSetConstructor::WeakSetConstructor(Realm& realm)
|
WeakSetConstructor::WeakSetConstructor(Realm& realm)
|
||||||
: NativeFunction(vm().names.WeakSet.as_string(), *realm.intrinsics().function_prototype())
|
: NativeFunction(realm.vm().names.WeakSet.as_string(), *realm.intrinsics().function_prototype())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue