// Copyright (c) 2023 Cloudflare, Inc. // Licensed under the Apache 2.0 license found in the LICENSE file or at: // https://opensource.org/licenses/Apache-2.0 #pragma once #include #include namespace workerd { struct FeatureFlags { FeatureFlags() = delete; // Get the feature flags that are relevant for the current jsg::Lock or // throw if we are not currently executing JavaScript. static CompatibilityFlags::Reader get(jsg::Lock&); // Alternative to get() that returns kj::none if the flags are not available. // This is typically only the case in certain tests where we may only partially // initialize the JS environment. static kj::Maybe tryGet(jsg::Lock&); }; } // namespace workerd