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())); }
public JsSymbolicParameter(CodeSymbolicParameter symbol, CodeParameterAssignment?defaultAssignment = null) { this.symbol = symbol; this.defaultAssignment = defaultAssignment; }