thanhlong203 / closure-library

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

goog.testing.MethodMock and goog.testing.GlobalFunctionMock are not types #257

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If you try to compile the entire Closure Library with all checks enabled, you 
will get the following errors:

JSC_PARSE_ERROR. Parse error. Unknown type goog.testing.MethodMock at 
/closure/goog/testing/functionmock.js line 129 : 12
JSC_PARSE_ERROR. Parse error. Unknown type goog.testing.GlobalFunctionMock at 
/closure/goog/testing/functionmock.js line 153 : 12
JSC_PARSE_ERROR. Parse error. Unknown type goog.testing.MethodMock at 
/closure/goog/testing/mockcontrol.js line 189 : 12
JSC_PARSE_ERROR. Parse error. Unknown type goog.testing.GlobalFunctionMock at 
/closure/goog/testing/mockcontrol.js line 203 : 12
BUILD FAILED: 5 Errors, 0 Warnings

This is because neither goog.testing.MethodMock nor 
goog.testing.GlobalFunctionMock are declared with @constructor, so are not 
recognized as types (even though they are instantiated with the new 
constructor?).

Original issue reported on code.google.com by bolinf...@gmail.com on 9 Jan 2011 at 2:01

GoogleCodeExporter commented 8 years ago
functionmock_test fails, it has to be fixed first.

http://closure-library.googlecode.com/svn/trunk/closure/goog/testing/functionmoc
k_test.html

Original comment by pall...@google.com on 10 Jan 2011 at 12:41

GoogleCodeExporter commented 8 years ago
Fixed in r586.
I created issue 258 for the test failure.

Original comment by pall...@google.com on 11 Jan 2011 at 1:32

GoogleCodeExporter commented 8 years ago
Excellent -- thanks! I'm trying to compile the Closure Library with all
possible checks on, so this will help. Though as you can expect, there are a
lot of JSC_BAD_PRIVATE_PROPERTY_ACCESS and JSC_PRIVATE_OVERRIDE in the
codebase that will take longer to clean up.

Original comment by bolinf...@gmail.com on 11 Jan 2011 at 3:06

GoogleCodeExporter commented 8 years ago
Actually, can you now remove the goog.provide() statements for 
goog.testing.MethodMock and goog.testing.GlobalFunctionMock? Users should just 
be requiring goog.testing.

Original comment by bolinf...@gmail.com on 11 Jan 2011 at 7:26

GoogleCodeExporter commented 8 years ago
Rather, I think what should be done (for consistency) is to convert 
goog.testing.FunctionMock to goog.testing.createFunctionMock and then the 
goog.provide() should be removed.

Original comment by bolinf...@gmail.com on 11 Jan 2011 at 7:36