stylus-source 0.23.0 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (595) hide show
  1. data/Rakefile +5 -5
  2. data/VERSION +1 -1
  3. data/vendor/lib/functions/index.js +11 -12
  4. data/vendor/lib/functions/index.styl +45 -0
  5. data/vendor/lib/parser.js +13 -0
  6. data/vendor/lib/stylus.js +1 -1
  7. data/vendor/lib/visitor/evaluator.js +8 -0
  8. data/vendor/node_modules/cssom/Jakefile.js +35 -0
  9. data/vendor/node_modules/cssom/lib/CSSImportRule.js +10 -9
  10. data/vendor/node_modules/cssom/lib/CSSKeyframeRule.js +2 -0
  11. data/vendor/node_modules/cssom/lib/CSSKeyframesRule.js +2 -1
  12. data/vendor/node_modules/cssom/lib/CSSMediaRule.js +2 -1
  13. data/vendor/node_modules/cssom/lib/CSSRule.js +1 -0
  14. data/vendor/node_modules/cssom/lib/CSSStyleDeclaration.js +7 -5
  15. data/vendor/node_modules/cssom/lib/CSSStyleRule.js +11 -9
  16. data/vendor/node_modules/cssom/lib/CSSStyleSheet.js +4 -4
  17. data/vendor/node_modules/cssom/lib/MediaList.js +3 -3
  18. data/vendor/node_modules/cssom/lib/StyleSheet.js +3 -1
  19. data/vendor/node_modules/cssom/lib/clone.js +5 -5
  20. data/vendor/node_modules/cssom/lib/index.js +14 -12
  21. data/vendor/node_modules/cssom/lib/parse.js +48 -43
  22. data/vendor/node_modules/cssom/package.json +5 -4
  23. data/vendor/node_modules/debug/History.md +35 -0
  24. data/vendor/node_modules/debug/Makefile +5 -0
  25. data/vendor/node_modules/debug/Readme.md +128 -0
  26. data/vendor/node_modules/debug/debug.js +111 -0
  27. data/vendor/node_modules/debug/example/app.js +19 -0
  28. data/vendor/node_modules/debug/example/browser.html +24 -0
  29. data/vendor/node_modules/debug/example/wildcards.js +10 -0
  30. data/vendor/node_modules/debug/example/worker.js +22 -0
  31. data/vendor/node_modules/debug/index.js +2 -0
  32. data/vendor/node_modules/debug/lib/debug.js +129 -0
  33. data/vendor/node_modules/debug/package.json +11 -0
  34. data/vendor/node_modules/growl/History.md +21 -0
  35. data/vendor/node_modules/growl/Readme.md +29 -20
  36. data/vendor/node_modules/growl/lib/growl.js +113 -36
  37. data/vendor/node_modules/growl/package.json +1 -1
  38. data/vendor/node_modules/growl/test.js +12 -13
  39. data/vendor/node_modules/mkdirp/README.markdown +35 -2
  40. data/vendor/node_modules/mkdirp/examples/pow.js +1 -1
  41. data/vendor/node_modules/mkdirp/index.js +72 -13
  42. data/vendor/node_modules/mkdirp/package.json +2 -2
  43. data/vendor/node_modules/mkdirp/test/chmod.js +38 -0
  44. data/vendor/node_modules/mkdirp/test/clobber.js +37 -0
  45. data/vendor/node_modules/mkdirp/test/perm.js +32 -0
  46. data/vendor/node_modules/mkdirp/test/perm_sync.js +39 -0
  47. data/vendor/node_modules/mkdirp/test/sync.js +27 -0
  48. data/vendor/node_modules/mkdirp/test/umask.js +28 -0
  49. data/vendor/node_modules/mkdirp/test/umask_sync.js +27 -0
  50. data/vendor/package.json +6 -5
  51. data/vendor/testing/test.css +39 -0
  52. data/vendor/testing/test.html +21 -0
  53. data/vendor/testing/test.js +5 -3
  54. data/vendor/testing/test.styl +42 -2
  55. metadata +23 -542
  56. data/vendor/History.md +0 -672
  57. data/vendor/Makefile +0 -20
  58. data/vendor/Readme.md +0 -155
  59. data/vendor/docs/bifs.md +0 -598
  60. data/vendor/docs/comments.md +0 -35
  61. data/vendor/docs/compare.md +0 -81
  62. data/vendor/docs/conditionals.md +0 -107
  63. data/vendor/docs/css-style.md +0 -77
  64. data/vendor/docs/error-reporting.md +0 -50
  65. data/vendor/docs/escape.md +0 -28
  66. data/vendor/docs/executable.md +0 -163
  67. data/vendor/docs/extend.md +0 -123
  68. data/vendor/docs/firebug.md +0 -59
  69. data/vendor/docs/font-face.md +0 -26
  70. data/vendor/docs/functions.md +0 -197
  71. data/vendor/docs/functions.url.md +0 -32
  72. data/vendor/docs/gedit.md +0 -24
  73. data/vendor/docs/import.md +0 -75
  74. data/vendor/docs/interpolation.md +0 -55
  75. data/vendor/docs/introspection.md +0 -38
  76. data/vendor/docs/iteration.md +0 -102
  77. data/vendor/docs/js.md +0 -157
  78. data/vendor/docs/keyframes.md +0 -122
  79. data/vendor/docs/kwargs.md +0 -34
  80. data/vendor/docs/literal.md +0 -16
  81. data/vendor/docs/media.md +0 -18
  82. data/vendor/docs/middleware.md +0 -72
  83. data/vendor/docs/mixins.md +0 -138
  84. data/vendor/docs/operators.md +0 -470
  85. data/vendor/docs/selectors.md +0 -133
  86. data/vendor/docs/textmate.md +0 -4
  87. data/vendor/docs/vargs.md +0 -84
  88. data/vendor/docs/variables.md +0 -85
  89. data/vendor/editors/Stylus.tmbundle/Commands/Compile and Display CSS.tmCommand +0 -33
  90. data/vendor/editors/Stylus.tmbundle/Preferences/Comments.tmPreferences +0 -36
  91. data/vendor/editors/Stylus.tmbundle/Syntaxes/Stylus.tmLanguage +0 -228
  92. data/vendor/editors/Stylus.tmbundle/info.plist +0 -10
  93. data/vendor/editors/gedit/styl.lang +0 -475
  94. data/vendor/examples/arithmetic.js +0 -12
  95. data/vendor/examples/arithmetic.styl +0 -29
  96. data/vendor/examples/basic.js +0 -12
  97. data/vendor/examples/basic.styl +0 -8
  98. data/vendor/examples/builtins.js +0 -12
  99. data/vendor/examples/builtins.styl +0 -56
  100. data/vendor/examples/comments.js +0 -11
  101. data/vendor/examples/comments.styl +0 -15
  102. data/vendor/examples/compress.js +0 -12
  103. data/vendor/examples/conversions.js +0 -12
  104. data/vendor/examples/conversions.styl +0 -34
  105. data/vendor/examples/functions.js +0 -12
  106. data/vendor/examples/functions.styl +0 -30
  107. data/vendor/examples/gradients.js +0 -13
  108. data/vendor/examples/gradients.styl +0 -8
  109. data/vendor/examples/images/gopher.jpg +0 -0
  110. data/vendor/examples/images/gradient.svg +0 -9
  111. data/vendor/examples/images/jesus.gif +0 -0
  112. data/vendor/examples/images/sprite.gif +0 -0
  113. data/vendor/examples/images.js +0 -20
  114. data/vendor/examples/images.styl +0 -15
  115. data/vendor/examples/implicit-functions.js +0 -12
  116. data/vendor/examples/implicit-functions.styl +0 -23
  117. data/vendor/examples/import.js +0 -12
  118. data/vendor/examples/import.styl +0 -11
  119. data/vendor/examples/js-functions.js +0 -55
  120. data/vendor/examples/js-functions.styl +0 -23
  121. data/vendor/examples/literal.js +0 -12
  122. data/vendor/examples/literal.styl +0 -8
  123. data/vendor/examples/middleware.js +0 -23
  124. data/vendor/examples/mixins/box.styl +0 -14
  125. data/vendor/examples/mixins/gradients.styl +0 -92
  126. data/vendor/examples/nesting.js +0 -12
  127. data/vendor/examples/nesting.styl +0 -14
  128. data/vendor/examples/variables.js +0 -12
  129. data/vendor/examples/variables.styl +0 -24
  130. data/vendor/node_modules/cssom/Jakefile +0 -37
  131. data/vendor/node_modules/cssom/MIT-LICENSE.txt +0 -20
  132. data/vendor/node_modules/cssom/README.mdown +0 -34
  133. data/vendor/node_modules/cssom/Rakefile +0 -23
  134. data/vendor/node_modules/cssom/animation.html +0 -27
  135. data/vendor/node_modules/cssom/bench.html +0 -47
  136. data/vendor/node_modules/cssom/comments.js +0 -63
  137. data/vendor/node_modules/cssom/docs/bar.css +0 -3
  138. data/vendor/node_modules/cssom/docs/col_table.html +0 -15
  139. data/vendor/node_modules/cssom/docs/cols.html +0 -14
  140. data/vendor/node_modules/cssom/docs/cols_inline-blocks.html +0 -33
  141. data/vendor/node_modules/cssom/docs/demo.css +0 -0
  142. data/vendor/node_modules/cssom/docs/diff.html +0 -132
  143. data/vendor/node_modules/cssom/docs/foo.css +0 -4
  144. data/vendor/node_modules/cssom/docs/parse.html +0 -282
  145. data/vendor/node_modules/cssom/docs/parse.html_ +0 -268
  146. data/vendor/node_modules/cssom/docs/parse2.html +0 -518
  147. data/vendor/node_modules/cssom/docs/parser.html +0 -31
  148. data/vendor/node_modules/cssom/index.html +0 -100
  149. data/vendor/node_modules/cssom/lib/CSSOM.js +0 -3
  150. data/vendor/node_modules/cssom/lib/Parser.js +0 -362
  151. data/vendor/node_modules/cssom/media.html +0 -17
  152. data/vendor/node_modules/cssom/plugins/toHTML.js +0 -32
  153. data/vendor/node_modules/cssom/server/index.html +0 -22
  154. data/vendor/node_modules/cssom/server/index.js +0 -21
  155. data/vendor/node_modules/cssom/shorthands.html +0 -21
  156. data/vendor/node_modules/cssom/strings.html +0 -10
  157. data/vendor/node_modules/cssom/test/CSSImportRule.test.js +0 -52
  158. data/vendor/node_modules/cssom/test/CSSStyleDeclaration.test.js +0 -42
  159. data/vendor/node_modules/cssom/test/CSSStyleRule.test.js +0 -12
  160. data/vendor/node_modules/cssom/test/CSSStyleSheet.test.js +0 -16
  161. data/vendor/node_modules/cssom/test/MediaList.test.js +0 -21
  162. data/vendor/node_modules/cssom/test/_helper.js +0 -122
  163. data/vendor/node_modules/cssom/test/clone.test.js +0 -38
  164. data/vendor/node_modules/cssom/test/fixtures/dummy.css +0 -3
  165. data/vendor/node_modules/cssom/test/helper.js +0 -122
  166. data/vendor/node_modules/cssom/test/index.html +0 -45
  167. data/vendor/node_modules/cssom/test/parse.test.js +0 -718
  168. data/vendor/node_modules/cssom/test/vendor/qunit.css +0 -189
  169. data/vendor/node_modules/cssom/test/vendor/qunit.js +0 -1415
  170. data/vendor/test/cases/arithmetic.color.css +0 -44
  171. data/vendor/test/cases/arithmetic.color.styl +0 -48
  172. data/vendor/test/cases/arithmetic.css +0 -23
  173. data/vendor/test/cases/arithmetic.styl +0 -30
  174. data/vendor/test/cases/arithmetic.unary.css +0 -16
  175. data/vendor/test/cases/arithmetic.unary.styl +0 -16
  176. data/vendor/test/cases/atscope.css +0 -21
  177. data/vendor/test/cases/atscope.styl +0 -23
  178. data/vendor/test/cases/bifs.add-property.css +0 -21
  179. data/vendor/test/cases/bifs.add-property.styl +0 -48
  180. data/vendor/test/cases/bifs.components.css +0 -9
  181. data/vendor/test/cases/bifs.components.styl +0 -9
  182. data/vendor/test/cases/bifs.dark.css +0 -5
  183. data/vendor/test/cases/bifs.dark.styl +0 -4
  184. data/vendor/test/cases/bifs.darken.css +0 -8
  185. data/vendor/test/cases/bifs.darken.styl +0 -9
  186. data/vendor/test/cases/bifs.fade.css +0 -6
  187. data/vendor/test/cases/bifs.fade.styl +0 -6
  188. data/vendor/test/cases/bifs.image-size.css +0 -9
  189. data/vendor/test/cases/bifs.image-size.styl +0 -16
  190. data/vendor/test/cases/bifs.join.css +0 -18
  191. data/vendor/test/cases/bifs.join.styl +0 -21
  192. data/vendor/test/cases/bifs.keys.css +0 -4
  193. data/vendor/test/cases/bifs.keys.styl +0 -6
  194. data/vendor/test/cases/bifs.last.css +0 -5
  195. data/vendor/test/cases/bifs.last.styl +0 -6
  196. data/vendor/test/cases/bifs.length.css +0 -10
  197. data/vendor/test/cases/bifs.length.styl +0 -18
  198. data/vendor/test/cases/bifs.light.css +0 -5
  199. data/vendor/test/cases/bifs.light.styl +0 -4
  200. data/vendor/test/cases/bifs.lighten.css +0 -14
  201. data/vendor/test/cases/bifs.lighten.styl +0 -14
  202. data/vendor/test/cases/bifs.lookup.css +0 -3
  203. data/vendor/test/cases/bifs.lookup.styl +0 -8
  204. data/vendor/test/cases/bifs.match.css +0 -4
  205. data/vendor/test/cases/bifs.match.styl +0 -9
  206. data/vendor/test/cases/bifs.opposite-position.css +0 -8
  207. data/vendor/test/cases/bifs.opposite-position.styl +0 -9
  208. data/vendor/test/cases/bifs.push.css +0 -25
  209. data/vendor/test/cases/bifs.push.styl +0 -48
  210. data/vendor/test/cases/bifs.rgba.css +0 -5
  211. data/vendor/test/cases/bifs.rgba.styl +0 -4
  212. data/vendor/test/cases/bifs.s.css +0 -11
  213. data/vendor/test/cases/bifs.s.styl +0 -12
  214. data/vendor/test/cases/bifs.type.css +0 -11
  215. data/vendor/test/cases/bifs.type.styl +0 -12
  216. data/vendor/test/cases/bifs.unit.css +0 -6
  217. data/vendor/test/cases/bifs.unit.styl +0 -5
  218. data/vendor/test/cases/bifs.unquote.css +0 -5
  219. data/vendor/test/cases/bifs.unquote.styl +0 -8
  220. data/vendor/test/cases/bifs.url.css +0 -11
  221. data/vendor/test/cases/bifs.url.styl +0 -15
  222. data/vendor/test/cases/bifs.values.css +0 -5
  223. data/vendor/test/cases/bifs.values.styl +0 -6
  224. data/vendor/test/cases/casting.css +0 -12
  225. data/vendor/test/cases/casting.styl +0 -14
  226. data/vendor/test/cases/coercion.css +0 -6
  227. data/vendor/test/cases/coercion.styl +0 -5
  228. data/vendor/test/cases/comments.css +0 -18
  229. data/vendor/test/cases/comments.styl +0 -28
  230. data/vendor/test/cases/compress.comments.css +0 -2
  231. data/vendor/test/cases/compress.comments.styl +0 -5
  232. data/vendor/test/cases/compress.units.css +0 -2
  233. data/vendor/test/cases/compress.units.styl +0 -18
  234. data/vendor/test/cases/conditional-assignment.css +0 -4
  235. data/vendor/test/cases/conditional-assignment.styl +0 -9
  236. data/vendor/test/cases/control.blueprint.ie.css +0 -126
  237. data/vendor/test/cases/control.blueprint.ie.styl +0 -36
  238. data/vendor/test/cases/control.blueprint.screen.css +0 -1103
  239. data/vendor/test/cases/control.blueprint.screen.styl +0 -265
  240. data/vendor/test/cases/control.boilerplate.css +0 -473
  241. data/vendor/test/cases/control.boilerplate.styl +0 -265
  242. data/vendor/test/cases/css.extend.css +0 -13
  243. data/vendor/test/cases/css.extend.styl +0 -15
  244. data/vendor/test/cases/css.functions.single-line.css +0 -9
  245. data/vendor/test/cases/css.functions.single-line.styl +0 -13
  246. data/vendor/test/cases/css.if.css +0 -8
  247. data/vendor/test/cases/css.if.styl +0 -21
  248. data/vendor/test/cases/css.keyframes.css +0 -57
  249. data/vendor/test/cases/css.keyframes.styl +0 -48
  250. data/vendor/test/cases/css.large.css +0 -172
  251. data/vendor/test/cases/css.large.styl +0 -172
  252. data/vendor/test/cases/css.media.css +0 -15
  253. data/vendor/test/cases/css.media.styl +0 -17
  254. data/vendor/test/cases/css.mixins.braces.css +0 -38
  255. data/vendor/test/cases/css.mixins.braces.styl +0 -53
  256. data/vendor/test/cases/css.mixins.css +0 -38
  257. data/vendor/test/cases/css.mixins.root.css +0 -26
  258. data/vendor/test/cases/css.mixins.root.styl +0 -25
  259. data/vendor/test/cases/css.mixins.root.wonky.css +0 -26
  260. data/vendor/test/cases/css.mixins.root.wonky.styl +0 -17
  261. data/vendor/test/cases/css.mixins.styl +0 -47
  262. data/vendor/test/cases/css.selector.interpolation.css +0 -91
  263. data/vendor/test/cases/css.selector.interpolation.styl +0 -90
  264. data/vendor/test/cases/css.selectors.css +0 -38
  265. data/vendor/test/cases/css.selectors.styl +0 -53
  266. data/vendor/test/cases/css.whitespace.css +0 -37
  267. data/vendor/test/cases/css.whitespace.styl +0 -38
  268. data/vendor/test/cases/dumb.css +0 -10
  269. data/vendor/test/cases/dumb.styl +0 -11
  270. data/vendor/test/cases/eol-escape.css +0 -11
  271. data/vendor/test/cases/eol-escape.styl +0 -27
  272. data/vendor/test/cases/escape.css +0 -4
  273. data/vendor/test/cases/escape.styl +0 -4
  274. data/vendor/test/cases/extend.complex.css +0 -16
  275. data/vendor/test/cases/extend.complex.styl +0 -15
  276. data/vendor/test/cases/extend.css +0 -22
  277. data/vendor/test/cases/extend.multiple-definitions.css +0 -11
  278. data/vendor/test/cases/extend.multiple-definitions.styl +0 -9
  279. data/vendor/test/cases/extend.styl +0 -22
  280. data/vendor/test/cases/fontface.css +0 -4
  281. data/vendor/test/cases/fontface.styl +0 -5
  282. data/vendor/test/cases/for.complex.css +0 -44
  283. data/vendor/test/cases/for.complex.styl +0 -28
  284. data/vendor/test/cases/for.css +0 -52
  285. data/vendor/test/cases/for.function.css +0 -20
  286. data/vendor/test/cases/for.function.styl +0 -51
  287. data/vendor/test/cases/for.styl +0 -44
  288. data/vendor/test/cases/function.arguments.css +0 -4
  289. data/vendor/test/cases/function.arguments.styl +0 -14
  290. data/vendor/test/cases/function.literals.css +0 -6
  291. data/vendor/test/cases/function.literals.styl +0 -12
  292. data/vendor/test/cases/functions.arg-calls.css +0 -3
  293. data/vendor/test/cases/functions.arg-calls.styl +0 -9
  294. data/vendor/test/cases/functions.call.css +0 -4
  295. data/vendor/test/cases/functions.call.styl +0 -7
  296. data/vendor/test/cases/functions.css +0 -11
  297. data/vendor/test/cases/functions.defaults.css +0 -15
  298. data/vendor/test/cases/functions.defaults.styl +0 -30
  299. data/vendor/test/cases/functions.multi-line.css +0 -9
  300. data/vendor/test/cases/functions.multi-line.styl +0 -25
  301. data/vendor/test/cases/functions.multiple-calls.css +0 -13
  302. data/vendor/test/cases/functions.multiple-calls.styl +0 -26
  303. data/vendor/test/cases/functions.nested-calls.css +0 -3
  304. data/vendor/test/cases/functions.nested-calls.styl +0 -9
  305. data/vendor/test/cases/functions.nested.css +0 -10
  306. data/vendor/test/cases/functions.nested.styl +0 -37
  307. data/vendor/test/cases/functions.property.css +0 -10
  308. data/vendor/test/cases/functions.property.styl +0 -11
  309. data/vendor/test/cases/functions.return.css +0 -15
  310. data/vendor/test/cases/functions.return.each.css +0 -10
  311. data/vendor/test/cases/functions.return.each.styl +0 -23
  312. data/vendor/test/cases/functions.return.styl +0 -86
  313. data/vendor/test/cases/functions.styl +0 -34
  314. data/vendor/test/cases/functions.variable.css +0 -9
  315. data/vendor/test/cases/functions.variable.ident.css +0 -3
  316. data/vendor/test/cases/functions.variable.ident.styl +0 -11
  317. data/vendor/test/cases/functions.variable.styl +0 -27
  318. data/vendor/test/cases/hack.star.css +0 -27
  319. data/vendor/test/cases/hack.star.styl +0 -37
  320. data/vendor/test/cases/if.css +0 -43
  321. data/vendor/test/cases/if.else.css +0 -6
  322. data/vendor/test/cases/if.else.styl +0 -16
  323. data/vendor/test/cases/if.mixin.css +0 -7
  324. data/vendor/test/cases/if.mixin.styl +0 -24
  325. data/vendor/test/cases/if.postfix.css +0 -61
  326. data/vendor/test/cases/if.postfix.styl +0 -110
  327. data/vendor/test/cases/if.selectors.css +0 -16
  328. data/vendor/test/cases/if.selectors.styl +0 -22
  329. data/vendor/test/cases/if.styl +0 -99
  330. data/vendor/test/cases/import.basic/a.styl +0 -5
  331. data/vendor/test/cases/import.basic/b.styl +0 -5
  332. data/vendor/test/cases/import.basic/c.styl +0 -3
  333. data/vendor/test/cases/import.basic.css +0 -11
  334. data/vendor/test/cases/import.basic.styl +0 -4
  335. data/vendor/test/cases/import.complex/a.styl +0 -4
  336. data/vendor/test/cases/import.complex/c.styl +0 -2
  337. data/vendor/test/cases/import.complex/nested/b.styl +0 -4
  338. data/vendor/test/cases/import.complex.css +0 -9
  339. data/vendor/test/cases/import.complex.styl +0 -1
  340. data/vendor/test/cases/import.index/vendor/a.styl +0 -2
  341. data/vendor/test/cases/import.index/vendor/b.styl +0 -2
  342. data/vendor/test/cases/import.index/vendor/c.styl +0 -2
  343. data/vendor/test/cases/import.index/vendor/index.styl +0 -4
  344. data/vendor/test/cases/import.index.css +0 -9
  345. data/vendor/test/cases/import.index.styl +0 -2
  346. data/vendor/test/cases/import.literal.css +0 -2
  347. data/vendor/test/cases/import.literal.styl +0 -3
  348. data/vendor/test/cases/import.mixins.css +0 -7
  349. data/vendor/test/cases/import.mixins.styl +0 -9
  350. data/vendor/test/cases/import.ordering/five.styl +0 -2
  351. data/vendor/test/cases/import.ordering/four.styl +0 -4
  352. data/vendor/test/cases/import.ordering/two.styl +0 -2
  353. data/vendor/test/cases/import.ordering.css +0 -15
  354. data/vendor/test/cases/import.ordering.styl +0 -12
  355. data/vendor/test/cases/important.css +0 -6
  356. data/vendor/test/cases/important.styl +0 -6
  357. data/vendor/test/cases/interpolation.properties.css +0 -40
  358. data/vendor/test/cases/interpolation.properties.styl +0 -56
  359. data/vendor/test/cases/introspection.css +0 -7
  360. data/vendor/test/cases/introspection.styl +0 -14
  361. data/vendor/test/cases/jquery.css +0 -3
  362. data/vendor/test/cases/jquery.styl +0 -5
  363. data/vendor/test/cases/keyframes.css +0 -9
  364. data/vendor/test/cases/keyframes.fabrication.css +0 -18
  365. data/vendor/test/cases/keyframes.fabrication.defaults.css +0 -45
  366. data/vendor/test/cases/keyframes.fabrication.defaults.styl +0 -9
  367. data/vendor/test/cases/keyframes.fabrication.styl +0 -11
  368. data/vendor/test/cases/keyframes.newlines.css +0 -45
  369. data/vendor/test/cases/keyframes.newlines.styl +0 -7
  370. data/vendor/test/cases/keyframes.styl +0 -6
  371. data/vendor/test/cases/kwargs.css +0 -63
  372. data/vendor/test/cases/kwargs.styl +0 -74
  373. data/vendor/test/cases/list.css +0 -3
  374. data/vendor/test/cases/list.styl +0 -3
  375. data/vendor/test/cases/literal.color.css +0 -10
  376. data/vendor/test/cases/literal.color.styl +0 -9
  377. data/vendor/test/cases/literal.css +0 -10
  378. data/vendor/test/cases/literal.styl +0 -18
  379. data/vendor/test/cases/media.css +0 -14
  380. data/vendor/test/cases/media.styl +0 -11
  381. data/vendor/test/cases/mixin.conditional.css +0 -19
  382. data/vendor/test/cases/mixin.conditional.styl +0 -36
  383. data/vendor/test/cases/mixin.order.conditional.css +0 -11
  384. data/vendor/test/cases/mixin.order.conditional.styl +0 -20
  385. data/vendor/test/cases/mixin.order.css +0 -9
  386. data/vendor/test/cases/mixin.order.nested.css +0 -9
  387. data/vendor/test/cases/mixin.order.nested.styl +0 -21
  388. data/vendor/test/cases/mixin.order.styl +0 -20
  389. data/vendor/test/cases/mixins/box.styl +0 -11
  390. data/vendor/test/cases/mixins.complex.css +0 -30
  391. data/vendor/test/cases/mixins.complex.fix-to.css +0 -15
  392. data/vendor/test/cases/mixins.complex.fix-to.styl +0 -28
  393. data/vendor/test/cases/mixins.complex.styl +0 -41
  394. data/vendor/test/cases/mixins.conditional.css +0 -3
  395. data/vendor/test/cases/mixins.conditional.styl +0 -8
  396. data/vendor/test/cases/mixins.nested.css +0 -7
  397. data/vendor/test/cases/mixins.nested.selectors.css +0 -21
  398. data/vendor/test/cases/mixins.nested.selectors.styl +0 -31
  399. data/vendor/test/cases/mixins.nested.styl +0 -14
  400. data/vendor/test/cases/mixins.order.2.css +0 -11
  401. data/vendor/test/cases/mixins.order.2.styl +0 -16
  402. data/vendor/test/cases/mixins.reset.css +0 -75
  403. data/vendor/test/cases/mixins.reset.styl +0 -27
  404. data/vendor/test/cases/mixins.return.css +0 -4
  405. data/vendor/test/cases/mixins.return.styl +0 -8
  406. data/vendor/test/cases/mixins.root.css +0 -3
  407. data/vendor/test/cases/mixins.root.styl +0 -5
  408. data/vendor/test/cases/operator.range.css +0 -15
  409. data/vendor/test/cases/operator.range.styl +0 -23
  410. data/vendor/test/cases/operators.assignment.function.css +0 -15
  411. data/vendor/test/cases/operators.assignment.function.styl +0 -34
  412. data/vendor/test/cases/operators.assignment.mixin.css +0 -15
  413. data/vendor/test/cases/operators.assignment.mixin.styl +0 -39
  414. data/vendor/test/cases/operators.assignment.root.css +0 -25
  415. data/vendor/test/cases/operators.assignment.root.styl +0 -55
  416. data/vendor/test/cases/operators.complex.css +0 -9
  417. data/vendor/test/cases/operators.complex.styl +0 -32
  418. data/vendor/test/cases/operators.css +0 -40
  419. data/vendor/test/cases/operators.equality.css +0 -55
  420. data/vendor/test/cases/operators.equality.styl +0 -55
  421. data/vendor/test/cases/operators.in.css +0 -37
  422. data/vendor/test/cases/operators.in.styl +0 -51
  423. data/vendor/test/cases/operators.mixins.css +0 -10
  424. data/vendor/test/cases/operators.mixins.styl +0 -25
  425. data/vendor/test/cases/operators.precedence.css +0 -51
  426. data/vendor/test/cases/operators.precedence.styl +0 -82
  427. data/vendor/test/cases/operators.styl +0 -96
  428. data/vendor/test/cases/operators.subscript.assign.css +0 -21
  429. data/vendor/test/cases/operators.subscript.assign.styl +0 -45
  430. data/vendor/test/cases/operators.subscript.css +0 -59
  431. data/vendor/test/cases/operators.subscript.range.css +0 -14
  432. data/vendor/test/cases/operators.subscript.range.styl +0 -15
  433. data/vendor/test/cases/operators.subscript.styl +0 -81
  434. data/vendor/test/cases/page.css +0 -16
  435. data/vendor/test/cases/page.styl +0 -17
  436. data/vendor/test/cases/parent.css +0 -32
  437. data/vendor/test/cases/parent.styl +0 -33
  438. data/vendor/test/cases/properties.colons.css +0 -8
  439. data/vendor/test/cases/properties.colons.styl +0 -10
  440. data/vendor/test/cases/properties.css +0 -4
  441. data/vendor/test/cases/properties.one-line.css +0 -10
  442. data/vendor/test/cases/properties.one-line.styl +0 -11
  443. data/vendor/test/cases/properties.styl +0 -4
  444. data/vendor/test/cases/property-access.bubble.css +0 -38
  445. data/vendor/test/cases/property-access.bubble.styl +0 -46
  446. data/vendor/test/cases/property-access.css +0 -48
  447. data/vendor/test/cases/property-access.siblings.css +0 -19
  448. data/vendor/test/cases/property-access.siblings.styl +0 -20
  449. data/vendor/test/cases/property-access.styl +0 -62
  450. data/vendor/test/cases/regression.107.lookup-failure.css +0 -12
  451. data/vendor/test/cases/regression.107.lookup-failure.styl +0 -13
  452. data/vendor/test/cases/regression.127.css +0 -3
  453. data/vendor/test/cases/regression.127.styl +0 -2
  454. data/vendor/test/cases/regression.130.css +0 -16
  455. data/vendor/test/cases/regression.130.styl +0 -6
  456. data/vendor/test/cases/regression.131.css +0 -7
  457. data/vendor/test/cases/regression.131.styl +0 -2
  458. data/vendor/test/cases/regression.137.css +0 -7
  459. data/vendor/test/cases/regression.137.styl +0 -7
  460. data/vendor/test/cases/regression.139.css +0 -5
  461. data/vendor/test/cases/regression.139.styl +0 -21
  462. data/vendor/test/cases/regression.142.css +0 -39
  463. data/vendor/test/cases/regression.142.styl +0 -54
  464. data/vendor/test/cases/regression.146.css +0 -30
  465. data/vendor/test/cases/regression.146.styl +0 -31
  466. data/vendor/test/cases/regression.153.css +0 -8
  467. data/vendor/test/cases/regression.153.styl +0 -9
  468. data/vendor/test/cases/regression.154.css +0 -8
  469. data/vendor/test/cases/regression.154.styl +0 -14
  470. data/vendor/test/cases/regression.156.css +0 -4
  471. data/vendor/test/cases/regression.156.styl +0 -6
  472. data/vendor/test/cases/regression.212.css +0 -15
  473. data/vendor/test/cases/regression.212.styl +0 -14
  474. data/vendor/test/cases/regression.216.css +0 -10
  475. data/vendor/test/cases/regression.216.styl +0 -8
  476. data/vendor/test/cases/regression.220.css +0 -5
  477. data/vendor/test/cases/regression.220.styl +0 -5
  478. data/vendor/test/cases/regression.229.css +0 -12
  479. data/vendor/test/cases/regression.229.styl +0 -9
  480. data/vendor/test/cases/regression.233.css +0 -6
  481. data/vendor/test/cases/regression.233.styl +0 -7
  482. data/vendor/test/cases/regression.235.css +0 -11
  483. data/vendor/test/cases/regression.235.styl +0 -13
  484. data/vendor/test/cases/regression.243.css +0 -3
  485. data/vendor/test/cases/regression.243.styl +0 -4
  486. data/vendor/test/cases/regression.244.css +0 -3
  487. data/vendor/test/cases/regression.244.styl +0 -3
  488. data/vendor/test/cases/regression.247.css +0 -6
  489. data/vendor/test/cases/regression.247.styl +0 -6
  490. data/vendor/test/cases/regression.248.compressed.css +0 -4
  491. data/vendor/test/cases/regression.248.compressed.styl +0 -10
  492. data/vendor/test/cases/regression.252.css +0 -13
  493. data/vendor/test/cases/regression.252.styl +0 -13
  494. data/vendor/test/cases/regression.260.css +0 -6
  495. data/vendor/test/cases/regression.260.styl +0 -6
  496. data/vendor/test/cases/regression.267.css +0 -3
  497. data/vendor/test/cases/regression.267.styl +0 -3
  498. data/vendor/test/cases/regression.270.css +0 -5
  499. data/vendor/test/cases/regression.270.styl +0 -7
  500. data/vendor/test/cases/regression.272.css +0 -11
  501. data/vendor/test/cases/regression.272.styl +0 -17
  502. data/vendor/test/cases/regression.274.css +0 -14
  503. data/vendor/test/cases/regression.274.styl +0 -16
  504. data/vendor/test/cases/regression.292.css +0 -3
  505. data/vendor/test/cases/regression.292.styl +0 -3
  506. data/vendor/test/cases/regression.360.css +0 -19
  507. data/vendor/test/cases/regression.360.styl +0 -1
  508. data/vendor/test/cases/regression.368.css +0 -4
  509. data/vendor/test/cases/regression.368.styl +0 -3
  510. data/vendor/test/cases/regression.379.css +0 -6
  511. data/vendor/test/cases/regression.379.styl +0 -10
  512. data/vendor/test/cases/regression.380.css +0 -8
  513. data/vendor/test/cases/regression.380.styl +0 -14
  514. data/vendor/test/cases/regression.388.css +0 -2
  515. data/vendor/test/cases/regression.388.styl +0 -6
  516. data/vendor/test/cases/regression.415.css +0 -5
  517. data/vendor/test/cases/regression.415.styl +0 -3
  518. data/vendor/test/cases/regression.420.css +0 -21
  519. data/vendor/test/cases/regression.420.styl +0 -29
  520. data/vendor/test/cases/regression.432.css +0 -5
  521. data/vendor/test/cases/regression.432.styl +0 -4
  522. data/vendor/test/cases/regression.440.css +0 -5
  523. data/vendor/test/cases/regression.440.styl +0 -7
  524. data/vendor/test/cases/regression.449.css +0 -9
  525. data/vendor/test/cases/regression.449.styl +0 -10
  526. data/vendor/test/cases/regression.458.css +0 -3
  527. data/vendor/test/cases/regression.458.styl +0 -3
  528. data/vendor/test/cases/regression.460.css +0 -13
  529. data/vendor/test/cases/regression.460.styl +0 -18
  530. data/vendor/test/cases/regression.469.css +0 -4
  531. data/vendor/test/cases/regression.469.styl +0 -6
  532. data/vendor/test/cases/regression.472.css +0 -10
  533. data/vendor/test/cases/regression.472.styl +0 -23
  534. data/vendor/test/cases/regression.475.css +0 -6
  535. data/vendor/test/cases/regression.475.styl +0 -7
  536. data/vendor/test/cases/regression.480.css +0 -9
  537. data/vendor/test/cases/regression.480.styl +0 -12
  538. data/vendor/test/cases/regression.484.css +0 -9
  539. data/vendor/test/cases/regression.484.styl +0 -8
  540. data/vendor/test/cases/regression.498.css +0 -8
  541. data/vendor/test/cases/regression.498.styl +0 -11
  542. data/vendor/test/cases/regression.499.css +0 -14
  543. data/vendor/test/cases/regression.499.styl +0 -20
  544. data/vendor/test/cases/regression.503.css +0 -65
  545. data/vendor/test/cases/regression.503.styl +0 -7
  546. data/vendor/test/cases/regression.504.css +0 -65
  547. data/vendor/test/cases/regression.504.styl +0 -12
  548. data/vendor/test/cases/regression.524.css +0 -4
  549. data/vendor/test/cases/regression.524.styl +0 -7
  550. data/vendor/test/cases/regression.535.css +0 -3
  551. data/vendor/test/cases/regression.535.styl +0 -9
  552. data/vendor/test/cases/regression.536.css +0 -3
  553. data/vendor/test/cases/regression.536.styl +0 -5
  554. data/vendor/test/cases/reset.css +0 -70
  555. data/vendor/test/cases/reset.styl +0 -16
  556. data/vendor/test/cases/rule.charset.css +0 -1
  557. data/vendor/test/cases/rule.charset.styl +0 -2
  558. data/vendor/test/cases/rulset.css +0 -4
  559. data/vendor/test/cases/rulset.newline.css +0 -5
  560. data/vendor/test/cases/rulset.newline.styl +0 -5
  561. data/vendor/test/cases/rulset.styl +0 -3
  562. data/vendor/test/cases/scope.complex.css +0 -10
  563. data/vendor/test/cases/scope.complex.styl +0 -16
  564. data/vendor/test/cases/scope.css +0 -5
  565. data/vendor/test/cases/scope.nested.css +0 -9
  566. data/vendor/test/cases/scope.nested.styl +0 -10
  567. data/vendor/test/cases/scope.styl +0 -12
  568. data/vendor/test/cases/selector.interpolation.css +0 -57
  569. data/vendor/test/cases/selector.interpolation.styl +0 -45
  570. data/vendor/test/cases/selectors.complex.css +0 -28
  571. data/vendor/test/cases/selectors.complex.styl +0 -27
  572. data/vendor/test/cases/selectors.css +0 -50
  573. data/vendor/test/cases/selectors.nested.comma.css +0 -9
  574. data/vendor/test/cases/selectors.nested.comma.styl +0 -8
  575. data/vendor/test/cases/selectors.nested.css +0 -34
  576. data/vendor/test/cases/selectors.nested.styl +0 -33
  577. data/vendor/test/cases/selectors.pseudo.css +0 -27
  578. data/vendor/test/cases/selectors.pseudo.elements.css +0 -26
  579. data/vendor/test/cases/selectors.pseudo.elements.styl +0 -29
  580. data/vendor/test/cases/selectors.pseudo.styl +0 -24
  581. data/vendor/test/cases/selectors.styl +0 -46
  582. data/vendor/test/cases/self-assignment.css +0 -3
  583. data/vendor/test/cases/self-assignment.styl +0 -4
  584. data/vendor/test/cases/vargs.call.css +0 -24
  585. data/vendor/test/cases/vargs.call.styl +0 -40
  586. data/vendor/test/cases/vargs.css +0 -30
  587. data/vendor/test/cases/vargs.styl +0 -49
  588. data/vendor/test/cases/variable.css +0 -3
  589. data/vendor/test/cases/variable.styl +0 -4
  590. data/vendor/test/cases/variables.css +0 -12
  591. data/vendor/test/cases/variables.styl +0 -17
  592. data/vendor/test/images/gif +0 -0
  593. data/vendor/test/images/squirrel.jpeg +0 -0
  594. data/vendor/test/images/tux.png +0 -0
  595. data/vendor/test/run.js +0 -169
@@ -1,1415 +0,0 @@
1
- /*
2
- * QUnit - A JavaScript Unit Testing Framework
3
- *
4
- * http://docs.jquery.com/QUnit
5
- *
6
- * Copyright (c) 2011 John Resig, Jörn Zaefferer
7
- * Dual licensed under the MIT (MIT-LICENSE.txt)
8
- * or GPL (GPL-LICENSE.txt) licenses.
9
- */
10
-
11
- (function(window) {
12
-
13
- var defined = {
14
- setTimeout: typeof window.setTimeout !== "undefined",
15
- sessionStorage: (function() {
16
- try {
17
- return !!sessionStorage.getItem;
18
- } catch(e){
19
- return false;
20
- }
21
- })()
22
- }
23
-
24
- var testId = 0;
25
-
26
- var Test = function(name, testName, expected, testEnvironmentArg, async, callback) {
27
- this.name = name;
28
- this.testName = testName;
29
- this.expected = expected;
30
- this.testEnvironmentArg = testEnvironmentArg;
31
- this.async = async;
32
- this.callback = callback;
33
- this.assertions = [];
34
- };
35
- Test.prototype = {
36
- init: function() {
37
- var tests = id("qunit-tests");
38
- if (tests) {
39
- var b = document.createElement("strong");
40
- b.innerHTML = "Running " + this.name;
41
- var li = document.createElement("li");
42
- li.appendChild( b );
43
- li.id = this.id = "test-output" + testId++;
44
- tests.appendChild( li );
45
- }
46
- },
47
- setup: function() {
48
- if (this.module != config.previousModule) {
49
- if ( config.previousModule ) {
50
- QUnit.moduleDone( {
51
- name: config.previousModule,
52
- failed: config.moduleStats.bad,
53
- passed: config.moduleStats.all - config.moduleStats.bad,
54
- total: config.moduleStats.all
55
- } );
56
- }
57
- config.previousModule = this.module;
58
- config.moduleStats = { all: 0, bad: 0 };
59
- QUnit.moduleStart( {
60
- name: this.module
61
- } );
62
- }
63
-
64
- config.current = this;
65
- this.testEnvironment = extend({
66
- setup: function() {},
67
- teardown: function() {}
68
- }, this.moduleTestEnvironment);
69
- if (this.testEnvironmentArg) {
70
- extend(this.testEnvironment, this.testEnvironmentArg);
71
- }
72
-
73
- QUnit.testStart( {
74
- name: this.testName
75
- } );
76
-
77
- // allow utility functions to access the current test environment
78
- // TODO why??
79
- QUnit.current_testEnvironment = this.testEnvironment;
80
-
81
- try {
82
- if ( !config.pollution ) {
83
- saveGlobal();
84
- }
85
-
86
- this.testEnvironment.setup.call(this.testEnvironment);
87
- } catch(e) {
88
- QUnit.ok( false, "Setup failed on " + this.testName + ": " + e.message );
89
- }
90
- },
91
- run: function() {
92
- if ( this.async ) {
93
- QUnit.stop();
94
- }
95
-
96
- if ( config.notrycatch ) {
97
- this.callback.call(this.testEnvironment);
98
- return;
99
- }
100
- try {
101
- this.callback.call(this.testEnvironment);
102
- } catch(e) {
103
- fail("Test " + this.testName + " died, exception and test follows", e, this.callback);
104
- QUnit.ok( false, "Died on test #" + (this.assertions.length + 1) + ": " + e.message + " - " + QUnit.jsDump.parse(e) );
105
- // else next test will carry the responsibility
106
- saveGlobal();
107
-
108
- // Restart the tests if they're blocking
109
- if ( config.blocking ) {
110
- start();
111
- }
112
- }
113
- },
114
- teardown: function() {
115
- try {
116
- checkPollution();
117
- this.testEnvironment.teardown.call(this.testEnvironment);
118
- } catch(e) {
119
- QUnit.ok( false, "Teardown failed on " + this.testName + ": " + e.message );
120
- }
121
- },
122
- finish: function() {
123
- if ( this.expected && this.expected != this.assertions.length ) {
124
- QUnit.ok( false, "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" );
125
- }
126
-
127
- var good = 0, bad = 0,
128
- tests = id("qunit-tests");
129
-
130
- config.stats.all += this.assertions.length;
131
- config.moduleStats.all += this.assertions.length;
132
-
133
- if ( tests ) {
134
- var ol = document.createElement("ol");
135
-
136
- for ( var i = 0; i < this.assertions.length; i++ ) {
137
- var assertion = this.assertions[i];
138
-
139
- var li = document.createElement("li");
140
- li.className = assertion.result ? "pass" : "fail";
141
- li.innerHTML = assertion.message || (assertion.result ? "okay" : "failed");
142
- ol.appendChild( li );
143
-
144
- if ( assertion.result ) {
145
- good++;
146
- } else {
147
- bad++;
148
- config.stats.bad++;
149
- config.moduleStats.bad++;
150
- }
151
- }
152
-
153
- // store result when possible
154
- defined.sessionStorage && sessionStorage.setItem("qunit-" + this.testName, bad);
155
-
156
- if (bad == 0) {
157
- ol.style.display = "none";
158
- }
159
-
160
- var b = document.createElement("strong");
161
- b.innerHTML = this.name + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + this.assertions.length + ")</b>";
162
-
163
- addEvent(b, "click", function() {
164
- var next = b.nextSibling, display = next.style.display;
165
- next.style.display = display === "none" ? "block" : "none";
166
- });
167
-
168
- addEvent(b, "dblclick", function(e) {
169
- var target = e && e.target ? e.target : window.event.srcElement;
170
- if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) {
171
- target = target.parentNode;
172
- }
173
- if ( window.location && target.nodeName.toLowerCase() === "strong" ) {
174
- window.location.search = "?" + encodeURIComponent(getText([target]).replace(/\(.+\)$/, "").replace(/(^\s*|\s*$)/g, ""));
175
- }
176
- });
177
-
178
- var li = id(this.id);
179
- li.className = bad ? "fail" : "pass";
180
- li.style.display = resultDisplayStyle(!bad);
181
- li.removeChild( li.firstChild );
182
- li.appendChild( b );
183
- li.appendChild( ol );
184
-
185
- } else {
186
- for ( var i = 0; i < this.assertions.length; i++ ) {
187
- if ( !this.assertions[i].result ) {
188
- bad++;
189
- config.stats.bad++;
190
- config.moduleStats.bad++;
191
- }
192
- }
193
- }
194
-
195
- try {
196
- QUnit.reset();
197
- } catch(e) {
198
- fail("reset() failed, following Test " + this.testName + ", exception and reset fn follows", e, QUnit.reset);
199
- }
200
-
201
- QUnit.testDone( {
202
- name: this.testName,
203
- failed: bad,
204
- passed: this.assertions.length - bad,
205
- total: this.assertions.length
206
- } );
207
- },
208
-
209
- queue: function() {
210
- var test = this;
211
- synchronize(function() {
212
- test.init();
213
- });
214
- function run() {
215
- // each of these can by async
216
- synchronize(function() {
217
- test.setup();
218
- });
219
- synchronize(function() {
220
- test.run();
221
- });
222
- synchronize(function() {
223
- test.teardown();
224
- });
225
- synchronize(function() {
226
- test.finish();
227
- });
228
- }
229
- // defer when previous test run passed, if storage is available
230
- var bad = defined.sessionStorage && +sessionStorage.getItem("qunit-" + this.testName);
231
- if (bad) {
232
- run();
233
- } else {
234
- synchronize(run);
235
- };
236
- }
237
-
238
- }
239
-
240
- var QUnit = {
241
-
242
- // call on start of module test to prepend name to all tests
243
- module: function(name, testEnvironment) {
244
- config.currentModule = name;
245
- config.currentModuleTestEnviroment = testEnvironment;
246
- },
247
-
248
- asyncTest: function(testName, expected, callback) {
249
- if ( arguments.length === 2 ) {
250
- callback = expected;
251
- expected = 0;
252
- }
253
-
254
- QUnit.test(testName, expected, callback, true);
255
- },
256
-
257
- test: function(testName, expected, callback, async) {
258
- var name = '<span class="test-name">' + testName + '</span>', testEnvironmentArg;
259
-
260
- if ( arguments.length === 2 ) {
261
- callback = expected;
262
- expected = null;
263
- }
264
- // is 2nd argument a testEnvironment?
265
- if ( expected && typeof expected === 'object') {
266
- testEnvironmentArg = expected;
267
- expected = null;
268
- }
269
-
270
- if ( config.currentModule ) {
271
- name = '<span class="module-name">' + config.currentModule + "</span>: " + name;
272
- }
273
-
274
- if ( !validTest(config.currentModule + ": " + testName) ) {
275
- return;
276
- }
277
-
278
- var test = new Test(name, testName, expected, testEnvironmentArg, async, callback);
279
- test.module = config.currentModule;
280
- test.moduleTestEnvironment = config.currentModuleTestEnviroment;
281
- test.queue();
282
- },
283
-
284
- /**
285
- * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
286
- */
287
- expect: function(asserts) {
288
- config.current.expected = asserts;
289
- },
290
-
291
- /**
292
- * Asserts true.
293
- * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
294
- */
295
- ok: function(a, msg) {
296
- a = !!a;
297
- var details = {
298
- result: a,
299
- message: msg
300
- };
301
- msg = escapeHtml(msg);
302
- QUnit.log(details);
303
- config.current.assertions.push({
304
- result: a,
305
- message: msg
306
- });
307
- },
308
-
309
- /**
310
- * Checks that the first two arguments are equal, with an optional message.
311
- * Prints out both actual and expected values.
312
- *
313
- * Prefered to ok( actual == expected, message )
314
- *
315
- * @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." );
316
- *
317
- * @param Object actual
318
- * @param Object expected
319
- * @param String message (optional)
320
- */
321
- equal: function(actual, expected, message) {
322
- QUnit.push(expected == actual, actual, expected, message);
323
- },
324
-
325
- notEqual: function(actual, expected, message) {
326
- QUnit.push(expected != actual, actual, expected, message);
327
- },
328
-
329
- deepEqual: function(actual, expected, message) {
330
- QUnit.push(QUnit.equiv(actual, expected), actual, expected, message);
331
- },
332
-
333
- notDeepEqual: function(actual, expected, message) {
334
- QUnit.push(!QUnit.equiv(actual, expected), actual, expected, message);
335
- },
336
-
337
- strictEqual: function(actual, expected, message) {
338
- QUnit.push(expected === actual, actual, expected, message);
339
- },
340
-
341
- notStrictEqual: function(actual, expected, message) {
342
- QUnit.push(expected !== actual, actual, expected, message);
343
- },
344
-
345
- raises: function(block, expected, message) {
346
- var actual, ok = false;
347
-
348
- if (typeof expected === 'string') {
349
- message = expected;
350
- expected = null;
351
- }
352
-
353
- try {
354
- block();
355
- } catch (e) {
356
- actual = e;
357
- }
358
-
359
- if (actual) {
360
- // we don't want to validate thrown error
361
- if (!expected) {
362
- ok = true;
363
- // expected is a regexp
364
- } else if (QUnit.objectType(expected) === "regexp") {
365
- ok = expected.test(actual);
366
- // expected is a constructor
367
- } else if (actual instanceof expected) {
368
- ok = true;
369
- // expected is a validation function which returns true is validation passed
370
- } else if (expected.call({}, actual) === true) {
371
- ok = true;
372
- }
373
- }
374
-
375
- QUnit.ok(ok, message);
376
- },
377
-
378
- start: function() {
379
- config.semaphore--;
380
- if (config.semaphore > 0) {
381
- // don't start until equal number of stop-calls
382
- return;
383
- }
384
- if (config.semaphore < 0) {
385
- // ignore if start is called more often then stop
386
- config.semaphore = 0;
387
- }
388
- // A slight delay, to avoid any current callbacks
389
- if ( defined.setTimeout ) {
390
- window.setTimeout(function() {
391
- if ( config.timeout ) {
392
- clearTimeout(config.timeout);
393
- }
394
-
395
- config.blocking = false;
396
- process();
397
- }, 13);
398
- } else {
399
- config.blocking = false;
400
- process();
401
- }
402
- },
403
-
404
- stop: function(timeout) {
405
- config.semaphore++;
406
- config.blocking = true;
407
-
408
- if ( timeout && defined.setTimeout ) {
409
- clearTimeout(config.timeout);
410
- config.timeout = window.setTimeout(function() {
411
- QUnit.ok( false, "Test timed out" );
412
- QUnit.start();
413
- }, timeout);
414
- }
415
- }
416
-
417
- };
418
-
419
- // Backwards compatibility, deprecated
420
- QUnit.equals = QUnit.equal;
421
- QUnit.same = QUnit.deepEqual;
422
-
423
- // Maintain internal state
424
- var config = {
425
- // The queue of tests to run
426
- queue: [],
427
-
428
- // block until document ready
429
- blocking: true
430
- };
431
-
432
- // Load paramaters
433
- (function() {
434
- var location = window.location || { search: "", protocol: "file:" },
435
- GETParams = location.search.slice(1).split('&');
436
-
437
- for ( var i = 0; i < GETParams.length; i++ ) {
438
- GETParams[i] = decodeURIComponent( GETParams[i] );
439
- if ( GETParams[i] === "noglobals" ) {
440
- GETParams.splice( i, 1 );
441
- i--;
442
- config.noglobals = true;
443
- } else if ( GETParams[i] === "notrycatch" ) {
444
- GETParams.splice( i, 1 );
445
- i--;
446
- config.notrycatch = true;
447
- } else if ( GETParams[i].search('=') > -1 ) {
448
- GETParams.splice( i, 1 );
449
- i--;
450
- }
451
- }
452
-
453
- // restrict modules/tests by get parameters
454
- config.filters = GETParams;
455
-
456
- // Figure out if we're running the tests from a server or not
457
- QUnit.isLocal = !!(location.protocol === 'file:');
458
- })();
459
-
460
- // Expose the API as global variables, unless an 'exports'
461
- // object exists, in that case we assume we're in CommonJS
462
- if ( typeof exports === "undefined" || typeof require === "undefined" ) {
463
- extend(window, QUnit);
464
- window.QUnit = QUnit;
465
- } else {
466
- extend(exports, QUnit);
467
- exports.QUnit = QUnit;
468
- }
469
-
470
- // define these after exposing globals to keep them in these QUnit namespace only
471
- extend(QUnit, {
472
- config: config,
473
-
474
- // Initialize the configuration options
475
- init: function() {
476
- extend(config, {
477
- stats: { all: 0, bad: 0 },
478
- moduleStats: { all: 0, bad: 0 },
479
- started: +new Date,
480
- updateRate: 1000,
481
- blocking: false,
482
- autostart: true,
483
- autorun: false,
484
- filters: [],
485
- queue: [],
486
- semaphore: 0
487
- });
488
-
489
- var tests = id("qunit-tests"),
490
- banner = id("qunit-banner"),
491
- result = id("qunit-testresult");
492
-
493
- if ( tests ) {
494
- tests.innerHTML = "";
495
- }
496
-
497
- if ( banner ) {
498
- banner.className = "";
499
- }
500
-
501
- if ( result ) {
502
- result.parentNode.removeChild( result );
503
- }
504
- },
505
-
506
- /**
507
- * Resets the test setup. Useful for tests that modify the DOM.
508
- *
509
- * If jQuery is available, uses jQuery's html(), otherwise just innerHTML.
510
- */
511
- reset: function() {
512
- if ( window.jQuery ) {
513
- jQuery( "#main, #qunit-fixture" ).html( config.fixture );
514
- } else {
515
- var main = id( 'main' ) || id( 'qunit-fixture' );
516
- if ( main ) {
517
- main.innerHTML = config.fixture;
518
- }
519
- }
520
- },
521
-
522
- /**
523
- * Trigger an event on an element.
524
- *
525
- * @example triggerEvent( document.body, "click" );
526
- *
527
- * @param DOMElement elem
528
- * @param String type
529
- */
530
- triggerEvent: function( elem, type, event ) {
531
- if ( document.createEvent ) {
532
- event = document.createEvent("MouseEvents");
533
- event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
534
- 0, 0, 0, 0, 0, false, false, false, false, 0, null);
535
- elem.dispatchEvent( event );
536
-
537
- } else if ( elem.fireEvent ) {
538
- elem.fireEvent("on"+type);
539
- }
540
- },
541
-
542
- // Safe object type checking
543
- is: function( type, obj ) {
544
- return QUnit.objectType( obj ) == type;
545
- },
546
-
547
- objectType: function( obj ) {
548
- if (typeof obj === "undefined") {
549
- return "undefined";
550
-
551
- // consider: typeof null === object
552
- }
553
- if (obj === null) {
554
- return "null";
555
- }
556
-
557
- var type = Object.prototype.toString.call( obj )
558
- .match(/^\[object\s(.*)\]$/)[1] || '';
559
-
560
- switch (type) {
561
- case 'Number':
562
- if (isNaN(obj)) {
563
- return "nan";
564
- } else {
565
- return "number";
566
- }
567
- case 'String':
568
- case 'Boolean':
569
- case 'Array':
570
- case 'Date':
571
- case 'RegExp':
572
- case 'Function':
573
- return type.toLowerCase();
574
- }
575
- if (typeof obj === "object") {
576
- return "object";
577
- }
578
- return undefined;
579
- },
580
-
581
- push: function(result, actual, expected, message) {
582
- var details = {
583
- result: result,
584
- message: message,
585
- actual: actual,
586
- expected: expected
587
- };
588
-
589
- message = escapeHtml(message) || (result ? "okay" : "failed");
590
- message = '<span class="test-message">' + message + "</span>";
591
- expected = escapeHtml(QUnit.jsDump.parse(expected));
592
- actual = escapeHtml(QUnit.jsDump.parse(actual));
593
- var output = message + '<table><tr class="test-expected"><th>Expected: </th><td><pre>' + expected + '</pre></td></tr>';
594
- if (actual != expected) {
595
- output += '<tr class="test-actual"><th>Result: </th><td><pre>' + actual + '</pre></td></tr>';
596
- output += '<tr class="test-diff"><th>Diff: </th><td><pre>' + QUnit.diff(expected, actual) +'</pre></td></tr>';
597
- }
598
- if (!result) {
599
- var source = sourceFromStacktrace();
600
- if (source) {
601
- details.source = source;
602
- output += '<tr class="test-source"><th>Source: </th><td><pre>' + source +'</pre></td></tr>';
603
- }
604
- }
605
- output += "</table>";
606
-
607
- QUnit.log(details);
608
-
609
- config.current.assertions.push({
610
- result: !!result,
611
- message: output
612
- });
613
- },
614
-
615
- // Logging callbacks; all receive a single argument with the listed properties
616
- // run test/logs.html for any related changes
617
- begin: function() {},
618
- // done: { failed, passed, total, runtime }
619
- done: function() {},
620
- // log: { result, actual, expected, message }
621
- log: function() {},
622
- // testStart: { name }
623
- testStart: function() {},
624
- // testDone: { name, failed, passed, total }
625
- testDone: function() {},
626
- // moduleStart: { name }
627
- moduleStart: function() {},
628
- // moduleDone: { name, failed, passed, total }
629
- moduleDone: function() {}
630
- });
631
-
632
- if ( typeof document === "undefined" || document.readyState === "complete" ) {
633
- config.autorun = true;
634
- }
635
-
636
- addEvent(window, "load", function() {
637
- QUnit.begin({});
638
-
639
- // Initialize the config, saving the execution queue
640
- var oldconfig = extend({}, config);
641
- QUnit.init();
642
- extend(config, oldconfig);
643
-
644
- config.blocking = false;
645
-
646
- var userAgent = id("qunit-userAgent");
647
- if ( userAgent ) {
648
- userAgent.innerHTML = navigator.userAgent;
649
- }
650
- var banner = id("qunit-header");
651
- if ( banner ) {
652
- var paramsIndex = location.href.lastIndexOf(location.search);
653
- if ( paramsIndex > -1 ) {
654
- var mainPageLocation = location.href.slice(0, paramsIndex);
655
- if ( mainPageLocation == location.href ) {
656
- banner.innerHTML = '<a href=""> ' + banner.innerHTML + '</a> ';
657
- } else {
658
- var testName = decodeURIComponent(location.search.slice(1));
659
- banner.innerHTML = '<a href="' + mainPageLocation + '">' + banner.innerHTML + '</a> &#8250; <a href="">' + testName + '</a>';
660
- }
661
- }
662
- }
663
-
664
- var toolbar = id("qunit-testrunner-toolbar");
665
- if ( toolbar ) {
666
- var filter = document.createElement("input");
667
- filter.type = "checkbox";
668
- filter.id = "qunit-filter-pass";
669
- addEvent( filter, "click", function() {
670
- var li = document.getElementsByTagName("li");
671
- for ( var i = 0; i < li.length; i++ ) {
672
- if ( li[i].className.indexOf("pass") > -1 ) {
673
- li[i].style.display = filter.checked ? "none" : "";
674
- }
675
- }
676
- if ( defined.sessionStorage ) {
677
- sessionStorage.setItem("qunit-filter-passed-tests", filter.checked ? "true" : "");
678
- }
679
- });
680
- if ( defined.sessionStorage && sessionStorage.getItem("qunit-filter-passed-tests") ) {
681
- filter.checked = true;
682
- }
683
- toolbar.appendChild( filter );
684
-
685
- var label = document.createElement("label");
686
- label.setAttribute("for", "qunit-filter-pass");
687
- label.innerHTML = "Hide passed tests";
688
- toolbar.appendChild( label );
689
- }
690
-
691
- var main = id('main') || id('qunit-fixture');
692
- if ( main ) {
693
- config.fixture = main.innerHTML;
694
- }
695
-
696
- if (config.autostart) {
697
- QUnit.start();
698
- }
699
- });
700
-
701
- function done() {
702
- config.autorun = true;
703
-
704
- // Log the last module results
705
- if ( config.currentModule ) {
706
- QUnit.moduleDone( {
707
- name: config.currentModule,
708
- failed: config.moduleStats.bad,
709
- passed: config.moduleStats.all - config.moduleStats.bad,
710
- total: config.moduleStats.all
711
- } );
712
- }
713
-
714
- var banner = id("qunit-banner"),
715
- tests = id("qunit-tests"),
716
- runtime = +new Date - config.started,
717
- passed = config.stats.all - config.stats.bad,
718
- html = [
719
- 'Tests completed in ',
720
- runtime,
721
- ' milliseconds.<br/>',
722
- '<span class="passed">',
723
- passed,
724
- '</span> tests of <span class="total">',
725
- config.stats.all,
726
- '</span> passed, <span class="failed">',
727
- config.stats.bad,
728
- '</span> failed.'
729
- ].join('');
730
-
731
- if ( banner ) {
732
- banner.className = (config.stats.bad ? "qunit-fail" : "qunit-pass");
733
- }
734
-
735
- if ( tests ) {
736
- var result = id("qunit-testresult");
737
-
738
- if ( !result ) {
739
- result = document.createElement("p");
740
- result.id = "qunit-testresult";
741
- result.className = "result";
742
- tests.parentNode.insertBefore( result, tests.nextSibling );
743
- }
744
-
745
- result.innerHTML = html;
746
- }
747
-
748
- QUnit.done( {
749
- failed: config.stats.bad,
750
- passed: passed,
751
- total: config.stats.all,
752
- runtime: runtime
753
- } );
754
- }
755
-
756
- function validTest( name ) {
757
- var i = config.filters.length,
758
- run = false;
759
-
760
- if ( !i ) {
761
- return true;
762
- }
763
-
764
- while ( i-- ) {
765
- var filter = config.filters[i],
766
- not = filter.charAt(0) == '!';
767
-
768
- if ( not ) {
769
- filter = filter.slice(1);
770
- }
771
-
772
- if ( name.indexOf(filter) !== -1 ) {
773
- return !not;
774
- }
775
-
776
- if ( not ) {
777
- run = true;
778
- }
779
- }
780
-
781
- return run;
782
- }
783
-
784
- // so far supports only Firefox, Chrome and Opera (buggy)
785
- // could be extended in the future to use something like https://github.com/csnover/TraceKit
786
- function sourceFromStacktrace() {
787
- try {
788
- throw new Error();
789
- } catch ( e ) {
790
- if (e.stacktrace) {
791
- // Opera
792
- return e.stacktrace.split("\n")[6];
793
- } else if (e.stack) {
794
- // Firefox, Chrome
795
- return e.stack.split("\n")[4];
796
- }
797
- }
798
- }
799
-
800
- function resultDisplayStyle(passed) {
801
- return passed && id("qunit-filter-pass") && id("qunit-filter-pass").checked ? 'none' : '';
802
- }
803
-
804
- function escapeHtml(s) {
805
- if (!s) {
806
- return "";
807
- }
808
- s = s + "";
809
- return s.replace(/[\&"<>\\]/g, function(s) {
810
- switch(s) {
811
- case "&": return "&amp;";
812
- case "\\": return "\\\\";
813
- case '"': return '\"';
814
- case "<": return "&lt;";
815
- case ">": return "&gt;";
816
- default: return s;
817
- }
818
- });
819
- }
820
-
821
- function synchronize( callback ) {
822
- config.queue.push( callback );
823
-
824
- if ( config.autorun && !config.blocking ) {
825
- process();
826
- }
827
- }
828
-
829
- function process() {
830
- var start = (new Date()).getTime();
831
-
832
- while ( config.queue.length && !config.blocking ) {
833
- if ( config.updateRate <= 0 || (((new Date()).getTime() - start) < config.updateRate) ) {
834
- config.queue.shift()();
835
- } else {
836
- window.setTimeout( process, 13 );
837
- break;
838
- }
839
- }
840
- if (!config.blocking && !config.queue.length) {
841
- done();
842
- }
843
- }
844
-
845
- function saveGlobal() {
846
- config.pollution = [];
847
-
848
- if ( config.noglobals ) {
849
- for ( var key in window ) {
850
- config.pollution.push( key );
851
- }
852
- }
853
- }
854
-
855
- function checkPollution( name ) {
856
- var old = config.pollution;
857
- saveGlobal();
858
-
859
- var newGlobals = diff( old, config.pollution );
860
- if ( newGlobals.length > 0 ) {
861
- ok( false, "Introduced global variable(s): " + newGlobals.join(", ") );
862
- config.current.expected++;
863
- }
864
-
865
- var deletedGlobals = diff( config.pollution, old );
866
- if ( deletedGlobals.length > 0 ) {
867
- ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") );
868
- config.current.expected++;
869
- }
870
- }
871
-
872
- // returns a new Array with the elements that are in a but not in b
873
- function diff( a, b ) {
874
- var result = a.slice();
875
- for ( var i = 0; i < result.length; i++ ) {
876
- for ( var j = 0; j < b.length; j++ ) {
877
- if ( result[i] === b[j] ) {
878
- result.splice(i, 1);
879
- i--;
880
- break;
881
- }
882
- }
883
- }
884
- return result;
885
- }
886
-
887
- function fail(message, exception, callback) {
888
- if ( typeof console !== "undefined" && console.error && console.warn ) {
889
- console.error(message);
890
- console.error(exception);
891
- console.warn(callback.toString());
892
-
893
- } else if ( window.opera && opera.postError ) {
894
- opera.postError(message, exception, callback.toString);
895
- }
896
- }
897
-
898
- function extend(a, b) {
899
- for ( var prop in b ) {
900
- a[prop] = b[prop];
901
- }
902
-
903
- return a;
904
- }
905
-
906
- function addEvent(elem, type, fn) {
907
- if ( elem.addEventListener ) {
908
- elem.addEventListener( type, fn, false );
909
- } else if ( elem.attachEvent ) {
910
- elem.attachEvent( "on" + type, fn );
911
- } else {
912
- fn();
913
- }
914
- }
915
-
916
- function id(name) {
917
- return !!(typeof document !== "undefined" && document && document.getElementById) &&
918
- document.getElementById( name );
919
- }
920
-
921
- // Test for equality any JavaScript type.
922
- // Discussions and reference: http://philrathe.com/articles/equiv
923
- // Test suites: http://philrathe.com/tests/equiv
924
- // Author: Philippe Rathé <prathe@gmail.com>
925
- QUnit.equiv = function () {
926
-
927
- var innerEquiv; // the real equiv function
928
- var callers = []; // stack to decide between skip/abort functions
929
- var parents = []; // stack to avoiding loops from circular referencing
930
-
931
- // Call the o related callback with the given arguments.
932
- function bindCallbacks(o, callbacks, args) {
933
- var prop = QUnit.objectType(o);
934
- if (prop) {
935
- if (QUnit.objectType(callbacks[prop]) === "function") {
936
- return callbacks[prop].apply(callbacks, args);
937
- } else {
938
- return callbacks[prop]; // or undefined
939
- }
940
- }
941
- }
942
-
943
- var callbacks = function () {
944
-
945
- // for string, boolean, number and null
946
- function useStrictEquality(b, a) {
947
- if (b instanceof a.constructor || a instanceof b.constructor) {
948
- // to catch short annotaion VS 'new' annotation of a declaration
949
- // e.g. var i = 1;
950
- // var j = new Number(1);
951
- return a == b;
952
- } else {
953
- return a === b;
954
- }
955
- }
956
-
957
- return {
958
- "string": useStrictEquality,
959
- "boolean": useStrictEquality,
960
- "number": useStrictEquality,
961
- "null": useStrictEquality,
962
- "undefined": useStrictEquality,
963
-
964
- "nan": function (b) {
965
- return isNaN(b);
966
- },
967
-
968
- "date": function (b, a) {
969
- return QUnit.objectType(b) === "date" && a.valueOf() === b.valueOf();
970
- },
971
-
972
- "regexp": function (b, a) {
973
- return QUnit.objectType(b) === "regexp" &&
974
- a.source === b.source && // the regex itself
975
- a.global === b.global && // and its modifers (gmi) ...
976
- a.ignoreCase === b.ignoreCase &&
977
- a.multiline === b.multiline;
978
- },
979
-
980
- // - skip when the property is a method of an instance (OOP)
981
- // - abort otherwise,
982
- // initial === would have catch identical references anyway
983
- "function": function () {
984
- var caller = callers[callers.length - 1];
985
- return caller !== Object &&
986
- typeof caller !== "undefined";
987
- },
988
-
989
- "array": function (b, a) {
990
- var i, j, loop;
991
- var len;
992
-
993
- // b could be an object literal here
994
- if ( ! (QUnit.objectType(b) === "array")) {
995
- return false;
996
- }
997
-
998
- len = a.length;
999
- if (len !== b.length) { // safe and faster
1000
- return false;
1001
- }
1002
-
1003
- //track reference to avoid circular references
1004
- parents.push(a);
1005
- for (i = 0; i < len; i++) {
1006
- loop = false;
1007
- for(j=0;j<parents.length;j++){
1008
- if(parents[j] === a[i]){
1009
- loop = true;//dont rewalk array
1010
- }
1011
- }
1012
- if (!loop && ! innerEquiv(a[i], b[i])) {
1013
- parents.pop();
1014
- return false;
1015
- }
1016
- }
1017
- parents.pop();
1018
- return true;
1019
- },
1020
-
1021
- "object": function (b, a) {
1022
- var i, j, loop;
1023
- var eq = true; // unless we can proove it
1024
- var aProperties = [], bProperties = []; // collection of strings
1025
-
1026
- // comparing constructors is more strict than using instanceof
1027
- if ( a.constructor !== b.constructor) {
1028
- return false;
1029
- }
1030
-
1031
- // stack constructor before traversing properties
1032
- callers.push(a.constructor);
1033
- //track reference to avoid circular references
1034
- parents.push(a);
1035
-
1036
- for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
1037
- loop = false;
1038
- for(j=0;j<parents.length;j++){
1039
- if(parents[j] === a[i])
1040
- loop = true; //don't go down the same path twice
1041
- }
1042
- aProperties.push(i); // collect a's properties
1043
-
1044
- if (!loop && ! innerEquiv(a[i], b[i])) {
1045
- eq = false;
1046
- break;
1047
- }
1048
- }
1049
-
1050
- callers.pop(); // unstack, we are done
1051
- parents.pop();
1052
-
1053
- for (i in b) {
1054
- bProperties.push(i); // collect b's properties
1055
- }
1056
-
1057
- // Ensures identical properties name
1058
- return eq && innerEquiv(aProperties.sort(), bProperties.sort());
1059
- }
1060
- };
1061
- }();
1062
-
1063
- innerEquiv = function () { // can take multiple arguments
1064
- var args = Array.prototype.slice.apply(arguments);
1065
- if (args.length < 2) {
1066
- return true; // end transition
1067
- }
1068
-
1069
- return (function (a, b) {
1070
- if (a === b) {
1071
- return true; // catch the most you can
1072
- } else if (a === null || b === null || typeof a === "undefined" || typeof b === "undefined" || QUnit.objectType(a) !== QUnit.objectType(b)) {
1073
- return false; // don't lose time with error prone cases
1074
- } else {
1075
- return bindCallbacks(a, callbacks, [b, a]);
1076
- }
1077
-
1078
- // apply transition with (1..n) arguments
1079
- })(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length -1));
1080
- };
1081
-
1082
- return innerEquiv;
1083
-
1084
- }();
1085
-
1086
- /**
1087
- * jsDump
1088
- * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
1089
- * Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php)
1090
- * Date: 5/15/2008
1091
- * @projectDescription Advanced and extensible data dumping for Javascript.
1092
- * @version 1.0.0
1093
- * @author Ariel Flesler
1094
- * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
1095
- */
1096
- QUnit.jsDump = (function() {
1097
- function quote( str ) {
1098
- return '"' + str.toString().replace(/"/g, '\\"') + '"';
1099
- };
1100
- function literal( o ) {
1101
- return o + '';
1102
- };
1103
- function join( pre, arr, post ) {
1104
- var s = jsDump.separator(),
1105
- base = jsDump.indent(),
1106
- inner = jsDump.indent(1);
1107
- if ( arr.join )
1108
- arr = arr.join( ',' + s + inner );
1109
- if ( !arr )
1110
- return pre + post;
1111
- return [ pre, inner + arr, base + post ].join(s);
1112
- };
1113
- function array( arr ) {
1114
- var i = arr.length, ret = Array(i);
1115
- this.up();
1116
- while ( i-- )
1117
- ret[i] = this.parse( arr[i] );
1118
- this.down();
1119
- return join( '[', ret, ']' );
1120
- };
1121
-
1122
- var reName = /^function (\w+)/;
1123
-
1124
- var jsDump = {
1125
- parse:function( obj, type ) { //type is used mostly internally, you can fix a (custom)type in advance
1126
- var parser = this.parsers[ type || this.typeOf(obj) ];
1127
- type = typeof parser;
1128
-
1129
- return type == 'function' ? parser.call( this, obj ) :
1130
- type == 'string' ? parser :
1131
- this.parsers.error;
1132
- },
1133
- typeOf:function( obj ) {
1134
- var type;
1135
- if ( obj === null ) {
1136
- type = "null";
1137
- } else if (typeof obj === "undefined") {
1138
- type = "undefined";
1139
- } else if (QUnit.is("RegExp", obj)) {
1140
- type = "regexp";
1141
- } else if (QUnit.is("Date", obj)) {
1142
- type = "date";
1143
- } else if (QUnit.is("Function", obj)) {
1144
- type = "function";
1145
- } else if (typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined") {
1146
- type = "window";
1147
- } else if (obj.nodeType === 9) {
1148
- type = "document";
1149
- } else if (obj.nodeType) {
1150
- type = "node";
1151
- } else if (typeof obj === "object" && typeof obj.length === "number" && obj.length >= 0) {
1152
- type = "array";
1153
- } else {
1154
- type = typeof obj;
1155
- }
1156
- return type;
1157
- },
1158
- separator:function() {
1159
- return this.multiline ? this.HTML ? '<br />' : '\n' : this.HTML ? '&nbsp;' : ' ';
1160
- },
1161
- indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing
1162
- if ( !this.multiline )
1163
- return '';
1164
- var chr = this.indentChar;
1165
- if ( this.HTML )
1166
- chr = chr.replace(/\t/g,' ').replace(/ /g,'&nbsp;');
1167
- return Array( this._depth_ + (extra||0) ).join(chr);
1168
- },
1169
- up:function( a ) {
1170
- this._depth_ += a || 1;
1171
- },
1172
- down:function( a ) {
1173
- this._depth_ -= a || 1;
1174
- },
1175
- setParser:function( name, parser ) {
1176
- this.parsers[name] = parser;
1177
- },
1178
- // The next 3 are exposed so you can use them
1179
- quote:quote,
1180
- literal:literal,
1181
- join:join,
1182
- //
1183
- _depth_: 1,
1184
- // This is the list of parsers, to modify them, use jsDump.setParser
1185
- parsers:{
1186
- window: '[Window]',
1187
- document: '[Document]',
1188
- error:'[ERROR]', //when no parser is found, shouldn't happen
1189
- unknown: '[Unknown]',
1190
- 'null':'null',
1191
- undefined:'undefined',
1192
- 'function':function( fn ) {
1193
- var ret = 'function',
1194
- name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE
1195
- if ( name )
1196
- ret += ' ' + name;
1197
- ret += '(';
1198
-
1199
- ret = [ ret, QUnit.jsDump.parse( fn, 'functionArgs' ), '){'].join('');
1200
- return join( ret, QUnit.jsDump.parse(fn,'functionCode'), '}' );
1201
- },
1202
- array: array,
1203
- nodelist: array,
1204
- arguments: array,
1205
- object:function( map ) {
1206
- var ret = [ ];
1207
- QUnit.jsDump.up();
1208
- for ( var key in map )
1209
- ret.push( QUnit.jsDump.parse(key,'key') + ': ' + QUnit.jsDump.parse(map[key]) );
1210
- QUnit.jsDump.down();
1211
- return join( '{', ret, '}' );
1212
- },
1213
- node:function( node ) {
1214
- var open = QUnit.jsDump.HTML ? '&lt;' : '<',
1215
- close = QUnit.jsDump.HTML ? '&gt;' : '>';
1216
-
1217
- var tag = node.nodeName.toLowerCase(),
1218
- ret = open + tag;
1219
-
1220
- for ( var a in QUnit.jsDump.DOMAttrs ) {
1221
- var val = node[QUnit.jsDump.DOMAttrs[a]];
1222
- if ( val )
1223
- ret += ' ' + a + '=' + QUnit.jsDump.parse( val, 'attribute' );
1224
- }
1225
- return ret + close + open + '/' + tag + close;
1226
- },
1227
- functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function
1228
- var l = fn.length;
1229
- if ( !l ) return '';
1230
-
1231
- var args = Array(l);
1232
- while ( l-- )
1233
- args[l] = String.fromCharCode(97+l);//97 is 'a'
1234
- return ' ' + args.join(', ') + ' ';
1235
- },
1236
- key:quote, //object calls it internally, the key part of an item in a map
1237
- functionCode:'[code]', //function calls it internally, it's the content of the function
1238
- attribute:quote, //node calls it internally, it's an html attribute value
1239
- string:quote,
1240
- date:quote,
1241
- regexp:literal, //regex
1242
- number:literal,
1243
- 'boolean':literal
1244
- },
1245
- DOMAttrs:{//attributes to dump from nodes, name=>realName
1246
- id:'id',
1247
- name:'name',
1248
- 'class':'className'
1249
- },
1250
- HTML:false,//if true, entities are escaped ( <, >, \t, space and \n )
1251
- indentChar:' ',//indentation unit
1252
- multiline:true //if true, items in a collection, are separated by a \n, else just a space.
1253
- };
1254
-
1255
- return jsDump;
1256
- })();
1257
-
1258
- // from Sizzle.js
1259
- function getText( elems ) {
1260
- var ret = "", elem;
1261
-
1262
- for ( var i = 0; elems[i]; i++ ) {
1263
- elem = elems[i];
1264
-
1265
- // Get the text from text nodes and CDATA nodes
1266
- if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
1267
- ret += elem.nodeValue;
1268
-
1269
- // Traverse everything else, except comment nodes
1270
- } else if ( elem.nodeType !== 8 ) {
1271
- ret += getText( elem.childNodes );
1272
- }
1273
- }
1274
-
1275
- return ret;
1276
- };
1277
-
1278
- /*
1279
- * Javascript Diff Algorithm
1280
- * By John Resig (http://ejohn.org/)
1281
- * Modified by Chu Alan "sprite"
1282
- *
1283
- * Released under the MIT license.
1284
- *
1285
- * More Info:
1286
- * http://ejohn.org/projects/javascript-diff-algorithm/
1287
- *
1288
- * Usage: QUnit.diff(expected, actual)
1289
- *
1290
- * QUnit.diff("the quick brown fox jumped over", "the quick fox jumps over") == "the quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over"
1291
- */
1292
- QUnit.diff = (function() {
1293
- function diff(o, n){
1294
- var ns = new Object();
1295
- var os = new Object();
1296
-
1297
- for (var i = 0; i < n.length; i++) {
1298
- if (ns[n[i]] == null)
1299
- ns[n[i]] = {
1300
- rows: new Array(),
1301
- o: null
1302
- };
1303
- ns[n[i]].rows.push(i);
1304
- }
1305
-
1306
- for (var i = 0; i < o.length; i++) {
1307
- if (os[o[i]] == null)
1308
- os[o[i]] = {
1309
- rows: new Array(),
1310
- n: null
1311
- };
1312
- os[o[i]].rows.push(i);
1313
- }
1314
-
1315
- for (var i in ns) {
1316
- if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && os[i].rows.length == 1) {
1317
- n[ns[i].rows[0]] = {
1318
- text: n[ns[i].rows[0]],
1319
- row: os[i].rows[0]
1320
- };
1321
- o[os[i].rows[0]] = {
1322
- text: o[os[i].rows[0]],
1323
- row: ns[i].rows[0]
1324
- };
1325
- }
1326
- }
1327
-
1328
- for (var i = 0; i < n.length - 1; i++) {
1329
- if (n[i].text != null && n[i + 1].text == null && n[i].row + 1 < o.length && o[n[i].row + 1].text == null &&
1330
- n[i + 1] == o[n[i].row + 1]) {
1331
- n[i + 1] = {
1332
- text: n[i + 1],
1333
- row: n[i].row + 1
1334
- };
1335
- o[n[i].row + 1] = {
1336
- text: o[n[i].row + 1],
1337
- row: i + 1
1338
- };
1339
- }
1340
- }
1341
-
1342
- for (var i = n.length - 1; i > 0; i--) {
1343
- if (n[i].text != null && n[i - 1].text == null && n[i].row > 0 && o[n[i].row - 1].text == null &&
1344
- n[i - 1] == o[n[i].row - 1]) {
1345
- n[i - 1] = {
1346
- text: n[i - 1],
1347
- row: n[i].row - 1
1348
- };
1349
- o[n[i].row - 1] = {
1350
- text: o[n[i].row - 1],
1351
- row: i - 1
1352
- };
1353
- }
1354
- }
1355
-
1356
- return {
1357
- o: o,
1358
- n: n
1359
- };
1360
- }
1361
-
1362
- return function(o, n){
1363
- o = o.replace(/\s+$/, '');
1364
- n = n.replace(/\s+$/, '');
1365
- var out = diff(o == "" ? [] : o.split(/\s+/), n == "" ? [] : n.split(/\s+/));
1366
-
1367
- var str = "";
1368
-
1369
- var oSpace = o.match(/\s+/g);
1370
- if (oSpace == null) {
1371
- oSpace = [" "];
1372
- }
1373
- else {
1374
- oSpace.push(" ");
1375
- }
1376
- var nSpace = n.match(/\s+/g);
1377
- if (nSpace == null) {
1378
- nSpace = [" "];
1379
- }
1380
- else {
1381
- nSpace.push(" ");
1382
- }
1383
-
1384
- if (out.n.length == 0) {
1385
- for (var i = 0; i < out.o.length; i++) {
1386
- str += '<del>' + out.o[i] + oSpace[i] + "</del>";
1387
- }
1388
- }
1389
- else {
1390
- if (out.n[0].text == null) {
1391
- for (n = 0; n < out.o.length && out.o[n].text == null; n++) {
1392
- str += '<del>' + out.o[n] + oSpace[n] + "</del>";
1393
- }
1394
- }
1395
-
1396
- for (var i = 0; i < out.n.length; i++) {
1397
- if (out.n[i].text == null) {
1398
- str += '<ins>' + out.n[i] + nSpace[i] + "</ins>";
1399
- }
1400
- else {
1401
- var pre = "";
1402
-
1403
- for (n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++) {
1404
- pre += '<del>' + out.o[n] + oSpace[n] + "</del>";
1405
- }
1406
- str += " " + out.n[i].text + nSpace[i] + pre;
1407
- }
1408
- }
1409
- }
1410
-
1411
- return str;
1412
- };
1413
- })();
1414
-
1415
- })(this);