RC-Paves3-build / plovr

Automatically exported from code.google.com/p/plovr
0 stars 0 forks source link

Eliminate "unknown type" errors from un-provided deps #35

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  Create a file called "type-test.js" and a config file with the following 
content:

type-test.js
-----------------
goog.require('goog.net.XhrManager');

window.a = 5;

config.json
-----------------

{
  "id": "type-test",
  "paths": ["."],
  "inputs": "type-test.js",

  "mode": "ADVANCED",
  "level": "VERBOSE",
  "checks": {
    "checkTypes": "ERROR"
  }
}

2.  Build with the command "java -jar path/to/plovr.jar build config.json"
3.  View errors.

What is the expected output? What do you see instead?

I would expect the file to compile without errors.  Instead, I see:

[11:05:06 jyoung: /devel/test] $ java -jar /devel/clbin/plovr.jar build 
config.json 
JSC_PARSE_ERROR. Parse error. Unknown type goog.debug.ErrorHandler at 
/closure/goog/events/events.js line 871 : 34
JSC_PARSE_ERROR. Parse error. Unknown type goog.Uri at 
/closure/goog/net/xhrio.js line 148 : 26
JSC_PARSE_ERROR. Parse error. Unknown type goog.debug.ErrorHandler at 
/closure/goog/net/xhrio.js line 207 : 34
JSC_PARSE_ERROR. Parse error. Unknown type goog.Uri at 
/closure/goog/net/xhrio.js line 259 : 25
JSC_PARSE_ERROR. Parse error. Unknown type goog.Uri at 
/closure/goog/net/xhrio.js line 435 : 26
JSC_PARSE_ERROR. Parse error. Unknown type goog.Uri at 
/closure/goog/net/xhrio.js line 866 : 27
JSC_PARSE_ERROR. Parse error. Unknown type goog.net.XhrLite at 
/closure/goog/net/xhrmanager.js line 507 : 28
JSC_PARSE_ERROR. Parse error. Unknown type goog.net.XhrLite at 
/closure/goog/net/xhrmanager.js line 509 : 44
BUILD FAILED: 8 Errors, 0 Warnings

What version of the product are you using? On what operating system?

Head on Mac OS X

Please provide any additional information below.

This problem is fixed when using either closurebuilder.py or the compiler.jar 
directly by passing any relevant deps.js files as inputs to the compiler.  The 
work-around is to include bogus 'goog.addDependency()' calls into your code 
somewhere.

Original issue reported on code.google.com by JayYoung...@gmail.com on 11 Mar 2011 at 4:09

GoogleCodeExporter commented 8 years ago
fyi, com.google.javascript.jscomp.deps should have some java code for parsing 
deps files. i'll try to open-source a deps generator sometime this week.

Original comment by Nicholas.J.Santos on 21 Jun 2011 at 2:11

GoogleCodeExporter commented 8 years ago
http://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/jav
ascript/jscomp/deps/DepsGenerator.java?spec=svn1201&r=1201
might help with this

Original comment by Nicholas.J.Santos on 23 Jun 2011 at 1:20

GoogleCodeExporter commented 8 years ago
I believe that this should be fixed with my recent change: 
http://code.google.com/p/plovr/source/detail?r=ca24bbbaaf5787640291c5995a7dbf9f8
634b86d

Original comment by bolinf...@gmail.com on 14 Oct 2011 at 1:16

GoogleCodeExporter commented 8 years ago
Now that http://code.google.com/p/plovr/issues/detail?id=48 is fixed, I would 
say that it is safe to say that the new deps.js logic works, which means that 
the necessary goog.addDependency() calls are included automatically, fixing 
this bug.

Original comment by bolinf...@gmail.com on 8 Nov 2011 at 1:31