Пример #1
0
        public Realm CreateRealm(string name = "")
        {
            var newRealm = new Realm(this, name);

            newRealm.SetRealmGlobalObject(null, null);
            newRealm.SetDefaultGlobalBindings();
            return(newRealm);
        }
Пример #2
0
        /// <summary>
        /// Creates an Agent.
        /// </summary>
        public Agent()
        {
            //https://tc39.github.io/ecma262/#sec-initializehostdefinedrealm

            var realm      = new Realm(this, "Default");
            var newContext = new ExecutionContext(realm, null, true);

            ExecutionContexts.Add(newContext);
            RunningExecutionContext = newContext;
            realm.SetRealmGlobalObject(null, null);
            realm.SetDefaultGlobalBindings();
        }