Skip to content

Instantly share code, notes, and snippets.

@chrisdone
Created September 2, 2011 11:42
Show Gist options
  • Save chrisdone/1188422 to your computer and use it in GitHub Desktop.
Save chrisdone/1188422 to your computer and use it in GitHub Desktop.
closure test
testcase.js
/*
* Demo func
* @param {yes:function()} config
*/
function foo(config){
if(config.yes()){
return true;
} else {
return false;
}
}
testcase:
java -jar /home/chris/JavaScript/closure-compiler/compiler.jar \
--jscomp_dev_mode EVERY_PASS \
--warning_level VERBOSE \
--compilation_level ADVANCED_OPTIMIZATIONS \
--jscomp_error checkTypes \
--js_output_file /dev/null \
--js testcase.js \
$ sh testcase
testcase.js:6: ERROR - Property yes never defined on config
if(config.yes()){
^
1 error(s), 0 warning(s), 57.1% typed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment