PageRenderTime 19ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/src/main/webapp/lib/yui3/build/yql/yql-coverage.js

https://gitlab.com/fxaeberhard/Wedance-java
JavaScript | 271 lines | 159 code | 20 blank | 92 comment | 19 complexity | ef30ecc90410b4634e84ddf639afb937 MD5 | raw file
  1. /*
  2. YUI 3.8.0 (build 5744)
  3. Copyright 2012 Yahoo! Inc. All rights reserved.
  4. Licensed under the BSD License.
  5. http://yuilibrary.com/license/
  6. */
  7. if (typeof _yuitest_coverage == "undefined"){
  8. _yuitest_coverage = {};
  9. _yuitest_coverline = function(src, line){
  10. var coverage = _yuitest_coverage[src];
  11. if (!coverage.lines[line]){
  12. coverage.calledLines++;
  13. }
  14. coverage.lines[line]++;
  15. };
  16. _yuitest_coverfunc = function(src, name, line){
  17. var coverage = _yuitest_coverage[src],
  18. funcId = name + ":" + line;
  19. if (!coverage.functions[funcId]){
  20. coverage.calledFunctions++;
  21. }
  22. coverage.functions[funcId]++;
  23. };
  24. }
  25. _yuitest_coverage["build/yql/yql.js"] = {
  26. lines: {},
  27. functions: {},
  28. coveredLines: 0,
  29. calledLines: 0,
  30. coveredFunctions: 0,
  31. calledFunctions: 0,
  32. path: "build/yql/yql.js",
  33. code: []
  34. };
  35. _yuitest_coverage["build/yql/yql.js"].code=["YUI.add('yql', function (Y, NAME) {","","/**"," * This class adds a sugar class to allow access to YQL (http://developer.yahoo.com/yql/)."," * @module yql"," */","/**"," * Utility Class used under the hood my the YQL class"," * @class YQLRequest"," * @constructor"," * @param {String} sql The SQL statement to execute"," * @param {Function/Object} callback The callback to execute after the query (Falls through to JSONP)."," * @param {Object} params An object literal of extra parameters to pass along (optional)."," * @param {Object} opts An object literal of configuration options (optional): proto (http|https), base (url)"," */","var YQLRequest = function (sql, callback, params, opts) {",""," if (!params) {"," params = {};"," }"," params.q = sql;"," //Allow format override.. JSON-P-X"," if (!params.format) {"," params.format = Y.YQLRequest.FORMAT;"," }"," if (!params.env) {"," params.env = Y.YQLRequest.ENV;"," }",""," this._context = this;",""," if (opts && opts.context) {"," this._context = opts.context;"," delete opts.context;"," }",""," if (params && params.context) {"," this._context = params.context;"," delete params.context;"," }",""," this._params = params;"," this._opts = opts;"," this._callback = callback;","","};","","YQLRequest.prototype = {"," /**"," * @private"," * @property _jsonp"," * @description Reference to the JSONP instance used to make the queries"," */"," _jsonp: null,"," /**"," * @private"," * @property _opts"," * @description Holder for the opts argument"," */"," _opts: null,"," /**"," * @private"," * @property _callback"," * @description Holder for the callback argument"," */"," _callback: null,"," /**"," * @private"," * @property _params"," * @description Holder for the params argument"," */"," _params: null,"," /**"," * @private"," * @property _context"," * @description The context to execute the callback in"," */"," _context: null,"," /**"," * @private"," * @method _internal"," * @description Internal Callback Handler"," */"," _internal: function () {"," this._callback.apply(this._context, arguments);"," },"," /**"," * @method send"," * @description The method that executes the YQL Request."," * @chainable"," * @return {YQLRequest}"," */"," send: function () {"," var qs = [], url = ((this._opts && this._opts.proto) ? this._opts.proto : Y.YQLRequest.PROTO), o;",""," Y.each(this._params, function (v, k) {"," qs.push(k + '=' + encodeURIComponent(v));"," });",""," qs = qs.join('&');",""," url += ((this._opts && this._opts.base) ? this._opts.base : Y.YQLRequest.BASE_URL) + qs;",""," o = (!Y.Lang.isFunction(this._callback)) ? this._callback : { on: { success: this._callback } };",""," o.on = o.on || {};"," this._callback = o.on.success;",""," o.on.success = Y.bind(this._internal, this);",""," this._send(url, o);"," return this;"," },"," /**"," * Private method to send the request, overwritten in plugins"," * @method _send"," * @private"," * @param {String} url The URL to request"," * @param {Object} o The config object"," */"," _send: function(url, o) {"," if (o.allowCache !== false) {"," o.allowCache = true;"," }"," if (!this._jsonp) {"," this._jsonp = Y.jsonp(url, o);"," } else {"," this._jsonp.url = url;"," if (o.on && o.on.success) {"," this._jsonp._config.on.success = o.on.success;"," }"," this._jsonp.send();"," }"," }","};","","/**","* @static","* @property FORMAT","* @description Default format to use: json","*/","YQLRequest.FORMAT = 'json';","/**","* @static","* @property PROTO","* @description Default protocol to use: http","*/","YQLRequest.PROTO = 'http';","/**","* @static","* @property BASE_URL","* @description The base URL to query: query.yahooapis.com/v1/public/yql?","*/","YQLRequest.BASE_URL = ':/' + '/query.yahooapis.com/v1/public/yql?';","/**","* @static","* @property ENV","* @description The environment file to load: http://datatables.org/alltables.env","*/","YQLRequest.ENV = 'http:/' + '/datatables.org/alltables.env';","","Y.YQLRequest = YQLRequest;","","/**"," * This class adds a sugar class to allow access to YQL (http://developer.yahoo.com/yql/)."," * @class YQL"," * @constructor"," * @param {String} sql The SQL statement to execute"," * @param {Function} callback The callback to execute after the query (optional)."," * @param {Object} params An object literal of extra parameters to pass along (optional)."," * @param {Object} opts An object literal of configuration options (optional): proto (http|https), base (url)"," */","Y.YQL = function (sql, callback, params, opts) {"," return new Y.YQLRequest(sql, callback, params, opts).send();","};","","","}, '3.8.0', {\"requires\": [\"jsonp\", \"jsonp-url\"]});"];
  36. _yuitest_coverage["build/yql/yql.js"].lines = {"1":0,"16":0,"18":0,"19":0,"21":0,"23":0,"24":0,"26":0,"27":0,"30":0,"32":0,"33":0,"34":0,"37":0,"38":0,"39":0,"42":0,"43":0,"44":0,"48":0,"85":0,"94":0,"96":0,"97":0,"100":0,"102":0,"104":0,"106":0,"107":0,"109":0,"111":0,"112":0,"122":0,"123":0,"125":0,"126":0,"128":0,"129":0,"130":0,"132":0,"142":0,"148":0,"154":0,"160":0,"162":0,"173":0,"174":0};
  37. _yuitest_coverage["build/yql/yql.js"].functions = {"YQLRequest:16":0,"_internal:84":0,"(anonymous 2):96":0,"send:93":0,"_send:121":0,"YQL:173":0,"(anonymous 1):1":0};
  38. _yuitest_coverage["build/yql/yql.js"].coveredLines = 47;
  39. _yuitest_coverage["build/yql/yql.js"].coveredFunctions = 7;
  40. _yuitest_coverline("build/yql/yql.js", 1);
  41. YUI.add('yql', function (Y, NAME) {
  42. /**
  43. * This class adds a sugar class to allow access to YQL (http://developer.yahoo.com/yql/).
  44. * @module yql
  45. */
  46. /**
  47. * Utility Class used under the hood my the YQL class
  48. * @class YQLRequest
  49. * @constructor
  50. * @param {String} sql The SQL statement to execute
  51. * @param {Function/Object} callback The callback to execute after the query (Falls through to JSONP).
  52. * @param {Object} params An object literal of extra parameters to pass along (optional).
  53. * @param {Object} opts An object literal of configuration options (optional): proto (http|https), base (url)
  54. */
  55. _yuitest_coverfunc("build/yql/yql.js", "(anonymous 1)", 1);
  56. _yuitest_coverline("build/yql/yql.js", 16);
  57. var YQLRequest = function (sql, callback, params, opts) {
  58. _yuitest_coverfunc("build/yql/yql.js", "YQLRequest", 16);
  59. _yuitest_coverline("build/yql/yql.js", 18);
  60. if (!params) {
  61. _yuitest_coverline("build/yql/yql.js", 19);
  62. params = {};
  63. }
  64. _yuitest_coverline("build/yql/yql.js", 21);
  65. params.q = sql;
  66. //Allow format override.. JSON-P-X
  67. _yuitest_coverline("build/yql/yql.js", 23);
  68. if (!params.format) {
  69. _yuitest_coverline("build/yql/yql.js", 24);
  70. params.format = Y.YQLRequest.FORMAT;
  71. }
  72. _yuitest_coverline("build/yql/yql.js", 26);
  73. if (!params.env) {
  74. _yuitest_coverline("build/yql/yql.js", 27);
  75. params.env = Y.YQLRequest.ENV;
  76. }
  77. _yuitest_coverline("build/yql/yql.js", 30);
  78. this._context = this;
  79. _yuitest_coverline("build/yql/yql.js", 32);
  80. if (opts && opts.context) {
  81. _yuitest_coverline("build/yql/yql.js", 33);
  82. this._context = opts.context;
  83. _yuitest_coverline("build/yql/yql.js", 34);
  84. delete opts.context;
  85. }
  86. _yuitest_coverline("build/yql/yql.js", 37);
  87. if (params && params.context) {
  88. _yuitest_coverline("build/yql/yql.js", 38);
  89. this._context = params.context;
  90. _yuitest_coverline("build/yql/yql.js", 39);
  91. delete params.context;
  92. }
  93. _yuitest_coverline("build/yql/yql.js", 42);
  94. this._params = params;
  95. _yuitest_coverline("build/yql/yql.js", 43);
  96. this._opts = opts;
  97. _yuitest_coverline("build/yql/yql.js", 44);
  98. this._callback = callback;
  99. };
  100. _yuitest_coverline("build/yql/yql.js", 48);
  101. YQLRequest.prototype = {
  102. /**
  103. * @private
  104. * @property _jsonp
  105. * @description Reference to the JSONP instance used to make the queries
  106. */
  107. _jsonp: null,
  108. /**
  109. * @private
  110. * @property _opts
  111. * @description Holder for the opts argument
  112. */
  113. _opts: null,
  114. /**
  115. * @private
  116. * @property _callback
  117. * @description Holder for the callback argument
  118. */
  119. _callback: null,
  120. /**
  121. * @private
  122. * @property _params
  123. * @description Holder for the params argument
  124. */
  125. _params: null,
  126. /**
  127. * @private
  128. * @property _context
  129. * @description The context to execute the callback in
  130. */
  131. _context: null,
  132. /**
  133. * @private
  134. * @method _internal
  135. * @description Internal Callback Handler
  136. */
  137. _internal: function () {
  138. _yuitest_coverfunc("build/yql/yql.js", "_internal", 84);
  139. _yuitest_coverline("build/yql/yql.js", 85);
  140. this._callback.apply(this._context, arguments);
  141. },
  142. /**
  143. * @method send
  144. * @description The method that executes the YQL Request.
  145. * @chainable
  146. * @return {YQLRequest}
  147. */
  148. send: function () {
  149. _yuitest_coverfunc("build/yql/yql.js", "send", 93);
  150. _yuitest_coverline("build/yql/yql.js", 94);
  151. var qs = [], url = ((this._opts && this._opts.proto) ? this._opts.proto : Y.YQLRequest.PROTO), o;
  152. _yuitest_coverline("build/yql/yql.js", 96);
  153. Y.each(this._params, function (v, k) {
  154. _yuitest_coverfunc("build/yql/yql.js", "(anonymous 2)", 96);
  155. _yuitest_coverline("build/yql/yql.js", 97);
  156. qs.push(k + '=' + encodeURIComponent(v));
  157. });
  158. _yuitest_coverline("build/yql/yql.js", 100);
  159. qs = qs.join('&');
  160. _yuitest_coverline("build/yql/yql.js", 102);
  161. url += ((this._opts && this._opts.base) ? this._opts.base : Y.YQLRequest.BASE_URL) + qs;
  162. _yuitest_coverline("build/yql/yql.js", 104);
  163. o = (!Y.Lang.isFunction(this._callback)) ? this._callback : { on: { success: this._callback } };
  164. _yuitest_coverline("build/yql/yql.js", 106);
  165. o.on = o.on || {};
  166. _yuitest_coverline("build/yql/yql.js", 107);
  167. this._callback = o.on.success;
  168. _yuitest_coverline("build/yql/yql.js", 109);
  169. o.on.success = Y.bind(this._internal, this);
  170. _yuitest_coverline("build/yql/yql.js", 111);
  171. this._send(url, o);
  172. _yuitest_coverline("build/yql/yql.js", 112);
  173. return this;
  174. },
  175. /**
  176. * Private method to send the request, overwritten in plugins
  177. * @method _send
  178. * @private
  179. * @param {String} url The URL to request
  180. * @param {Object} o The config object
  181. */
  182. _send: function(url, o) {
  183. _yuitest_coverfunc("build/yql/yql.js", "_send", 121);
  184. _yuitest_coverline("build/yql/yql.js", 122);
  185. if (o.allowCache !== false) {
  186. _yuitest_coverline("build/yql/yql.js", 123);
  187. o.allowCache = true;
  188. }
  189. _yuitest_coverline("build/yql/yql.js", 125);
  190. if (!this._jsonp) {
  191. _yuitest_coverline("build/yql/yql.js", 126);
  192. this._jsonp = Y.jsonp(url, o);
  193. } else {
  194. _yuitest_coverline("build/yql/yql.js", 128);
  195. this._jsonp.url = url;
  196. _yuitest_coverline("build/yql/yql.js", 129);
  197. if (o.on && o.on.success) {
  198. _yuitest_coverline("build/yql/yql.js", 130);
  199. this._jsonp._config.on.success = o.on.success;
  200. }
  201. _yuitest_coverline("build/yql/yql.js", 132);
  202. this._jsonp.send();
  203. }
  204. }
  205. };
  206. /**
  207. * @static
  208. * @property FORMAT
  209. * @description Default format to use: json
  210. */
  211. _yuitest_coverline("build/yql/yql.js", 142);
  212. YQLRequest.FORMAT = 'json';
  213. /**
  214. * @static
  215. * @property PROTO
  216. * @description Default protocol to use: http
  217. */
  218. _yuitest_coverline("build/yql/yql.js", 148);
  219. YQLRequest.PROTO = 'http';
  220. /**
  221. * @static
  222. * @property BASE_URL
  223. * @description The base URL to query: query.yahooapis.com/v1/public/yql?
  224. */
  225. _yuitest_coverline("build/yql/yql.js", 154);
  226. YQLRequest.BASE_URL = ':/' + '/query.yahooapis.com/v1/public/yql?';
  227. /**
  228. * @static
  229. * @property ENV
  230. * @description The environment file to load: http://datatables.org/alltables.env
  231. */
  232. _yuitest_coverline("build/yql/yql.js", 160);
  233. YQLRequest.ENV = 'http:/' + '/datatables.org/alltables.env';
  234. _yuitest_coverline("build/yql/yql.js", 162);
  235. Y.YQLRequest = YQLRequest;
  236. /**
  237. * This class adds a sugar class to allow access to YQL (http://developer.yahoo.com/yql/).
  238. * @class YQL
  239. * @constructor
  240. * @param {String} sql The SQL statement to execute
  241. * @param {Function} callback The callback to execute after the query (optional).
  242. * @param {Object} params An object literal of extra parameters to pass along (optional).
  243. * @param {Object} opts An object literal of configuration options (optional): proto (http|https), base (url)
  244. */
  245. _yuitest_coverline("build/yql/yql.js", 173);
  246. Y.YQL = function (sql, callback, params, opts) {
  247. _yuitest_coverfunc("build/yql/yql.js", "YQL", 173);
  248. _yuitest_coverline("build/yql/yql.js", 174);
  249. return new Y.YQLRequest(sql, callback, params, opts).send();
  250. };
  251. }, '3.8.0', {"requires": ["jsonp", "jsonp-url"]});