Beispiel #1
0
 internal void SetAssumedGlobals(CodeSettings settings)
 {
     if (settings != null)
     {
         // start off with any known globals
         m_assumedGlobals = settings.KnownGlobalCollection == null ? new HashSet<string>() : new HashSet<string>(settings.KnownGlobalCollection);
     }
     else
     {
         // empty set
         m_assumedGlobals = new HashSet<string>();
     }
 }
Beispiel #2
0
        /// <summary>
        /// Instantiate a new CodeSettings object with the same settings as the current object.
        /// </summary>
        /// <returns>a copy CodeSettings object</returns>
        public CodeSettings Clone()
        {
            // create a new settings object and set all the properties using this settings object
            var newSettings = new CodeSettings()
            {
                ConstStatementsMozilla = this.ConstStatementsMozilla,
                KnownGlobalNamesList = this.KnownGlobalNamesList,
                SourceMode = this.SourceMode,
                StrictMode = this.StrictMode,
                AllowShebangLine = this.AllowShebangLine
            };

            return newSettings;
        }