@next-core/brick-utils 2.43.8 → 2.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23582,16 +23582,20 @@
23582
23582
  attemptToVisitGlobals,
23583
23583
  source
23584
23584
  } = preevaluate(ifContainer.if);
23585
- var hasOtherThanFlags = false;
23585
+ var {
23586
+ constantFeatureFlags,
23587
+ featureFlags
23588
+ } = options;
23589
+ var hasDynamicVariables = false;
23586
23590
 
23587
23591
  for (var _item4 of attemptToVisitGlobals) {
23588
- if (_item4 !== "undefined" && _item4 !== "FLAGS") {
23589
- hasOtherThanFlags = true;
23592
+ if (_item4 !== "undefined" && (!constantFeatureFlags || _item4 !== "FLAGS")) {
23593
+ hasDynamicVariables = true;
23590
23594
  break;
23591
23595
  }
23592
23596
  }
23593
23597
 
23594
- if (hasOtherThanFlags) {
23598
+ if (hasDynamicVariables) {
23595
23599
  if (isConstantLogical(expression, false, options)) {
23596
23600
  if (process.env.NODE_ENV === "development") {
23597
23601
  // eslint-disable-next-line no-console
@@ -23604,24 +23608,22 @@
23604
23608
  return;
23605
23609
  }
23606
23610
 
23607
- var {
23608
- constantFeatureFlags,
23609
- featureFlags
23610
- } = options;
23611
+ var originalIf = ifContainer.if;
23612
+ var globalVariables = {
23613
+ undefined: undefined
23614
+ };
23611
23615
 
23612
23616
  if (constantFeatureFlags) {
23613
- var originalIf = ifContainer.if;
23614
- ifContainer.if = !!cook(expression, source, {
23615
- globalVariables: {
23616
- undefined: undefined,
23617
- FLAGS: featureFlags
23618
- }
23619
- });
23617
+ globalVariables.FLAGS = featureFlags;
23618
+ }
23620
23619
 
23621
- if (process.env.NODE_ENV === "development" && ifContainer.if === false) {
23622
- // eslint-disable-next-line no-console
23623
- console.warn("[removed dead if]:", originalIf, ifContainer);
23624
- }
23620
+ ifContainer.if = !!cook(expression, source, {
23621
+ globalVariables
23622
+ });
23623
+
23624
+ if (process.env.NODE_ENV === "development" && ifContainer.if === false) {
23625
+ // eslint-disable-next-line no-console
23626
+ console.warn("[removed dead if]:", originalIf, ifContainer);
23625
23627
  }
23626
23628
  } catch (error) {
23627
23629
  // eslint-disable-next-line no-console