示例#1
0
        public void JsFormatter_SymbolicParameter_Global()
        {
            var symbol = new CodeSymbolicParameter();

            Assert.AreEqual("a+global",
                            new JsBinaryExpression(new JsMemberAccessExpression(new JsSymbolicParameter(symbol), "a"), BinaryOperatorType.Plus,
                                                   new JsSymbolicParameter(symbol))
                            .FormatParametrizedScript().ToString(o => o == symbol ? CodeParameterAssignment.FromExpression(new JsIdentifierExpression("global"), isGlobalContext: true) :
                                                                 throw new Exception()));
        }
示例#2
0
 public JsSymbolicParameter(CodeSymbolicParameter symbol, CodeParameterAssignment?defaultAssignment = null)
 {
     this.symbol            = symbol;
     this.defaultAssignment = defaultAssignment;
 }