Skip to content
Merged
17 changes: 17 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"bitwise": true,
"curly": true,
"eqeqeq": true,
"evil": true,
"forin": true,
"freeze": true,
"latedef": true,
"loopfunc": true,
"noarg": true,
"nonew": true,
"proto": true,
"rhino": false,
"strict": "implied",
"undef": true,
"unused": "vars"
}
31 changes: 27 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,25 @@
<exec executable="java" failonerror="true">
<arg line="-jar"/>
<arg path="${lib.dir}/js.jar"/>
<arg line="-opt -1"/>
<arg path="${lib.dir}/jshint.js" />
<arg line="${jsfiles.clean} curly=true,forin=true,latedef=true,evil=true,loopfunc=true,undef=true,rhino=false" />
<arg line="${jsfiles.clean}" />
</exec>
</target>

<!-- validate npm build file with JSHint -->
<target name="lint.node" depends="build.node">
<exec executable="java" failonerror="true">
<arg line="-jar"/>
<arg path="${lib.dir}/js.jar"/>
<arg line="-opt -1"/>
<arg path="${lib.dir}/jshint.js" />
<arg path="${build.dir}/${node.build.file}" />
</exec>
</target>

<!-- run tests on the command line -->
<target name="test" depends="lint,build.all">
<target name="test" depends="lint,build.all,lint.node">
<apply executable="java" failonerror="true">
<arg line="-Xss16M"/>
<fileset dir="${tests.dir}" includes="**/*.js"/>
Expand All @@ -112,13 +124,14 @@
${license.text}
*/
/* Version v@VERSION@, Build time: ${RIGHT_NOW} */
var parserlib = {};
var parserlib = Object.create(null);
(function(){
</header>
<!--<filelist dir="${src.dir}/util" files="EventTarget.js, StringReader.js, TokenStream.js"/> -->
<fileset dir="${src.dir}/util" includes="*.js" />
<footer trimleading="yes">
parserlib.util = {
__proto__ : null,
StringReader: StringReader,
SyntaxError : SyntaxError,
SyntaxUnit : SyntaxUnit,
Expand All @@ -141,14 +154,15 @@
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
StringReader = parserlib.util.StringReader,
StringReader = parserlib.util.StringReader, // jshint ignore:line
SyntaxError = parserlib.util.SyntaxError,
SyntaxUnit = parserlib.util.SyntaxUnit;
</header>
<!--<filelist dir="${src.dir}/css" files="CSSTokens.js, CSSSelectorUnit.js, CSSColors.js, CSSValueUnit.js, CSSParser.js"/>-->
<fileset dir="${src.dir}/css" includes="*.js" />
<footer trimleading="yes">
parserlib.css = {
__proto__ :null,
Colors :Colors,
Combinator :Combinator,
Parser :Parser,
Expand Down Expand Up @@ -176,14 +190,23 @@
<target name="build.node">

<concat destfile="${build.dir}/${node.build.file}" fixlastline="true">
<header trimleading="yes">/* jshint node:true, latedef:false */
"use strict"; // jshint ignore:line
</header>
<filelist dir="${build.dir}" files="${core.build.file}, ${css.build.file}"/>
<footer trimleading="yes">
(function(){
/* jshint forin:false */
for(var prop in parserlib){
exports[prop] = parserlib[prop];
}
})();
</footer>
<filterchain>
<linecontainsregexp negate="true">
<regexp pattern="^/[*](global|exported) .*[*]/$"/>
</linecontainsregexp>
</filterchain>
</concat>

<mkdir dir="${build.npm.dir}"/>
Expand Down
Binary file modified lib/js.jar
Binary file not shown.
Loading