public virtual void TestMultiThread() { DynamicVariable variable = new DynamicVariable(); Collection4 failures = new Collection4(); variable.With("mine", new _IRunnable_23(this, variable, failures)); Assert.IsNull(variable.Value); Assert.IsTrue(failures.IsEmpty(), failures.ToString()); }
public Method CreateMethodFromPrototype(LexicalInfo location, IMethod baseMethod, TypeMemberModifiers newModifiers, string newMethodName) { var method = new Method(location); method.Name = newMethodName; method.Modifiers = newModifiers; method.IsSynthetic = true; var optionalTypeMappings = DeclareGenericParametersFromPrototype(method, baseMethod); var typeReferenceFactory = optionalTypeMappings != null ? new MappedTypeReferenceFactory(TypeReferenceFactory, optionalTypeMappings) : TypeReferenceFactory; _typeReferenceFactory.With(typeReferenceFactory, () => { DeclareParameters(method, baseMethod.GetParameters(), baseMethod.IsStatic ? 0 : 1); method.ReturnType = CreateTypeReference(baseMethod.ReturnType); }); EnsureEntityFor(method); return(method); }
private void CheckVariableBehavior(DynamicVariable variable) { Assert.IsNull(variable.Value); variable.With("foo", new _IRunnable_75(variable)); Assert.IsNull(variable.Value); }
private void ExpandModuleGlobalsIgnoringUnknownMacros(Module current) { _ignoringUnknownMacros.With(true, () => ExpandOnModuleNamespace(current, VisitGlobalsAllowingCancellation)); }
public static void Run(IRunnable runnable) { _inCallback.With(true, runnable); }