1919#include < workerd/jsg/value.h>
2020#include < workerd/jsg/web-idl.h>
2121#include < workerd/jsg/wrappable.h>
22- #include < workerd/util/autogate.h>
2322
2423#include < v8-wasm.h>
2524
@@ -412,17 +411,15 @@ class TypeWrapper: public DynamicResourceTypeMap<Self>,
412411 public UnimplementedWrapper,
413412 public JsValueWrapper<Self> {
414413 // TODO(soon): Should the TypeWrapper object be stored on the isolate rather than the context?
415- bool fastApiEnabled = false ;
416-
417414 public:
418415 template <typename MetaConfiguration>
419416 TypeWrapper (v8::Isolate* isolate, MetaConfiguration&& configuration)
420417 : TypeWrapperBase<Self, T>(configuration)...,
421418 MaybeWrapper<Self>(configuration),
422419 GeneratorWrapper<Self>(configuration),
423- PromiseWrapper<Self>(configuration) {
420+ PromiseWrapper<Self>(configuration),
421+ config (getConfig(configuration)) {
424422 isolate->SetData (SET_DATA_TYPE_WRAPPER, this );
425- fastApiEnabled = util::Autogate::isEnabled (util::AutogateKey::V8_FAST_API);
426423 }
427424 KJ_DISALLOW_COPY_AND_MOVE (TypeWrapper);
428425
@@ -435,7 +432,7 @@ class TypeWrapper: public DynamicResourceTypeMap<Self>,
435432 }
436433
437434 bool isFastApiEnabled () const {
438- return fastApiEnabled;
435+ return config. fastApiEnabled ;
439436 }
440437
441438 using TypeWrapperBase<Self, T>::getName...;
@@ -600,6 +597,9 @@ class TypeWrapper: public DynamicResourceTypeMap<Self>,
600597 void initReflection (Holder* holder, PropertyReflection<U>&... reflections) {
601598 (initReflection (holder, reflections), ...);
602599 }
600+
601+ private:
602+ const JsgConfig config;
603603};
604604
605605template <typename Self, typename ... Types>
0 commit comments