Go to the documentation of this file.
9 array(
"\r\t\f \v\n\r",
"" ),
10 array(
"/* Foo *\n*bar\n*/",
"" ),
17 array(
"/**\n * Foo\n * {\n * 'bar' : {\n * //Multiple rules with configurable operators\n * 'baz' : false\n * }\n */",
"" ),
23 array(
"' Foo \\' bar \\\n baz \\' quox ' .length",
"' Foo \\' bar \\\n baz \\' quox '.length" ),
24 array(
"\" Foo \\\" bar \\\n baz \\\" quox \" .length",
"\" Foo \\\" bar \\\n baz \\\" quox \".length" ),
25 array(
"// Foo b/ar baz",
"" ),
26 array(
"/ Foo \\/ bar [ / \\] / ] baz / .length",
"/ Foo \\/ bar [ / \\] / ] baz /.length" ),
29 array(
"<!-- Foo bar",
"" ),
30 array(
"<!-- Foo --> bar",
"" ),
31 array(
"--> Foo",
"" ),
32 array(
"x --> y",
"x-->y" ),
35 array(
"(function(){return\nx;})",
"(function(){return\nx;})" ),
36 array(
"throw\nx;",
"throw\nx;" ),
37 array(
"while(p){continue\nx;}",
"while(p){continue\nx;}" ),
38 array(
"while(p){break\nx;}",
"while(p){break\nx;}" ),
39 array(
"var\nx;",
"var x;" ),
40 array(
"x\ny;",
"x\ny;" ),
41 array(
"x\n++y;",
"x\n++y;" ),
42 array(
"x\n!y;",
"x\n!y;" ),
43 array(
"x\n{y}",
"x\n{y}" ),
44 array(
"x\n+y;",
"x+y;" ),
45 array(
"x\n(y);",
"x(y);" ),
46 array(
"5.\nx;",
"5.\nx;" ),
47 array(
"0xFF.\nx;",
"0xFF.x;" ),
48 array(
"5.3.\nx;",
"5.3.x;" ),
52 array(
"var a = this //foo bar \n for ( b = 0; c < d; b++ ) {}",
"var a=this\nfor(b=0;c<d;b++){}" ),
55 array(
"x in y",
"x in y" ),
56 array(
"/x/g in y",
"/x/g in y" ),
57 array(
"x in 30",
"x in 30" ),
58 array(
"x + ++ y",
"x+ ++y" ),
59 array(
"x ++ + y",
"x++ +y" ),
60 array(
"x / /y/.exec(z)",
"x/ /y/.exec(z)" ),
63 array(
"/ x/g",
"/ x/g" ),
64 array(
"(function(){return/ x/g})",
"(function(){return/ x/g})" ),
65 array(
"+/ x/g",
"+/ x/g" ),
66 array(
"++/ x/g",
"++/ x/g" ),
67 array(
"x/ x/g",
"x/x/g" ),
68 array(
"(/ x/g)",
"(/ x/g)" ),
69 array(
"if(/ x/g);",
"if(/ x/g);" ),
70 array(
"(x/ x/g)",
"(x/x/g)" ),
71 array(
"([/ x/g])",
"([/ x/g])" ),
72 array(
"+x/ x/g",
"+x/x/g" ),
73 array(
"{}/ x/g",
"{}/ x/g" ),
74 array(
"+{}/ x/g",
"+{}/x/g" ),
75 array(
"(x)/ x/g",
"(x)/x/g" ),
76 array(
"if(x)/ x/g",
"if(x)/ x/g" ),
77 array(
"for(x;x;{}/ x/g);",
"for(x;x;{}/x/g);" ),
78 array(
"x;x;{}/ x/g",
"x;x;{}/ x/g" ),
79 array(
"x:{}/ x/g",
"x:{}/ x/g" ),
80 array(
"switch(x){case y?z:{}/ x/g:{}/ x/g;}",
"switch(x){case y?z:{}/x/g:{}/ x/g;}" ),
81 array(
"function x(){}/ x/g",
"function x(){}/ x/g" ),
82 array(
"+function x(){}/ x/g",
"+function x(){}/x/g" ),
85 array(
"var foo=\"\\\nblah\\\n\";",
"var foo=\"\\\nblah\\\n\";" ),
88 array(
"var foo=\"\\\nblah\\\n\";\nvar baz = \" foo \";\n",
"var foo=\"\\\nblah\\\n\";var baz=\" foo \";" ),
91 array(
"aNode.setAttribute('href','http://foo.bar.org/baz');",
"aNode.setAttribute('href','http://foo.bar.org/baz');" ),
94 array(
"var foo=\"\\\nblah\\\n\";\naNode.setAttribute('href','http://foo.bar.org/baz');",
"var foo=\"\\\nblah\\\n\";aNode.setAttribute('href','http://foo.bar.org/baz');" ),
97 array(
"alert( (10+10) / '/'.charCodeAt( 0 ) + '//' );",
"alert((10+10)/'/'.charCodeAt(0)+'//');" ),
98 array(
"if(1)/a /g.exec('Pa ss');",
"if(1)/a /g.exec('Pa ss');" ),
101 array( str_repeat(
';', 996 ) .
"if(x++);", str_repeat(
';', 996 ) .
"if(x++\n);" ),
104 array(
"var KaŝSkatolVal = {}",
'var KaŝSkatolVal={}' ),
108 array(
"var Ka\\u015dSkatolVal = {}",
'var Ka\\u015dSkatolVal={}' ),
111 array(
"var a = 5.;",
"var a=5.;" ),
112 array(
"5.0.toString();",
"5.0.toString();" ),
113 array(
"5..toString();",
"5..toString();" ),
114 array(
"5...toString();",
false ),
115 array(
"5.\n.toString();",
'5..toString();' ),
131 $parser->parse( $minified,
'minify-test.js', 1 );
133 $this->assertEquals( $expectedOutput, $minified,
"Minified output should be in the form expected." );
163 $prefix =
'var longVarName' . str_repeat(
'_', 973 ) .
'=';
164 $suffix =
',shortVarName=0;';
166 $input = $prefix . $num . $suffix;
167 $expected = $prefix .
"\n" . $num . $suffix;
171 $this->assertEquals( $expected, $minified,
"Line breaks must not occur in middle of exponent" );
testJavaScriptMinifierOutput( $code, $expectedOutput)
@dataProvider provideCases @covers JavaScriptMinifier::minify
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
wfSuppressWarnings( $end=false)
Reference-counted warning suppression.
static minify( $s, $statementsOnOwnLine=false, $maxLineLength=1000)
Returns minified JavaScript code.
wfRestoreWarnings()
Restore error level to previous value.
do that in ParserLimitReportFormat instead $parser
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
testBug32548Exponent( $num)
@dataProvider provideBug32548 @covers JavaScriptMinifier::minify