File: html_comments.js

package info (click to toggle)
node-terser 5.46.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,248 kB
  • sloc: javascript: 101,516; makefile: 52; perl: 48; sh: 13
file content (85 lines) | stat: -rw-r--r-- 1,987 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
html_comment_in_expression: {
    input: {
        function f(a, b, x, y) { return a < !--b && x-- > y; }
    }
    expect_exact: "function f(a,b,x,y){return a<! --b&&x-- >y}";
}

html_comment_in_less_than: {
    input: {
        function f(a, b) { return a < !--b; }
    }
    expect_exact: "function f(a,b){return a<! --b}";
}

html_comment_in_left_shift: {
    input: {
        function f(a, b) { return a << !--b; }
    }
    expect_exact: "function f(a,b){return a<<! --b}";
}

html_comment_in_right_shift: {
    input: {
        function f(a, b) { return a-- >> b; }
    }
    expect_exact: "function f(a,b){return a-- >>b}";
}

html_comment_in_zero_fill_right_shift: {
    input: {
        function f(a, b) { return a-- >>> b; }
    }
    expect_exact: "function f(a,b){return a-- >>>b}";
}

html_comment_in_greater_than: {
    input: {
        function f(a, b) { return a-- > b; }
    }
    expect_exact: "function f(a,b){return a-- >b}";
}

html_comment_in_greater_than_or_equal: {
    input: {
        function f(a, b) { return a-- >= b; }
    }
    expect_exact: "function f(a,b){return a-- >=b}";
}

html_comment_in_string_literal: {
    input: {
        function f() { return "<!--HTML-->comment in<!--string literal-->"; }
    }
    expect_exact: 'function f(){return"\\x3c!--HTML--\\x3ecomment in\\x3c!--string literal--\\x3e"}';
}

script_tag_in_comparison: {
    input: {
        function f() { return 0 < (/script>/).test(); }
    }
    expect_exact: 'function f(){return 0< /script>/.test()}';
}

html_comment_in_negated_comparison: {
    input: {
        function f() { return 1 < (!--x + 1); }
    }
    expect_exact: 'function f(){return 1<! --x+1}';
}

html_comment_in_negated_comparison_2: {
    input: {
        function f() { return !x-- > 1; }
    }
    expect_exact: 'function f(){return!x-- >1}';
}

html_comment_after_multiline_comment: {
    input: {
        var foo; /*
*/-->   var bar;
        var foobar;
    }
    expect_exact: "var foo;var foobar;"
}