<commit_before>var registerSystem = require('../core/system').registerSystem;

/**
 * WebXR session initialization and XR module support.
 */
module.exports.System = registerSystem('webxr', {
  schema: {
    requiredFeatures: {type: 'array', default: ['local-floor']},
    optionalFeatures: {type: 'array', default: ['bounded-floor']},
    overlayElement: {type: 'selector'}
  },

  update: function () {
    var data = this.data;
    this.sessionConfiguration = {
      requiredFeatures: data.requiredFeatures,
      optionalFeatures: data.optionalFeatures
    };

    if (data.overlayElement) {
      this.warnIfFeatureNotRequested('dom-overlay');
      this.sessionConfiguration.domOverlay = {root: data.overlayElement};
    }
  },

  wasFeatureRequested: function (feature) {
    // Features available by default for immersive sessions don't need to
    // be requested explicitly.
    if (feature === 'viewer' || feature === 'local') return true;

    if (this.sessionConfiguration.requiredFeatures.includes(feature) ||
        this.sessionConfiguration.requiredFeatures.includes(feature)) {
      return true;
    }

    return false;
  },

  warnIfFeatureNotRequested: function (feature, optIntro) {
    if (!this.wasFeatureRequested(feature)) {
      var msg = 'Please add the feature "' + feature + '" to a-scene\'s ' +
          'webxr system options in requiredFeatures/optionalFeatures.';
      console.warn((optIntro ? optIntro + ' ' : '') + msg);
    }
  }
});<commit_msg>Fix typo in webxr system for feature warning (#4524)<commit_after>var registerSystem = require('../core/system').registerSystem;

/**
 * WebXR session initialization and XR module support.
 */
module.exports.System = registerSystem('webxr', {
  schema: {
    requiredFeatures: {type: 'array', default: ['local-floor']},
    optionalFeatures: {type: 'array', default: ['bounded-floor']},
    overlayElement: {type: 'selector'}
  },

  update: function () {
    var data = this.data;
    this.sessionConfiguration = {
      requiredFeatures: data.requiredFeatures,
      optionalFeatures: data.optionalFeatures
    };

    if (data.overlayElement) {
      this.warnIfFeatureNotRequested('dom-overlay');
      this.sessionConfiguration.domOverlay = {root: data.overlayElement};
    }
  },

  wasFeatureRequested: function (feature) {
    // Features available by default for immersive sessions don't need to
    // be requested explicitly.
    if (feature === 'viewer' || feature === 'local') return true;

    if (this.sessionConfiguration.requiredFeatures.includes(feature) ||
        this.sessionConfiguration.optionalFeatures.includes(feature)) {
      return true;
    }

    return false;
  },

  warnIfFeatureNotRequested: function (feature, optIntro) {
    if (!this.wasFeatureRequested(feature)) {
      var msg = 'Please add the feature "' + feature + '" to a-scene\'s ' +
          'webxr system options in requiredFeatures/optionalFeatures.';
      console.warn((optIntro ? optIntro + ' ' : '') + msg);
    }
  }
});
{'fraction_non_alphanumeric': 0.13384257721687148, 'fraction_numerical': 0.001328462304882099, 'mean_word_length': 3.5157421289355324, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3997321', 'n_tokens_mistral': 852, 'n_tokens_neox': 829, 'n_words': 198}