|
236 | 236 | #include "StringIteratorPrototypeInlines.h"
|
237 | 237 | #include "StringObjectInlines.h"
|
238 | 238 | #include "StringPrototypeInlines.h"
|
| 239 | +#include "SuppressedError.h" |
| 240 | +#include "SuppressedErrorConstructorInlines.h" |
| 241 | +#include "SuppressedErrorPrototypeInlines.h" |
239 | 242 | #include "SymbolConstructorInlines.h"
|
240 | 243 | #include "SymbolObjectInlines.h"
|
241 | 244 | #include "SymbolPrototypeInlines.h"
|
@@ -821,6 +824,13 @@ void JSGlobalObject::initializeAggregateErrorConstructor(LazyClassStructure::Ini
|
821 | 824 | init.setConstructor(AggregateErrorConstructor::create(init.vm, AggregateErrorConstructor::createStructure(init.vm, this, m_errorStructure.constructor(this)), jsCast<AggregateErrorPrototype*>(init.prototype)));
|
822 | 825 | }
|
823 | 826 |
|
| 827 | +void JSGlobalObject::initializeSuppressedErrorConstructor(LazyClassStructure::Initializer& init) |
| 828 | +{ |
| 829 | + init.setPrototype(SuppressedErrorPrototype::create(init.vm, SuppressedErrorPrototype::createStructure(init.vm, this, m_errorStructure.prototype(this)))); |
| 830 | + init.setStructure(ErrorInstance::createStructure(init.vm, this, init.prototype)); |
| 831 | + init.setConstructor(SuppressedErrorConstructor::create(init.vm, SuppressedErrorConstructor::createStructure(init.vm, this, m_errorStructure.constructor(this)), jsCast<SuppressedErrorPrototype*>(init.prototype))); |
| 832 | +} |
| 833 | + |
824 | 834 | SUPPRESS_ASAN inline void JSGlobalObject::initStaticGlobals(VM& vm)
|
825 | 835 | {
|
826 | 836 | GlobalPropertyInfo staticGlobals[] = {
|
@@ -1272,6 +1282,12 @@ capitalName ## Constructor* lowerName ## Constructor = featureFlag ? capitalName
|
1272 | 1282 | [] (LazyClassStructure::Initializer& init) {
|
1273 | 1283 | init.global->initializeAggregateErrorConstructor(init);
|
1274 | 1284 | });
|
| 1285 | + if (Options::useExplicitResourceManagement()) { |
| 1286 | + m_suppressedErrorStructure.initLater( |
| 1287 | + [] (LazyClassStructure::Initializer& init) { |
| 1288 | + init.global->initializeSuppressedErrorConstructor(init); |
| 1289 | + }); |
| 1290 | + } |
1275 | 1291 |
|
1276 | 1292 | m_generatorFunctionPrototype.set(vm, this, GeneratorFunctionPrototype::create(vm, GeneratorFunctionPrototype::createStructure(vm, this, m_functionPrototype.get())));
|
1277 | 1293 | GeneratorFunctionConstructor* generatorFunctionConstructor = GeneratorFunctionConstructor::create(vm, GeneratorFunctionConstructor::createStructure(vm, this, functionConstructor), m_generatorFunctionPrototype.get());
|
@@ -1315,6 +1331,9 @@ capitalName ## Constructor* lowerName ## Constructor = featureFlag ? capitalName
|
1315 | 1331 | if (Options::useSharedArrayBuffer())
|
1316 | 1332 | putDirectWithoutTransition(vm, vm.propertyNames->SharedArrayBuffer, m_sharedArrayBufferStructure.constructor(this), static_cast<unsigned>(PropertyAttribute::DontEnum));
|
1317 | 1333 |
|
| 1334 | + if (Options::useExplicitResourceManagement()) |
| 1335 | +<
1E0A
/span> putDirectWithoutTransition(vm, vm.propertyNames->SuppressedError, m_suppressedErrorStructure.constructor(this), static_cast<unsigned>(PropertyAttribute::DontEnum)); |
| 1336 | + |
1318 | 1337 | #define PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \
|
1319 | 1338 | if (featureFlag) \
|
1320 | 1339 | putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Constructor, static_cast<unsigned>(PropertyAttribute::DontEnum));
|
@@ -2572,6 +2591,7 @@ void JSGlobalObject::visitChildrenImpl(JSCell* cell, Visitor& visitor)
|
2572 | 2591 | thisObject->m_typeErrorStructure.visit(visitor);
|
2573 | 2592 | thisObject->m_URIErrorStructure.visit(visitor);
|
2574 | 2593 | thisObject->m_aggregateErrorStructure.visit(visitor);
|
| 2594 | + thisObject->m_suppressedErrorStructure.visit(visitor); |
2575 | 2595 | visitor.append(thisObject->m_arrayConstructor);
|
2576 | 2596 | visitor.append(thisObject->m_shadowRealmConstructor);
|
2577 | 2597 | visitor.append(thisObject->m_regExpConstructor);
|
|
0 commit comments