Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning when minifying xqlint.js #70

Open
joewiz opened this issue Jan 9, 2017 · 1 comment
Open

Warning when minifying xqlint.js #70

joewiz opened this issue Jan 9, 2017 · 1 comment

Comments

@joewiz
Copy link
Contributor

joewiz commented Jan 9, 2017

In updating eXide to use the current xqlint (see the work-in-progress PR at wolfgangmm/eXide#141), I stumbled upon an "unreachable code" warning reported by the Google Closure compiler. I'm not sure if this is a real problem or not?

$ ant 
Buildfile: /Users/joe/workspace/hsg-project/repos/eXide/build.xml

xqlint:
     [echo] Optimizing xqlint ...
     [exec] npm WARN package.json [email protected] No license field.
     [exec] Running "browserify:browser_build" (browserify) task
     [exec] 
     [exec] Done, without errors.

check-closure-available:

get-closure:

prepare:

compress:
     [echo] Optimizing eXide sources
   [jscomp] None of the files changed. Compilation skipped.
   [jscomp] None of the files changed. Compilation skipped.
   [jscomp] Compiling 3 file(s) with 65 extern(s)
   [jscomp] support/xqlint/build/xqlint.js:1712: WARNING - unreachable code
   [jscomp]                     if(mod !== 0 && false) {
   [jscomp]                                            ^
   [jscomp] 0 error(s), 1 warning(s)

xar:
     [copy] Copying 1 file to /Users/joe/workspace/hsg-project/repos/eXide
     [copy] Copying 1 file to /Users/joe/workspace/hsg-project/repos/eXide
      [zip] Building zip: /Users/joe/workspace/hsg-project/repos/eXide/build/eXide-2.2.0.xar

all:

BUILD SUCCESSFUL
Total time: 18 seconds

Despite the "unreachable code" warning, the build does seem to succeed.

Background: eXide used to use rhino and r.js to compile xqlint, but since xqlint now uses grunt, I figured I should move eXide's build steps to grunt. I succeeded with that, but next I need to be able to merge and minify the three .js files in xqlint's build directory, which are produced by the browserify:browser_build grunt task, so I can then reference in eXide as "xqlint.min.js." I actually tried using grunt's uglify task to perform this, but failed at this. eXide already uses Closure for compressing other libraries, so I figured I would use it.

I'm not sure if this warning has any significance, but I thought it best to report the problem.

@wcandillon
Copy link
Owner

@joewiz Just static checks should ignore the generated parser files. Can you disable these checks for the generated files? (XQueryParser.js and so on).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants