Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #4 from irvingc/binifying

Binifying
  • Loading branch information...
commit e4345fc96b67dd52d5b5c45779afad8cb95dc3f4 2 parents d9b8648 + d677cd2
badlee authored

Showing 476 changed files with 14 additions and 131,228 deletions. Show diff stats Hide diff stats

  1. +2 0  .gitignore
  2. +7 1 README.md
  3. +5 4 jscc.js → bin/jscc
  4. +0 3  gitEtapes
  5. 0  { → lib}/driver_node.js_
  6. BIN  node
  7. BIN  node_modules/htmlparser/.DS_Store
  8. +0 17 node_modules/htmlparser/.project
  9. +0 17 node_modules/htmlparser/.project.bak
  10. +0 6 node_modules/htmlparser/.settings/.jsdtscope
  11. +0 1  node_modules/htmlparser/.settings/org.eclipse.wst.jsdt.ui.superType.container
  12. +0 1  node_modules/htmlparser/.settings/org.eclipse.wst.jsdt.ui.superType.name
  13. +0 108 node_modules/htmlparser/.tmp_runtests.html.51164~
  14. +0 108 node_modules/htmlparser/.tmp_runtests.min.html.92328~
  15. +0 33 node_modules/htmlparser/CHANGELOG
  16. +0 18 node_modules/htmlparser/LICENSE
  17. +0 186 node_modules/htmlparser/README.md
  18. +0 35 node_modules/htmlparser/a
  19. +0 35 node_modules/htmlparser/b
  20. +0 35 node_modules/htmlparser/c
  21. +0 482 node_modules/htmlparser/json2.js
  22. +0 822 node_modules/htmlparser/lib/htmlparser.js
  23. +0 22 node_modules/htmlparser/lib/htmlparser.min.js
  24. +0 6 node_modules/htmlparser/lib/node-htmlparser.js
  25. +0 6 node_modules/htmlparser/lib/node-htmlparser.min.js
  26. BIN  node_modules/htmlparser/libxmljs.node
  27. +0 54 node_modules/htmlparser/newparser.js
  28. +0 754 node_modules/htmlparser/node-htmlparser.old.js
  29. +0 23 node_modules/htmlparser/package.json
  30. +0 4 node_modules/htmlparser/profile
  31. +0 53 node_modules/htmlparser/profile.getelement.js
  32. +0 199 node_modules/htmlparser/profile.getelement.txt
  33. +0 63 node_modules/htmlparser/profile.js
  34. +0 301 node_modules/htmlparser/profileresults.txt
  35. +0 9 node_modules/htmlparser/pulls/node-htmlparser/CHANGELOG
  36. +0 18 node_modules/htmlparser/pulls/node-htmlparser/LICENSE
  37. +0 186 node_modules/htmlparser/pulls/node-htmlparser/README.md
  38. +0 482 node_modules/htmlparser/pulls/node-htmlparser/json2.js
  39. +0 772 node_modules/htmlparser/pulls/node-htmlparser/lib/node-htmlparser.js
  40. +0 22 node_modules/htmlparser/pulls/node-htmlparser/lib/node-htmlparser.min.js
  41. +0 23 node_modules/htmlparser/pulls/node-htmlparser/package.json
  42. +0 63 node_modules/htmlparser/pulls/node-htmlparser/profile.js
  43. +0 107 node_modules/htmlparser/pulls/node-htmlparser/runtests.html
  44. +0 75 node_modules/htmlparser/pulls/node-htmlparser/runtests.js
  45. +0 107 node_modules/htmlparser/pulls/node-htmlparser/runtests.min.html
  46. +0 75 node_modules/htmlparser/pulls/node-htmlparser/runtests.min.js
  47. +0 15 node_modules/htmlparser/pulls/node-htmlparser/snippet.js
  48. +0 57 node_modules/htmlparser/pulls/node-htmlparser/tests/01-basic.js
  49. +0 35 node_modules/htmlparser/pulls/node-htmlparser/tests/02-single_tag_1.js
  50. +0 36 node_modules/htmlparser/pulls/node-htmlparser/tests/03-single_tag_2.js
  51. +0 52 node_modules/htmlparser/pulls/node-htmlparser/tests/04-unescaped_in_script.js
  52. +0 44 node_modules/htmlparser/pulls/node-htmlparser/tests/05-tags_in_comment.js
  53. +0 44 node_modules/htmlparser/pulls/node-htmlparser/tests/06-comment_in_script.js
  54. +0 45 node_modules/htmlparser/pulls/node-htmlparser/tests/07-unescaped_in_style.js
  55. +0 45 node_modules/htmlparser/pulls/node-htmlparser/tests/08-extra_spaces_in_tag.js
  56. +0 45 node_modules/htmlparser/pulls/node-htmlparser/tests/09-unquoted_attrib.js
  57. +0 39 node_modules/htmlparser/pulls/node-htmlparser/tests/10-singular_attribute.js
  58. +0 46 node_modules/htmlparser/pulls/node-htmlparser/tests/11-text_outside_tags.js
  59. +0 37 node_modules/htmlparser/pulls/node-htmlparser/tests/12-text_only.js
  60. +0 45 node_modules/htmlparser/pulls/node-htmlparser/tests/13-comment_in_text.js
  61. +0 53 node_modules/htmlparser/pulls/node-htmlparser/tests/14-comment_in_text_in_script.js
  62. +0 43 node_modules/htmlparser/pulls/node-htmlparser/tests/15-non-verbose.js
  63. +0 68 node_modules/htmlparser/pulls/node-htmlparser/tests/16-ignore_whitespace.js
  64. +0 34 node_modules/htmlparser/pulls/node-htmlparser/tests/17-xml_namespace.js
  65. +0 36 node_modules/htmlparser/pulls/node-htmlparser/tests/18-enforce_empty_tags.js
  66. +0 38 node_modules/htmlparser/pulls/node-htmlparser/tests/19-ignore_empty_tags.js
  67. +0 117 node_modules/htmlparser/pulls/node-htmlparser/tests/20-rss.js
  68. +0 77 node_modules/htmlparser/pulls/node-htmlparser/tests/21-atom.js
  69. +0 35 node_modules/htmlparser/pulls/node-htmlparser/utils_example.js
  70. +0 16 node_modules/htmlparser/rssbug.js
  71. +0 1  node_modules/htmlparser/rssbug.rss
  72. +0 108 node_modules/htmlparser/runtests.html
  73. +0 75 node_modules/htmlparser/runtests.js
  74. +0 108 node_modules/htmlparser/runtests.min.html
  75. +0 75 node_modules/htmlparser/runtests.min.js
  76. +0 15 node_modules/htmlparser/snippet.js
  77. +0 11 node_modules/htmlparser/testdata/.tmp_test.html.2854~
  78. +0 2,948 node_modules/htmlparser/testdata/.tmp_trackerchecker.html.65425~
  79. +0 10 node_modules/htmlparser/testdata/.tmp_trackerchecker.html.76922~
  80. +0 2,948 node_modules/htmlparser/testdata/.tmp_trackerchecker.html.80022~
  81. +0 2,948 node_modules/htmlparser/testdata/.tmp_trackerchecker2.html.51378~
  82. +0 2,947 node_modules/htmlparser/testdata/.tmp_trackerchecker2.html.75287~
  83. +0 3,311 node_modules/htmlparser/testdata/api.html
  84. +0 3,460 node_modules/htmlparser/testdata/getelement.html
  85. +0 2,733 node_modules/htmlparser/testdata/trackerchecker.html
  86. +0 61 node_modules/htmlparser/tests/01-basic.js
  87. +0 39 node_modules/htmlparser/tests/02-single_tag_1.js
  88. +0 40 node_modules/htmlparser/tests/03-single_tag_2.js
  89. +0 56 node_modules/htmlparser/tests/04-unescaped_in_script.js
  90. +0 48 node_modules/htmlparser/tests/05-tags_in_comment.js
  91. +0 48 node_modules/htmlparser/tests/06-comment_in_script.js
  92. +0 49 node_modules/htmlparser/tests/07-unescaped_in_style.js
  93. +0 49 node_modules/htmlparser/tests/08-extra_spaces_in_tag.js
  94. +0 49 node_modules/htmlparser/tests/09-unquoted_attrib.js
  95. +0 43 node_modules/htmlparser/tests/10-singular_attribute.js
  96. +0 50 node_modules/htmlparser/tests/11-text_outside_tags.js
  97. +0 41 node_modules/htmlparser/tests/12-text_only.js
  98. +0 49 node_modules/htmlparser/tests/13-comment_in_text.js
  99. +0 57 node_modules/htmlparser/tests/14-comment_in_text_in_script.js
  100. +0 46 node_modules/htmlparser/tests/15-non-verbose.js
  101. +0 71 node_modules/htmlparser/tests/16-ignore_whitespace.js
  102. +0 38 node_modules/htmlparser/tests/17-xml_namespace.js
  103. +0 40 node_modules/htmlparser/tests/18-enforce_empty_tags.js
  104. +0 41 node_modules/htmlparser/tests/19-ignore_empty_tags.js
  105. +0 120 node_modules/htmlparser/tests/20-rss.js
  106. +0 80 node_modules/htmlparser/tests/21-atom.js
  107. +0 100 node_modules/htmlparser/tests/22-position_data.js
  108. +0 35 node_modules/htmlparser/utils_example.js
  109. +0 1,956 node_modules/htmlparser/v8.log
  110. BIN  node_modules/jsdom/._README.md
  111. BIN  node_modules/jsdom/._wscript
  112. +0 5 node_modules/jsdom/.gitignore
  113. +0 22 node_modules/jsdom/LICENSE.txt
  114. +0 228 node_modules/jsdom/README.md
  115. +0 37 node_modules/jsdom/example/browser/browser.js
  116. +0 167 node_modules/jsdom/example/jquery/jquery.js
  117. +0 9 node_modules/jsdom/example/jquery/run.js
  118. BIN  node_modules/jsdom/example/node-xml/._example.xml
  119. +0 243 node_modules/jsdom/example/node-xml/example.xml
  120. +0 46 node_modules/jsdom/example/node-xml/run.js
  121. BIN  node_modules/jsdom/example/pure/._pure.js
  122. BIN  node_modules/jsdom/example/pure/._sax.js
  123. +0 743 node_modules/jsdom/example/pure/pure.js
  124. +0 96 node_modules/jsdom/example/pure/run.js
  125. +0 10 node_modules/jsdom/example/pure/sax-test.js
  126. +0 535 node_modules/jsdom/example/pure/sax.js
  127. BIN  node_modules/jsdom/example/sizzle/._sax.js
  128. BIN  node_modules/jsdom/example/sizzle/._sizzle.js
  129. +0 166 node_modules/jsdom/example/sizzle/run.js
  130. +0 534 node_modules/jsdom/example/sizzle/sax.js
  131. +0 1,066 node_modules/jsdom/example/sizzle/sizzle.js
  132. BIN  node_modules/jsdom/lib/._jsdom.js
  133. +0 325 node_modules/jsdom/lib/jsdom.js
  134. BIN  node_modules/jsdom/lib/jsdom/browser/._index.js
  135. +0 235 node_modules/jsdom/lib/jsdom/browser/domtohtml.js
  136. +0 144 node_modules/jsdom/lib/jsdom/browser/htmlencoding.js
  137. +0 159 node_modules/jsdom/lib/jsdom/browser/htmltodom.js
  138. +0 485 node_modules/jsdom/lib/jsdom/browser/index.js
  139. +0 1,814 node_modules/jsdom/lib/jsdom/level1/core.js
  140. BIN  node_modules/jsdom/lib/jsdom/level2/._core.js
  141. BIN  node_modules/jsdom/lib/jsdom/level2/._events.js
  142. +0 663 node_modules/jsdom/lib/jsdom/level2/core.js
  143. +0 423 node_modules/jsdom/lib/jsdom/level2/events.js
  144. +0 1,607 node_modules/jsdom/lib/jsdom/level2/html.js
  145. +0 7 node_modules/jsdom/lib/jsdom/level2/index.js
  146. +0 24 node_modules/jsdom/lib/jsdom/level2/languages/javascript.js
  147. BIN  node_modules/jsdom/lib/jsdom/level3/._core.js
  148. BIN  node_modules/jsdom/lib/jsdom/level3/._events.js
  149. BIN  node_modules/jsdom/lib/jsdom/level3/._html.js
  150. BIN  node_modules/jsdom/lib/jsdom/level3/._index.js
  151. +0 573 node_modules/jsdom/lib/jsdom/level3/core.js
  152. +0 296 node_modules/jsdom/lib/jsdom/level3/events.js
  153. +0 9 node_modules/jsdom/lib/jsdom/level3/html.js
  154. +0 7 node_modules/jsdom/lib/jsdom/level3/index.js
  155. +0 28 node_modules/jsdom/lib/jsdom/selectors/index.js
  156. +0 1,016 node_modules/jsdom/lib/jsdom/selectors/sizzle.js
  157. +0 94 node_modules/jsdom/package.json
  158. +0 22 node_modules/jsdom/status.json
  159. BIN  node_modules/jsdom/test/._DOMTestCase.js
  160. BIN  node_modules/jsdom/test/._mjsunit.js
  161. +0 282 node_modules/jsdom/test/DOMTestCase.js
  162. +0 4 node_modules/jsdom/test/LICENSE.txt
  163. BIN  node_modules/jsdom/test/browser/._index.js
  164. +0 6,883 node_modules/jsdom/test/browser/files/js/jquery.js
  165. +0 252 node_modules/jsdom/test/browser/files/site.html
  166. +0 216 node_modules/jsdom/test/browser/index.js
  167. +0 36 node_modules/jsdom/test/collector.php
  168. +0 8 node_modules/jsdom/test/env.html
  169. BIN  node_modules/jsdom/test/jsdom/._index.js
  170. BIN  node_modules/jsdom/test/jsdom/files/._env.html
  171. +0 8 node_modules/jsdom/test/jsdom/files/env.html
  172. +0 1  node_modules/jsdom/test/jsdom/files/hello.js
  173. +0 497 node_modules/jsdom/test/jsdom/index.js
  174. +0 24,402 node_modules/jsdom/test/level1/core.js
  175. BIN  node_modules/jsdom/test/level1/core/files/._hc_staff.xml.js
  176. +0 13 node_modules/jsdom/test/level1/core/files/extra.xml.js
  177. +0 27 node_modules/jsdom/test/level1/core/files/hc_nodtdstaff.xml.js
  178. +0 236 node_modules/jsdom/test/level1/core/files/hc_staff.xml.js
  179. +0 153 node_modules/jsdom/test/level1/core/files/staff.xml.js
  180. +0 11,082 node_modules/jsdom/test/level1/html.js
  181. +0 27 node_modules/jsdom/test/level1/html/files/hc_nodtdstaff.html.js
  182. +0 235 node_modules/jsdom/test/level1/html/files/hc_staff.html.js
  183. +0 24,321 node_modules/jsdom/test/level1/svg.js
  184. +0 27 node_modules/jsdom/test/level1/svg/files/hc_nodtdstaff.svg.js
  185. +0 259 node_modules/jsdom/test/level1/svg/files/hc_staff.svg.js
  186. +0 275 node_modules/jsdom/test/level1/svg/files/staff.svg.js
  187. BIN  node_modules/jsdom/test/level2/._events.js
  188. +0 12,955 node_modules/jsdom/test/level2/core.js
  189. BIN  node_modules/jsdom/test/level2/core/files/._hc_staff.xml.js
  190. +0 159 node_modules/jsdom/test/level2/core/files/hc_staff.xml.js
  191. BIN  node_modules/jsdom/test/level2/core/files/orig/._hc_staff.xhtml
  192. BIN  node_modules/jsdom/test/level2/core/files/orig/._hc_staff.xml
  193. BIN  node_modules/jsdom/test/level2/core/files/orig/._staff.xml
  194. BIN  node_modules/jsdom/test/level2/core/files/orig/._staffNS.dtd
  195. BIN  node_modules/jsdom/test/level2/core/files/orig/._staffNS.xml
  196. BIN  node_modules/jsdom/test/level2/core/files/orig/._svgtest.js
  197. +0 48 node_modules/jsdom/test/level2/core/files/orig/hc_staff.html
  198. +0 72 node_modules/jsdom/test/level2/core/files/orig/hc_staff.svg
  199. +0 60 node_modules/jsdom/test/level2/core/files/orig/hc_staff.xhtml
  200. +0 60 node_modules/jsdom/test/level2/core/files/orig/hc_staff.xml
  201. +0 37 node_modules/jsdom/test/level2/core/files/orig/index.html
  202. 0  node_modules/jsdom/test/level2/core/files/orig/internalSubset01.js
  203. +0 11 node_modules/jsdom/test/level2/core/files/orig/nodtdstaff.svg
  204. +0 11 node_modules/jsdom/test/level2/core/files/orig/nodtdstaff.xml
  205. +0 67 node_modules/jsdom/test/level2/core/files/orig/robots.txt
  206. +0 17 node_modules/jsdom/test/level2/core/files/orig/staff.dtd
  207. +0 72 node_modules/jsdom/test/level2/core/files/orig/staff.svg
  208. +0 57 node_modules/jsdom/test/level2/core/files/orig/staff.xml
  209. +0 24 node_modules/jsdom/test/level2/core/files/orig/staff2.dtd
  210. +0 13 node_modules/jsdom/test/level2/core/files/orig/staff2.svg
  211. +0 13 node_modules/jsdom/test/level2/core/files/orig/staff2.xml
  212. +0 45 node_modules/jsdom/test/level2/core/files/orig/staffNS.dtd
  213. +0 73 node_modules/jsdom/test/level2/core/files/orig/staffNS.svg
  214. +0 68 node_modules/jsdom/test/level2/core/files/orig/staffNS.xml
  215. 0  node_modules/jsdom/test/level2/core/files/orig/svgtest.js
  216. 0  node_modules/jsdom/test/level2/core/files/orig/svgunit.js
  217. +0 196 node_modules/jsdom/test/level2/core/files/orig/xhtml-lat1.ent
  218. +0 80 node_modules/jsdom/test/level2/core/files/orig/xhtml-special.ent
  219. +0 237 node_modules/jsdom/test/level2/core/files/orig/xhtml-symbol.ent
  220. +0 1,235 node_modules/jsdom/test/level2/core/files/orig/xhtml1-frameset.dtd
  221. +0 65 node_modules/jsdom/test/level2/core/files/orig/xhtml1-strict.dtd
  222. +0 1,201 node_modules/jsdom/test/level2/core/files/orig/xhtml1-transitional.dtd
  223. +0 153 node_modules/jsdom/test/level2/core/files/staff.xml.js
  224. +0 159 node_modules/jsdom/test/level2/core/files/staff2.xml.js
  225. +0 250 node_modules/jsdom/test/level2/core/files/staffNS.xml.js
  226. +0 1,366 node_modules/jsdom/test/level2/events.js
Sorry, we could not display the entire diff because too many files (476) changed.
2  .gitignore
... ... @@ -0,0 +1,2 @@
  1 +node_modules/
  2 +npm-debug.log
8 README.md
Source Rendered
@@ -16,9 +16,15 @@ To use JS/CC and for understanding its internals and behaviors, some knowledge o
16 16
17 17 For all documentation read the `jscc_manual.pdf` in doc/ folder.
18 18
  19 +## Installation
  20 +
  21 + npm install jscc-node
  22 +
  23 +This install a jscc binary inside your node path, that you can run from the shell
  24 +
19 25 ## HOW TO USE
20 26
21   - node jscc.js [options] filename
  27 + jscc [options] filename
22 28
23 29 ## OPTIONS
24 30
9 jscc.js → bin/jscc
... ... @@ -1,5 +1,6 @@
  1 +#!/usr/bin/env node
1 2 print = require("util").puts;
2   -_print = function(str){console.log("__PRINT__\n"+str);};
  3 +_print = function(str){console.log(str);};
3 4 _error = function(str){console.log("___ ERROR ___\n"+str);};
4 5 _warning = function(str){console.log("--- WARN ---\n"+str);};
5 6 alert = function(str){console.log("=== ALERT ===\n"+str);};
@@ -4541,7 +4542,7 @@ function help()
4541 4542 //Initialize the globals
4542 4543 reset_all( EXEC_CONSOLE );
4543 4544
4544   -DEFAULT_DRIVER = "driver_node.js_";
  4545 +DEFAULT_DRIVER = __dirname + "/../lib/driver_node.js_";
4545 4546
4546 4547
4547 4548 //Processing the command line arguments
@@ -4634,8 +4635,8 @@ if( src_file != "" )
4634 4635 //LALR(1) parse table generation
4635 4636 first();
4636 4637
4637   - print_symbols( MODE_GEN_TEXT );
4638   - print_grammar( MODE_GEN_TEXT );
  4638 + //print_symbols( MODE_GEN_TEXT );
  4639 + //print_grammar( MODE_GEN_TEXT );
4639 4640 lalr1_parse_table( false );
4640 4641
4641 4642 check_empty_states();
0  driver_node.js_
Sorry, we could not display the changes to this file because there were too many other changes to display.
3  gitEtapes
... ... @@ -1,3 +0,0 @@
1   -cd existing_git_repo
2   -git commit -a -m 'port JS/CC to nodejs'
3   -git push -u origin master
0  driver_node.js_ → lib/driver_node.js_
File renamed without changes
0  lib/driver_node.js_
Sorry, we could not display the changes to this file because there were too many other changes to display.
BIN  node
Binary file not shown
0  node
Sorry, we could not display the changes to this file because there were too many other changes to display.
0  node_modules/htmlparser/.DS_Store
Sorry, we could not display the changes to this file because there were too many other changes to display.
BIN  node_modules/htmlparser/.DS_Store
Binary file not shown
17 node_modules/htmlparser/.project
... ... @@ -1,17 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<projectDescription>
3   - <name>NodeHtmlParser</name>
4   - <comment></comment>
5   - <projects>
6   - </projects>
7   - <buildSpec>
8   - <buildCommand>
9   - <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
10   - <arguments>
11   - </arguments>
12   - </buildCommand>
13   - </buildSpec>
14   - <natures>
15   - <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
16   - </natures>
17   -</projectDescription>
17 node_modules/htmlparser/.project.bak
... ... @@ -1,17 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<projectDescription>
3   - <name>NodeHtmlParser</name>
4   - <comment></comment>
5   - <projects>
6   - </projects>
7   - <buildSpec>
8   - <buildCommand>
9   - <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
10   - <arguments>
11   - </arguments>
12   - </buildCommand>
13   - </buildSpec>
14   - <natures>
15   - <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
16   - </natures>
17   -</projectDescription>
6 node_modules/htmlparser/.settings/.jsdtscope
... ... @@ -1,6 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<classpath>
3   - <classpathentry kind="src" path=""/>
4   - <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
5   - <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
6   -</classpath>
1  node_modules/htmlparser/.settings/org.eclipse.wst.jsdt.ui.superType.container
... ... @@ -1 +0,0 @@
1   -org.eclipse.wst.jsdt.launching.baseBrowserLibrary
1  node_modules/htmlparser/.settings/org.eclipse.wst.jsdt.ui.superType.name
... ... @@ -1 +0,0 @@
1   -Window
108 node_modules/htmlparser/.tmp_runtests.html.51164~
... ... @@ -1,108 +0,0 @@
1   -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2   -<html>
3   - <head>
4   - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5   - <title>Node.js HTML Parser</title>
6   - <style type="text/css">
7   - .good {
8   - color: #363;
9   - }
10   - .bad {
11   - color: #633;
12   - font-style: italic;
13   - }
14   - </style>
15   - <script language="JavaScript">
16   - if ((typeof JSON) != "object") {
17   - var head = document.getElementsByTagName("head")[0];
18   - var script = document.createElement('script');
19   - script.type = "text/javascript";
20   - script.src = "json2.js";
21   - head.insertBefore(script, head.firstChild)
22   - }
23   - </script>
24   - <script language="JavaScript" src="lib/node-htmlparser.js"></script>
25   - <script language="JavaScript" src="tests/01-basic.js"></script>
26   - <script language="JavaScript" src="tests/02-single_tag_1.js"></script>
27   - <script language="JavaScript" src="tests/03-single_tag_2.js"></script>
28   - <script language="JavaScript" src="tests/04-unescaped_in_script.js"></script>
29   - <script language="JavaScript" src="tests/05-tags_in_comment.js"></script>
30   - <script language="JavaScript" src="tests/06-comment_in_script.js"></script>
31   - <script language="JavaScript" src="tests/07-unescaped_in_style.js"></script>
32   - <script language="JavaScript" src="tests/08-extra_spaces_in_tag.js"></script>
33   - <script language="JavaScript" src="tests/09-unquoted_attrib.js"></script>
34   - <script language="JavaScript" src="tests/10-singular_attribute.js"></script>
35   - <script language="JavaScript" src="tests/11-text_outside_tags.js"></script>
36   - <script language="JavaScript" src="tests/12-text_only.js"></script>
37   - <script language="JavaScript" src="tests/13-comment_in_text.js"></script>
38   - <script language="JavaScript" src="tests/14-comment_in_text_in_script.js"></script>
39   - <script language="JavaScript" src="tests/15-non-verbose.js"></script>
40   - <script language="JavaScript" src="tests/16-ignore_whitespace.js"></script>
41   - <script language="JavaScript" src="tests/17-xml_namespace.js"></script>
42   - <script language="JavaScript" src="tests/18-enforce_empty_tags.js"></script>
43   - <script language="JavaScript" src="tests/19-ignore_empty_tags.js"></script>
44   - <script language="JavaScript" src="tests/20-rss.js"></script>
45   - <script language="JavaScript" src="tests/21-atom.js"></script>
46   - <script language="JavaScript" src="tests/22-position_data.js"></script>
47   - <!-- //TODO: dynamic loading of test files -->
48   - </head>
49   - <body style="font-size: small; font-family:Arial, Helvetica, sans-serif;">
50   -
51   - <script language="JavaScript">
52   - var chunkSize = 5;
53   - var testCount = 0;
54   - var failedCount = 0;
55   - while (Tautologistics.NodeHtmlParser.Tests.length) {
56   - testCount++;
57   - var test = Tautologistics.NodeHtmlParser.Tests.shift();
58   - try {
59   - var handlerCallback = function handlerCallback (error) {
60   - if (error)
61   - document.write("<hr>Handler error: " + error + "<hr>");
62   - }
63   - var handler = (test.type == "rss") ?
64   - new Tautologistics.NodeHtmlParser.RssHandler(handlerCallback, test.options.handler)
65   - :
66   - new Tautologistics.NodeHtmlParser.DefaultHandler(handlerCallback, test.options.handler)
67   - ;
68   - var parser = new Tautologistics.NodeHtmlParser.Parser(handler, test.options.parser);
69   - document.write("<b>" + test.name + "</b>: ");
70   - parser.parseComplete(test.html);
71   - var resultComplete = handler.dom;
72   - var chunkPos = 0;
73   - parser.reset();
74   - while (chunkPos < test.html.length) {
75   - parser.parseChunk(test.html.substring(chunkPos, chunkPos + chunkSize));
76   - chunkPos += chunkSize;
77   - }
78   - parser.done();
79   - var resultChunk = handler.dom;
80   - var testResult =
81   - JSON.stringify(resultComplete).toString() === JSON.stringify(test.expected).toString()
82   - &&
83   - JSON.stringify(resultChunk).toString() === JSON.stringify(test.expected).toString()
84   - ;
85   - document.write(testResult ? "<font class='good'>passed</font>" : "<font class='bad'>FAILED</font>");
86   - if (!testResult) {
87   - failedCount++;
88   - document.write("<pre>");
89   - document.write("<b>Complete</b>\n");
90   - document.write(JSON.stringify(resultComplete, null, 2));
91   - document.write("<b>Chunked</b>\n");
92   - document.write(JSON.stringify(resultChunk, null, 2));
93   - document.write("<h2>Expected</h2>\n");
94   - document.write(JSON.stringify(test.expected, null, 2));
95   - document.write("</pre>");
96   - }
97   - } catch (ex) {
98   - document.write("<h1>Exception occured during test: " + ex + "</h1>")
99   - }
100   - document.write("<br>");
101   - }
102   - document.write("<hr>");
103   - document.write("Total tests: " + testCount + "<br>");
104   - document.write("Failed tests: " + failedCount + "<br>");
105   - </script>
106   -
107   - </body>
108   -</html>
108 node_modules/htmlparser/.tmp_runtests.min.html.92328~
... ... @@ -1,108 +0,0 @@
1   -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2   -<html>
3   - <head>
4   - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5   - <title>Node.js HTML Parser</title>
6   - <style type="text/css">
7   - .good {
8   - color: #363;
9   - }
10   - .bad {
11   - color: #633;
12   - font-style: italic;
13   - }
14   - </style>
15   - <script language="JavaScript">
16   - if ((typeof JSON) != "object") {
17   - var head = document.getElementsByTagName("head")[0];
18   - var script = document.createElement('script');
19   - script.type = "text/javascript";
20   - script.src = "json2.js";
21   - head.insertBefore(script, head.firstChild)
22   - }
23   - </script>
24   - <script language="JavaScript" src="lib/node-htmlparser.min.js"></script>
25   - <script language="JavaScript" src="tests/01-basic.js"></script>
26   - <script language="JavaScript" src="tests/02-single_tag_1.js"></script>
27   - <script language="JavaScript" src="tests/03-single_tag_2.js"></script>
28   - <script language="JavaScript" src="tests/04-unescaped_in_script.js"></script>
29   - <script language="JavaScript" src="tests/05-tags_in_comment.js"></script>
30   - <script language="JavaScript" src="tests/06-comment_in_script.js"></script>
31   - <script language="JavaScript" src="tests/07-unescaped_in_style.js"></script>
32   - <script language="JavaScript" src="tests/08-extra_spaces_in_tag.js"></script>
33   - <script language="JavaScript" src="tests/09-unquoted_attrib.js"></script>
34   - <script language="JavaScript" src="tests/10-singular_attribute.js"></script>
35   - <script language="JavaScript" src="tests/11-text_outside_tags.js"></script>
36   - <script language="JavaScript" src="tests/12-text_only.js"></script>
37   - <script language="JavaScript" src="tests/13-comment_in_text.js"></script>
38   - <script language="JavaScript" src="tests/14-comment_in_text_in_script.js"></script>
39   - <script language="JavaScript" src="tests/15-non-verbose.js"></script>
40   - <script language="JavaScript" src="tests/16-ignore_whitespace.js"></script>
41   - <script language="JavaScript" src="tests/17-xml_namespace.js"></script>
42   - <script language="JavaScript" src="tests/18-enforce_empty_tags.js"></script>
43   - <script language="JavaScript" src="tests/19-ignore_empty_tags.js"></script>
44   - <script language="JavaScript" src="tests/20-rss.js"></script>
45   - <script language="JavaScript" src="tests/21-atom.js"></script>
46   - <script language="JavaScript" src="tests/22-position_data.js"></script>
47   - <!-- //TODO: dynamic loading of test files -->
48   - </head>
49   - <body style="font-size: small; font-family:Arial, Helvetica, sans-serif;">
50   -
51   - <script language="JavaScript">
52   - var chunkSize = 5;
53   - var testCount = 0;
54   - var failedCount = 0;
55   - while (Tautologistics.NodeHtmlParser.Tests.length) {
56   - testCount++;
57   - var test = Tautologistics.NodeHtmlParser.Tests.shift();
58   - try {
59   - var handlerCallback = function handlerCallback (error) {
60   - if (error)
61   - document.write("<hr>Handler error: " + error + "<hr>");
62   - }
63   - var handler = (test.type == "rss") ?
64   - new Tautologistics.NodeHtmlParser.RssHandler(handlerCallback, test.options.handler)
65   - :
66   - new Tautologistics.NodeHtmlParser.DefaultHandler(handlerCallback, test.options.handler)
67   - ;
68   - var parser = new Tautologistics.NodeHtmlParser.Parser(handler, test.options.parser);
69   - document.write("<b>" + test.name + "</b>: ");
70   - parser.parseComplete(test.html);
71   - var resultComplete = handler.dom;
72   - var chunkPos = 0;
73   - parser.reset();
74   - while (chunkPos < test.html.length) {
75   - parser.parseChunk(test.html.substring(chunkPos, chunkPos + chunkSize));
76   - chunkPos += chunkSize;
77   - }
78   - parser.done();
79   - var resultChunk = handler.dom;
80   - var testResult =
81   - JSON.stringify(resultComplete).toString() === JSON.stringify(test.expected).toString()
82   - &&
83   - JSON.stringify(resultChunk).toString() === JSON.stringify(test.expected).toString()
84   - ;
85   - document.write(testResult ? "<font class='good'>passed</font>" : "<font class='bad'>FAILED</font>");
86   - if (!testResult) {
87   - failedCount++;
88   - document.write("<pre>");
89   - document.write("<b>Complete</b>\n");
90   - document.write(JSON.stringify(resultComplete, null, 2));
91   - document.write("<b>Chunked</b>\n");
92   - document.write(JSON.stringify(resultChunk, null, 2));
93   - document.write("<h2>Expected</h2>\n");
94   - document.write(JSON.stringify(test.expected, null, 2));
95   - document.write("</pre>");
96   - }
97   - } catch (ex) {
98   - document.write("<h1>Exception occured during test: " + ex + "</h1>")
99   - }
100   - document.write("<br>");
101   - }
102   - document.write("<hr>");
103   - document.write("Total tests: " + testCount + "<br>");
104   - document.write("Failed tests: " + failedCount + "<br>");
105   - </script>
106   -
107   - </body>
108   -</html>
33 node_modules/htmlparser/CHANGELOG
... ... @@ -1,33 +0,0 @@
1   -
2   -v1.7.2
3   - * Document position feature fixed to work correctly with chunked parsing
4   -
5   -v1.7.1
6   - * Document position feature disabled until it works correctly with chunked parsing
7   -
8   -v1.7.0
9   - * Empty tag checking switch to being case insensitive [fgnass]
10   - * Added feature to include document position (row, col) in element data [fgnass]
11   - * Added parser option "includeLocation" to enable document position data
12   -
13   -v1.6.4
14   - * Fixed 'prevElement' error [Swizec]
15   -
16   -v1.6.3
17   - * Updated to support being an npm package
18   - * Fixed DomUtils.testElement()
19   -
20   -v1.6.1
21   - * Optimized DomUtils by up to 2-3x
22   -
23   -v1.6.0
24   - * Added support for RSS/Atom feeds
25   -
26   -v1.5.0
27   - * Added DefaultHandler option "enforceEmptyTags" so that XML can be parsed correctly
28   -
29   -v1.4.2
30   - * Added tests for parsing XML with namespaces
31   -
32   -v1.4.1
33   - * Added minified version
18 node_modules/htmlparser/LICENSE
... ... @@ -1,18 +0,0 @@
1   -Copyright 2010, Chris Winberry <chris@winberry.net>. All rights reserved.
2   -Permission is hereby granted, free of charge, to any person obtaining a copy
3   -of this software and associated documentation files (the "Software"), to
4   -deal in the Software without restriction, including without limitation the
5   -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
6   -sell copies of the Software, and to permit persons to whom the Software is
7   -furnished to do so, subject to the following conditions:
8   -
9   -The above copyright notice and this permission notice shall be included in
10   -all copies or substantial portions of the Software.
11   -
12   -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13   -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14   -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15   -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16   -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17   -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
18   -IN THE SOFTWARE.
186 node_modules/htmlparser/README.md
Source Rendered
... ... @@ -1,186 +0,0 @@
1   -#NodeHtmlParser
2   -A forgiving HTML/XML/RSS parser written in JS for both the browser and NodeJS (yes, despite the name it works just fine in any modern browser). The parser can handle streams (chunked data) and supports custom handlers for writing custom DOMs/output.
3   -
4   -##Installing
5   -
6   - npm install htmlparser
7   -
8   -##Running Tests
9   -
10   -###Run tests under node:
11   - node runtests.js
12   -
13   -###Run tests in browser:
14   -View runtests.html in any browser
15   -
16   -##Usage In Node
17   - var htmlparser = require("node-htmlparser");
18   - var rawHtml = "Xyz <script language= javascript>var foo = '<<bar>>';< / script><!--<!-- Waah! -- -->";
19   - var handler = new htmlparser.DefaultHandler(function (error, dom) {
20   - if (error)
21   - [...do something for errors...]
22   - else
23   - [...parsing done, do something...]
24   - });
25   - var parser = new htmlparser.Parser(handler);
26   - parser.parseComplete(rawHtml);
27   - sys.puts(sys.inspect(handler.dom, false, null));
28   -
29   -##Usage In Browser
30   - var handler = new Tautologistics.NodeHtmlParser.DefaultHandler(function (error, dom) {
31   - if (error)
32   - [...do something for errors...]
33   - else
34   - [...parsing done, do something...]
35   - });
36   - var parser = new Tautologistics.NodeHtmlParser.Parser(handler);
37   - parser.parseComplete(document.body.innerHTML);
38   - alert(JSON.stringify(handler.dom, null, 2));
39   -
40   -##Example output
41   - [ { raw: 'Xyz ', data: 'Xyz ', type: 'text' }
42   - , { raw: 'script language= javascript'
43   - , data: 'script language= javascript'
44   - , type: 'script'
45   - , name: 'script'
46   - , attribs: { language: 'javascript' }
47   - , children:
48   - [ { raw: 'var foo = \'<bar>\';<'
49   - , data: 'var foo = \'<bar>\';<'
50   - , type: 'text'
51   - }
52   - ]
53   - }
54   - , { raw: '<!-- Waah! -- '
55   - , data: '<!-- Waah! -- '
56   - , type: 'comment'
57   - }
58   - ]
59   -
60   -##Streaming To Parser
61   - while (...) {
62   - ...
63   - parser.parseChunk(chunk);
64   - }
65   - parser.done();
66   -
67   -##Parsing RSS/Atom Feeds
68   -
69   - new htmlparser.RssHandler(function (error, dom) {
70   - ...
71   - });
72   -
73   -##DefaultHandler Options
74   -
75   -###Usage
76   - var handler = new htmlparser.DefaultHandler(
77   - function (error) { ... }
78   - , { verbose: false, ignoreWhitespace: true }
79   - );
80   -
81   -###Option: ignoreWhitespace
82   -Indicates whether the DOM should exclude text nodes that consists solely of whitespace. The default value is "false".
83   -
84   -####Example: true
85   -The following HTML:
86   - <font>
87   - <br>this is the text
88   - <font>
89   -becomes:
90   - [ { raw: 'font'
91   - , data: 'font'
92   - , type: 'tag'
93   - , name: 'font'
94   - , children:
95   - [ { raw: 'br', data: 'br', type: 'tag', name: 'br' }
96   - , { raw: 'this is the text\n'
97   - , data: 'this is the text\n'
98   - , type: 'text'
99   - }
100   - , { raw: 'font', data: 'font', type: 'tag', name: 'font' }
101   - ]
102   - }
103   - ]
104   -
105   -####Example: false
106   -The following HTML:
107   - <font>
108   - <br>this is the text
109   - <font>
110   -becomes:
111   - [ { raw: 'font'
112   - , data: 'font'
113   - , type: 'tag'
114   - , name: 'font'
115   - , children:
116   - [ { raw: '\n\t', data: '\n\t', type: 'text' }
117   - , { raw: 'br', data: 'br', type: 'tag', name: 'br' }
118   - , { raw: 'this is the text\n'
119   - , data: 'this is the text\n'
120   - , type: 'text'
121   - }
122   - , { raw: 'font', data: 'font', type: 'tag', name: 'font' }
123   - ]
124   - }
125   - ]
126   -
127   -###Option: verbose
128   -Indicates whether to include extra information on each node in the DOM. This information consists of the "raw" attribute (original, unparsed text found between "<" and ">") and the "data" attribute on "tag", "script", and "comment" nodes. The default value is "true".
129   -
130   -####Example: true
131   -The following HTML:
132   - <a href="test.html">xxx</a>
133   -becomes:
134   - [ { raw: 'a href="test.html"'
135   - , data: 'a href="test.html"'
136   - , type: 'tag'
137   - , name: 'a'
138   - , attribs: { href: 'test.html' }
139   - , children: [ { raw: 'xxx', data: 'xxx', type: 'text' } ]
140   - }
141   - ]
142   -
143   -####Example: false
144   -The following HTML:
145   - <a href="test.html">xxx</a>
146   -becomes:
147   - [ { type: 'tag'
148   - , name: 'a'
149   - , attribs: { href: 'test.html' }
150   - , children: [ { data: 'xxx', type: 'text' } ]
151   - }
152   - ]
153   -
154   -###Option: enforceEmptyTags
155   -Indicates whether the DOM should prevent children on tags marked as empty in the HTML spec. Typically this should be set to "true" HTML parsing and "false" for XML parsing. The default value is "true".
156   -
157   -####Example: true
158   -The following HTML:
159   - <link>text</link>
160   -becomes:
161   - [ { raw: 'link', data: 'link', type: 'tag', name: 'link' }
162   - , { raw: 'text', data: 'text', type: 'text' }
163   - ]
164   -
165   -####Example: false
166   -The following HTML:
167   - <link>text</link>
168   -becomes:
169   - [ { raw: 'link'
170   - , data: 'link'
171   - , type: 'tag'
172   - , name: 'link'
173   - , children: [ { raw: 'text', data: 'text', type: 'text' } ]
174   - }
175   - ]
176   -
177   -##DomUtils
178   -
179   -###TBD (see utils_example.js for now)
180   -
181   -##Related Projects
182   -
183   -Looking for CSS selectors to search the DOM? Try Node-SoupSelect, a port of SoupSelect to NodeJS: http://github.com/harryf/node-soupselect
184   -
185   -There's also a port of hpricot to NodeJS that uses node-HtmlParser for HTML parsing: http://github.com/silentrob/Apricot
186   -
35 node_modules/htmlparser/a
... ... @@ -1,35 +0,0 @@
1   -[ { raw: 'html',
2   - data: 'html',
3   - type: 'tag',
4   - location: { line: 1, col: 1 },
5   - name: 'html',
6   - children:
7   - [ { raw: '\n\n',
8   - data: '\n\n',
9   - type: 'text',
10   - location: { line: 1, col: 5 } },
11   - { raw: 'title',
12   - data: 'title',
13   - type: 'tag',
14   - location: { line: 3, col: 1 },
15   - name: 'title',
16   - children:
17   - [ { raw: 'The Title',
18   - data: 'The Title',
19   - type: 'text',
20   - location: { line: 3, col: 6 } } ] },
21   - { raw: 'body',
22   - data: 'body',
23   - type: 'tag',
24   - location: { line: 3, col: 1 },
25   - name: 'body',
26   - children:
27   - [ { raw: '\nHello world\n\n',
28   - data: '\nHello world\n\n',
29   - type: 'text',
30   - location: { line: 3, col: 5 } } ] },
31   - { raw: '\n\n',
32   - data: '\n\n',
33   - type: 'text',
34   - location: { line: 6, col: 6 } } ] } ]
35   -
35 node_modules/htmlparser/b
... ... @@ -1,35 +0,0 @@
1   -[ { raw: 'html',
2   - data: 'html',
3   - type: 'tag',
4   - location: { line: 1, col: 0 },
5   - name: 'html',
6   - children:
7   - [ { raw: '\n\n',
8   - data: '\n\n',
9   - type: 'text',
10   - location: { line: 1, col: 5 } },
11   - { raw: 'title',
12   - data: 'title',
13   - type: 'tag',
14   - location: { line: 1, col: 0 },
15   - name: 'title',
16   - children:
17   - [ { raw: 'The Title',
18   - data: 'The Title',
19   - type: 'text',
20   - location: { line: 1, col: 0 } } ] },
21   - { raw: 'body',
22   - data: 'body',
23   - type: 'tag',
24   - location: { line: 1, col: 0 },
25   - name: 'body',
26   - children:
27   - [ { raw: '\nHello world\n\n',
28   - data: '\nHello world\n\n',
29   - type: 'text',
30   - location: { line: 1, col: 0 } } ] },
31   - { raw: '\n\n',
32   - data: '\n\n',
33   - type: 'text',
34   - location: { line: 1, col: 0 } } ] } ]
35   -
35 node_modules/htmlparser/c
... ... @@ -1,35 +0,0 @@
1   -[ { raw: 'html',
2   - data: 'html',
3   - type: 'tag',
4   - location: { line: 1, col: 0 },
5   - name: 'html',
6   - children:
7   - [ { raw: '\n\n',
8   - data: '\n\n',
9   - type: 'text',
10   - location: { line: 1, col: 5 } },
11   - { raw: 'title',
12   - data: 'title',
13   - type: 'tag',
14   - location: { line: 1, col: 0 },
15   - name: 'title',
16   - children:
17   - [ { raw: 'The Title',
18   - data: 'The Title',
19   - type: 'text',
20   - location: { line: 1, col: 0 } } ] },
21   - { raw: 'body',
22   - data: 'body',
23   - type: 'tag',
24   - location: { line: 1, col: 0 },
25   - name: 'body',
26   - children:
27   - [ { raw: '\nHello world\n\n',
28   - data: '\nHello world\n\n',
29   - type: 'text',
30   - location: { line: 1, col: 0 } } ] },
31   - { raw: '\n\n',
32   - data: '\n\n',
33   - type: 'text',
34   - location: { line: 1, col: 0 } } ] } ]
35   -
482 node_modules/htmlparser/json2.js
... ... @@ -1,482 +0,0 @@
1   -/*
2   - http://www.JSON.org/json2.js
3   - 2010-03-20
4   -
5   - Public Domain.
6   -
7   - NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
8   -
9   - See http://www.JSON.org/js.html
10   -
11   -
12   - This code should be minified before deployment.
13   - See http://javascript.crockford.com/jsmin.html
14   -
15   - USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
16   - NOT CONTROL.
17   -
18   -
19   - This file creates a global JSON object containing two methods: stringify
20   - and parse.
21   -
22   - JSON.stringify(value, replacer, space)
23   - value any JavaScript value, usually an object or array.
24   -
25   - replacer an optional parameter that determines how object
26   - values are stringified for objects. It can be a
27   - function or an array of strings.
28   -
29   - space an optional parameter that specifies the indentation
30   - of nested structures. If it is omitted, the text will
31   - be packed without extra whitespace. If it is a number,
32   - it will specify the number of spaces to indent at each
33   - level. If it is a string (such as '\t' or '&nbsp;'),
34   - it contains the characters used to indent at each level.
35   -
36   - This method produces a JSON text from a JavaScript value.
37   -
38   - When an object value is found, if the object contains a toJSON
39   - method, its toJSON method will be called and the result will be
40   - stringified. A toJSON method does not serialize: it returns the
41   - value represented by the name/value pair that should be serialized,
42   - or undefined if nothing should be serialized. The toJSON method
43   - will be passed the key associated with the value, and this will be
44   - bound to the value
45   -
46   - For example, this would serialize Dates as ISO strings.
47   -
48   - Date.prototype.toJSON = function (key) {
49   - function f(n) {
50   - // Format integers to have at least two digits.
51   - return n < 10 ? '0' + n : n;
52   - }
53   -
54   - return this.getUTCFullYear() + '-' +
55   - f(this.getUTCMonth() + 1) + '-' +
56   - f(this.getUTCDate()) + 'T' +
57   - f(this.getUTCHours()) + ':' +
58   - f(this.getUTCMinutes()) + ':' +
59   - f(this.getUTCSeconds()) + 'Z';
60   - };
61   -
62   - You can provide an optional replacer method. It will be passed the
63   - key and value of each member, with this bound to the containing
64   - object. The value that is returned from your method will be
65   - serialized. If your method returns undefined, then the member will
66   - be excluded from the serialization.
67   -
68   - If the replacer parameter is an array of strings, then it will be
69   - used to select the members to be serialized. It filters the results
70   - such that only members with keys listed in the replacer array are
71   - stringified.
72   -
73   - Values that do not have JSON representations, such as undefined or
74   - functions, will not be serialized. Such values in objects will be
75   - dropped; in arrays they will be replaced with null. You can use
76   - a replacer function to replace those with JSON values.
77   - JSON.stringify(undefined) returns undefined.
78   -
79   - The optional space parameter produces a stringification of the
80   - value that is filled with line breaks and indentation to make it
81   - easier to read.
82   -
83   - If the space parameter is a non-empty string, then that string will
84   - be used for indentation. If the space parameter is a number, then
85   - the indentation will be that many spaces.
86   -
87   - Example:
88   -
89   - text = JSON.stringify(['e', {pluribus: 'unum'}]);
90   - // text is '["e",{"pluribus":"unum"}]'
91   -
92   -
93   - text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
94   - // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
95   -
96   - text = JSON.stringify([new Date()], function (key, value) {
97   - return this[key] instanceof Date ?
98   - 'Date(' + this[key] + ')' : value;
99   - });
100   - // text is '["Date(---current time---)"]'
101   -
102   -
103   - JSON.parse(text, reviver)
104   - This method parses a JSON text to produce an object or array.
105   - It can throw a SyntaxError exception.
106   -
107   - The optional reviver parameter is a function that can filter and
108   - transform the results. It receives each of the keys and values,
109   - and its return value is used instead of the original value.
110   - If it returns what it received, then the structure is not modified.
111   - If it returns undefined then the member is deleted.
112   -
113   - Example:
114   -
115   - // Parse the text. Values that look like ISO date strings will
116   - // be converted to Date objects.
117   -
118   - myData = JSON.parse(text, function (key, value) {
119   - var a;
120   - if (typeof value === 'string') {
121   - a =
122   -/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
123   - if (a) {
124   - return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
125   - +a[5], +a[6]));
126   - }
127   - }
128   - return value;
129   - });
130   -
131   - myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
132   - var d;
133   - if (typeof value === 'string' &&
134   - value.slice(0, 5) === 'Date(' &&
135   - value.slice(-1) === ')') {
136   - d = new Date(value.slice(5, -1));
137   - if (d) {
138   - return d;
139   - }
140   - }
141   - return value;
142   - });
143   -
144   -
145   - This is a reference implementation. You are free to copy, modify, or
146   - redistribute.
147   -*/
148   -
149   -/*jslint evil: true, strict: false */
150   -
151   -/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
152   - call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
153   - getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
154   - lastIndex, length, parse, prototype, push, replace, slice, stringify,
155   - test, toJSON, toString, valueOf
156   -*/
157   -
158   -
159   -// Create a JSON object only if one does not already exist. We create the
160   -// methods in a closure to avoid creating global variables.
161   -
162   -if (!this.JSON) {
163   - this.JSON = {};
164   -}
165   -
166   -(function () {
167   -
168   - function f(n) {
169   - // Format integers to have at least two digits.
170   - return n < 10 ? '0' + n : n;
171   - }
172   -
173   - if (typeof Date.prototype.toJSON !== 'function') {
174   -
175   - Date.prototype.toJSON = function (key) {
176   -
177   - return isFinite(this.valueOf()) ?
178   - this.getUTCFullYear() + '-' +
179   - f(this.getUTCMonth() + 1) + '-' +
180   - f(this.getUTCDate()) + 'T' +
181   - f(this.getUTCHours()) + ':' +
182   - f(this.getUTCMinutes()) + ':' +
183   - f(this.getUTCSeconds()) + 'Z' : null;
184   - };
185   -
186   - String.prototype.toJSON =
187   - Number.prototype.toJSON =
188   - Boolean.prototype.toJSON = function (key) {
189   - return this.valueOf();
190   - };
191   - }
192   -
193   - var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
194   - escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
195   - gap,
196   - indent,
197   - meta = { // table of character substitutions
198   - '\b': '\\b',
199   - '\t': '\\t',
200   - '\n': '\\n',
201   - '\f': '\\f',
202   - '\r': '\\r',
203   - '"' : '\\"',
204   - '\\': '\\\\'
205   - },
206   - rep;
207   -
208   -
209   - function quote(string) {
210   -
211   -// If the string contains no control characters, no quote characters, and no
212   -// backslash characters, then we can safely slap some quotes around it.
213   -// Otherwise we must also replace the offending characters with safe escape
214   -// sequences.
215   -
216   - escapable.lastIndex = 0;
217   - return escapable.test(string) ?
218   - '"' + string.replace(escapable, function (a) {
219   - var c = meta[a];
220   - return typeof c === 'string' ? c :
221   - '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
222   - }) + '"' :
223   - '"' + string + '"';
224   - }
225   -
226   -
227   - function str(key, holder) {
228   -
229   -// Produce a string from holder[key].
230   -
231   - var i, // The loop counter.
232   - k, // The member key.
233   - v, // The member value.
234   - length,
235   - mind = gap,
236   - partial,
237   - value = holder[key];
238   -
239   -// If the value has a toJSON method, call it to obtain a replacement value.
240   -
241   - if (value && typeof value === 'object' &&
242   - typeof value.toJSON === 'function') {
243   - value = value.toJSON(key);
244   - }
245   -
246   -// If we were called with a replacer function, then call the replacer to
247   -// obtain a replacement value.
248   -
249   - if (typeof rep === 'function') {
250   - value = rep.call(holder, key, value);
251   - }
252   -
253   -// What happens next depends on the value's type.
254   -
255   - switch (typeof value) {
256   - case 'string':
257   - return quote(value);
258   -
259   - case 'number':
260   -
261   -// JSON numbers must be finite. Encode non-finite numbers as null.
262   -
263   - return isFinite(value) ? String(value) : 'null';
264   -
265   - case 'boolean':
266   - case 'null':
267   -
268   -// If the value is a boolean or null, convert it to a string. Note:
269   -// typeof null does not produce 'null'. The case is included here in
270   -// the remote chance that this gets fixed someday.
271   -
272   - return String(value);
273   -
274   -// If the type is 'object', we might be dealing with an object or an array or
275   -// null.
276   -
277   - case 'object':
278   -
279   -// Due to a specification blunder in ECMAScript, typeof null is 'object',
280   -// so watch out for that case.
281   -
282   - if (!value) {
283   - return 'null';
284   - }
285   -
286   -// Make an array to hold the partial results of stringifying this object value.
287   -
288   - gap += indent;