HoriSun / closure-compiler

Automatically exported from code.google.com/p/closure-compiler
0 stars 0 forks source link

NullPointerException when compiling ZeroClipboard.js (version 1.0.5) in Advanced mode #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to compile 
http://zeroclipboard.googlecode.com/svn/trunk/ZeroClipboard.js in Advanced mode 
at http://closure-compiler.appspot.com/home

What is the expected output? What do you see instead?
Expected: closure-compiler to successfully compile the code/

Instead, the compiler crashes with this stack trace:

23: java.lang.NullPointerException
    at 
com.google.javascript.jscomp.CollapseProperties.updateObjLitOrFunctionD
eclaration(CollapseProperties.java:548)
    at 
com.google.javascript.jscomp.CollapseProperties.collapseDeclarationOfNa
meAndDescendants(CollapseProperties.java:445)
    at 
com.google.javascript.jscomp.CollapseProperties.collapseDeclarationOfNa
meAndDescendants(CollapseProperties.java:451)
    at 
com.google.javascript.jscomp.CollapseProperties.process(CollapsePropertie
s.java:143)
    at 
com.google.javascript.jscomp.PhaseOptimizer$PassFactoryDelegate.proces
sInternal(PhaseOptimizer.java:221)
    at 
com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process(PhaseO
ptimizer.java:198)
    at 
com.google.javascript.jscomp.PhaseOptimizer.process(PhaseOptimizer.java
:124)
    at 
com.google.javascript.jscomp.Compiler.optimize(Compiler.java:1314)
    at 
com.google.javascript.jscomp.Compiler.compileInternal(Compiler.java:555)
    at 
com.google.javascript.jscomp.Compiler.access$000(Compiler.java:65)
    at com.google.javascript.jscomp.Compiler$1.call(Compiler.java:462)
    at com.google.javascript.jscomp.Compiler$1.call(Compiler.java:460)
    at com.google.javascript.jscomp.Compiler$2.run(Compiler.java:494)
    at 
com.google.javascript.jscomp.Compiler.runInCompilerThread(Compiler.jav
a:517)
    at com.google.javascript.jscomp.Compiler.compile(Compiler.java:460)
    at com.google.javascript.jscomp.Compiler.compile(Compiler.java:429)
    at 
com.google.javascript.jscomp.webservice.backend.CompilerInvokerImpl.co
mpile(CompilerInvokerImpl.java:54)
    at 
com.google.javascript.jscomp.webservice.backend.ServerController.execute
Request(ServerController.java:179)
    at 
com.google.javascript.jscomp.webservice.backend.CompilationRequestHan
dler.service(CompilationRequestHandler.java:123)
    at 
com.google.javascript.jscomp.webservice.backend.CompilationRequestHan
dler.service(CompilationRequestHandler.java:103)
    at 
com.google.javascript.jscomp.webservice.frontend.CompilationServlet.doPo
st(CompilationServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
    at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandl
er.java:1093)
    at 
com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSession
Filter.java:35)
    at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandl
er.java:1084)
    at 
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Tran
sactionCleanupFilter.java:43)
    at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandl
er.java:1084)
    at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
    at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
    at 
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:40
5)
    at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppV
ersionHandlerMap.java:238)
    at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139
)
    at org.mortbay.jetty.Server.handle(Server.java:313)
    at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
    at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpCo
nnection.java:830)
    at 
com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(Rpc
RequestParser.java:76)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
    at 
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceReq
uest(JettyServletEngineAdapter.java:139)
    at 
com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.ja
va:239)
    at 
com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlock
ingRequest(RuntimePb.java:5135)
    at 
com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlock
ingRequest(RuntimePb.java:5133)
    at 
com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(Blocki
ngApplicationHandler.java:24)
    at 
com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:363)
    at com.google.net.rpc.impl.Server$2.run(Server.java:814)
    at 
com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.j
ava:56)
    at 
com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTrac
eSpanBuilder.java:516)
    at com.google.net.rpc.impl.Server.startRpc(Server.java:769)
    at com.google.net.rpc.impl.Server.processRequest(Server.java:351)
    at 
com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnec
tion.java:437)
    at 
com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.jav
a:319)
    at 
com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:
290)
    at 
com.google.net.async.Connection.handleReadEvent(Connection.java:436)
    at 
com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatc
her.java:762)
    at 
com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:2
07)
    at 
com.google.net.async.EventDispatcher.loop(EventDispatcher.java:101)
    at 
com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:25
1)
    at 
com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntim
e.java:396)
    at java.lang.Thread.run(Unknown Source)

Original Post Data: 
output_format=json&output_info=compiled_code&output_info=warnings&
output_info=errors&output_info=statistics&compilation_level=ADVANCED_
OPTIMIZATIONS&warning_level=verbose&code_url=http%3A%2F%2Fzeroclip
board.googlecode.com%2Fsvn%2Ftrunk%2FZeroClipboard.js&output_file_na
me=default.js&js_code=

Using the current version on http://closure-compiler.appspot.com/

Original issue reported on code.google.com by dieter.k...@gmail.com on 16 Nov 2009 at 10:19

GoogleCodeExporter commented 9 years ago
This snippets seems to let the compiler snap:

var ZeroClipboard = {
    $: function(thingy) {
        return thingy;
    }
}

changing the $ to something else makes the compiler happy

Original comment by dieter.k...@gmail.com on 16 Nov 2009 at 10:26

GoogleCodeExporter commented 9 years ago
Oops, this seems to be a duplicate of ticket #34

Original comment by dieter.k...@gmail.com on 16 Nov 2009 at 1:45

GoogleCodeExporter commented 9 years ago

Original comment by concavel...@gmail.com on 16 Nov 2009 at 4:35