public void RegularExpressionLiteralsAreCorrectlyEncoded() { AssertCorrect(JsExpression.Regexp("x"), "/x/"); AssertCorrect(JsExpression.Regexp("\""), "/\"/"); AssertCorrect(JsExpression.Regexp("/"), "/\\//"); AssertCorrect(JsExpression.Regexp("\r\n/\\"), "/\\r\\n\\/\\\\/"); AssertCorrect(JsExpression.Regexp("x", "g"), "/x/g"); }
public void RegularExpressionLiteralsAreCorrectlyEncoded() { AssertCorrect(JsExpression.Regexp("x"), "/x/"); AssertCorrect(JsExpression.Regexp("\""), "/\"/"); AssertCorrect(JsExpression.Regexp("/"), "/\\//"); AssertCorrect(JsExpression.Regexp("'"), "/'/"); AssertCorrect(JsExpression.Regexp("\""), "/\"/"); AssertCorrect(JsExpression.Regexp("x", "g"), "/x/g"); AssertCorrect(JsExpression.Regexp(@"\s \\ x"), @"/\s \\ x/"); }