distil 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +28 -0
- data/VERSION +1 -0
- data/bin/distil +45 -0
- data/distil.gemspec +586 -0
- data/lib/bootstrap-template.js +56 -0
- data/lib/configurable.rb +125 -0
- data/lib/file-set.rb +42 -0
- data/lib/file-types/css-file.rb +75 -0
- data/lib/file-types/html-file.rb +11 -0
- data/lib/file-types/javascript-file.rb +98 -0
- data/lib/file-types/json-file.rb +14 -0
- data/lib/file-types/nib-file.rb +9 -0
- data/lib/jsdoc.conf +18 -0
- data/lib/jsl.conf +121 -0
- data/lib/project.rb +96 -0
- data/lib/source-file.rb +181 -0
- data/lib/target.rb +96 -0
- data/lib/task.rb +239 -0
- data/lib/tasks/copy-task.rb +21 -0
- data/lib/tasks/css-task.rb +18 -0
- data/lib/tasks/javascript-task.rb +125 -0
- data/lib/tasks/multiple-output-task.rb +134 -0
- data/lib/tasks/nib-task.rb +83 -0
- data/lib/tasks/output-task.rb +73 -0
- data/lib/tasks/single-output-task.rb +83 -0
- data/lib/tasks/test-task.rb +280 -0
- data/lib/test/HtmlTestReporter.js +127 -0
- data/lib/test/Test.js +248 -0
- data/lib/test/TestReporter.js +79 -0
- data/lib/test/TestRunner.js +132 -0
- data/lib/test/browser.rb +97 -0
- data/lib/test/scriptwrapper.html +10 -0
- data/lib/test/unittest.html +127 -0
- data/vendor/Makefile +35 -0
- data/vendor/extconf.rb +3 -0
- data/vendor/jsdoc-extras/plugins/distil-plugin.js +142 -0
- data/vendor/jsdoc-extras/plugins/interface-plugin.js +36 -0
- data/vendor/jsdoc-extras/templates/coherent/allclasses.tmpl +17 -0
- data/vendor/jsdoc-extras/templates/coherent/allfiles.tmpl +53 -0
- data/vendor/jsdoc-extras/templates/coherent/class.tmpl +803 -0
- data/vendor/jsdoc-extras/templates/coherent/index.tmpl +37 -0
- data/vendor/jsdoc-extras/templates/coherent/publish.js +242 -0
- data/vendor/jsdoc-extras/templates/coherent/showdown.js +421 -0
- data/vendor/jsdoc-extras/templates/coherent/static/code-footer.html +3 -0
- data/vendor/jsdoc-extras/templates/coherent/static/code-header.html +7 -0
- data/vendor/jsdoc-extras/templates/coherent/static/default.css +297 -0
- data/vendor/jsdoc-extras/templates/coherent/static/header.html +2 -0
- data/vendor/jsdoc-extras/templates/coherent/static/index.html +19 -0
- data/vendor/jsdoc-extras/templates/coherent/symbol.tmpl +35 -0
- data/vendor/jsdoc-toolkit/README.txt +183 -0
- data/vendor/jsdoc-toolkit/app/frame/Chain.js +102 -0
- data/vendor/jsdoc-toolkit/app/frame/Dumper.js +144 -0
- data/vendor/jsdoc-toolkit/app/frame/Hash.js +84 -0
- data/vendor/jsdoc-toolkit/app/frame/Link.js +171 -0
- data/vendor/jsdoc-toolkit/app/frame/Namespace.js +10 -0
- data/vendor/jsdoc-toolkit/app/frame/Opt.js +134 -0
- data/vendor/jsdoc-toolkit/app/frame/Reflection.js +26 -0
- data/vendor/jsdoc-toolkit/app/frame/String.js +93 -0
- data/vendor/jsdoc-toolkit/app/frame/Testrun.js +129 -0
- data/vendor/jsdoc-toolkit/app/frame.js +33 -0
- data/vendor/jsdoc-toolkit/app/handlers/FOODOC.js +26 -0
- data/vendor/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js +159 -0
- data/vendor/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js +16 -0
- data/vendor/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js +292 -0
- data/vendor/jsdoc-toolkit/app/handlers/XMLDOC.js +26 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/DocComment.js +204 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/DocTag.js +300 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js +126 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js +109 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/Lang.js +144 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/Parser.js +144 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js +33 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/Symbol.js +644 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js +241 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/TextStream.js +41 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/Token.js +18 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js +332 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js +133 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/Util.js +32 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC/Walker.js +499 -0
- data/vendor/jsdoc-toolkit/app/lib/JSDOC.js +106 -0
- data/vendor/jsdoc-toolkit/app/main.js +129 -0
- data/vendor/jsdoc-toolkit/app/plugins/commentSrcJson.js +20 -0
- data/vendor/jsdoc-toolkit/app/plugins/frameworkPrototype.js +16 -0
- data/vendor/jsdoc-toolkit/app/plugins/functionCall.js +10 -0
- data/vendor/jsdoc-toolkit/app/plugins/publishSrcHilite.js +54 -0
- data/vendor/jsdoc-toolkit/app/plugins/symbolLink.js +10 -0
- data/vendor/jsdoc-toolkit/app/plugins/tagParamConfig.js +31 -0
- data/vendor/jsdoc-toolkit/app/plugins/tagSynonyms.js +43 -0
- data/vendor/jsdoc-toolkit/app/run.js +348 -0
- data/vendor/jsdoc-toolkit/app/t/TestDoc.js +144 -0
- data/vendor/jsdoc-toolkit/app/t/runner.js +13 -0
- data/vendor/jsdoc-toolkit/app/test/addon.js +24 -0
- data/vendor/jsdoc-toolkit/app/test/anon_inner.js +14 -0
- data/vendor/jsdoc-toolkit/app/test/augments.js +31 -0
- data/vendor/jsdoc-toolkit/app/test/augments2.js +26 -0
- data/vendor/jsdoc-toolkit/app/test/borrows.js +46 -0
- data/vendor/jsdoc-toolkit/app/test/borrows2.js +23 -0
- data/vendor/jsdoc-toolkit/app/test/config.js +22 -0
- data/vendor/jsdoc-toolkit/app/test/constructs.js +18 -0
- data/vendor/jsdoc-toolkit/app/test/encoding.js +10 -0
- data/vendor/jsdoc-toolkit/app/test/encoding_other.js +12 -0
- data/vendor/jsdoc-toolkit/app/test/event.js +54 -0
- data/vendor/jsdoc-toolkit/app/test/exports.js +14 -0
- data/vendor/jsdoc-toolkit/app/test/functions_anon.js +39 -0
- data/vendor/jsdoc-toolkit/app/test/functions_nested.js +33 -0
- data/vendor/jsdoc-toolkit/app/test/global.js +13 -0
- data/vendor/jsdoc-toolkit/app/test/globals.js +25 -0
- data/vendor/jsdoc-toolkit/app/test/ignore.js +10 -0
- data/vendor/jsdoc-toolkit/app/test/inner.js +16 -0
- data/vendor/jsdoc-toolkit/app/test/jsdoc_test.js +477 -0
- data/vendor/jsdoc-toolkit/app/test/lend.js +33 -0
- data/vendor/jsdoc-toolkit/app/test/memberof.js +19 -0
- data/vendor/jsdoc-toolkit/app/test/memberof2.js +38 -0
- data/vendor/jsdoc-toolkit/app/test/memberof3.js +33 -0
- data/vendor/jsdoc-toolkit/app/test/memberof_constructor.js +17 -0
- data/vendor/jsdoc-toolkit/app/test/module.js +17 -0
- data/vendor/jsdoc-toolkit/app/test/name.js +19 -0
- data/vendor/jsdoc-toolkit/app/test/namespace_nested.js +23 -0
- data/vendor/jsdoc-toolkit/app/test/nocode.js +13 -0
- data/vendor/jsdoc-toolkit/app/test/oblit_anon.js +20 -0
- data/vendor/jsdoc-toolkit/app/test/overview.js +20 -0
- data/vendor/jsdoc-toolkit/app/test/param_inline.js +37 -0
- data/vendor/jsdoc-toolkit/app/test/params_optional.js +8 -0
- data/vendor/jsdoc-toolkit/app/test/prototype.js +17 -0
- data/vendor/jsdoc-toolkit/app/test/prototype_nested.js +9 -0
- data/vendor/jsdoc-toolkit/app/test/prototype_oblit.js +13 -0
- data/vendor/jsdoc-toolkit/app/test/prototype_oblit_constructor.js +24 -0
- data/vendor/jsdoc-toolkit/app/test/public.js +10 -0
- data/vendor/jsdoc-toolkit/app/test/scripts/code.js +5 -0
- data/vendor/jsdoc-toolkit/app/test/scripts/notcode.txt +5 -0
- data/vendor/jsdoc-toolkit/app/test/shared.js +42 -0
- data/vendor/jsdoc-toolkit/app/test/shared2.js +2 -0
- data/vendor/jsdoc-toolkit/app/test/shortcuts.js +22 -0
- data/vendor/jsdoc-toolkit/app/test/static_this.js +13 -0
- data/vendor/jsdoc-toolkit/app/test/synonyms.js +31 -0
- data/vendor/jsdoc-toolkit/app/test/tosource.js +23 -0
- data/vendor/jsdoc-toolkit/app/test/variable_redefine.js +14 -0
- data/vendor/jsdoc-toolkit/app/test.js +342 -0
- data/vendor/jsdoc-toolkit/changes.txt +116 -0
- data/vendor/jsdoc-toolkit/conf/sample.conf +31 -0
- data/vendor/jsdoc-toolkit/java/build.xml +36 -0
- data/vendor/jsdoc-toolkit/java/build_1.4.xml +36 -0
- data/vendor/jsdoc-toolkit/java/classes/js.jar +0 -0
- data/vendor/jsdoc-toolkit/java/src/JsDebugRun.java +21 -0
- data/vendor/jsdoc-toolkit/java/src/JsRun.java +21 -0
- data/vendor/jsdoc-toolkit/jsdebug.jar +0 -0
- data/vendor/jsdoc-toolkit/jsrun.jar +0 -0
- data/vendor/jsdoc-toolkit/jsrun.sh +53 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl +17 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl +56 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/class.tmpl +649 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/index.tmpl +39 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/publish.js +201 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/static/code-footer.html +3 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/static/code-header.html +14 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/static/default.css +162 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/static/header.html +2 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/static/index.html +19 -0
- data/vendor/jsdoc-toolkit/templates/jsdoc/symbol.tmpl +35 -0
- data/vendor/jsl-0.3.0/src/JavaScriptLintAPI.cpp +333 -0
- data/vendor/jsl-0.3.0/src/JavaScriptLintAPI.h +86 -0
- data/vendor/jsl-0.3.0/src/Makefile.in +375 -0
- data/vendor/jsl-0.3.0/src/Makefile.ref +372 -0
- data/vendor/jsl-0.3.0/src/README.html +826 -0
- data/vendor/jsl-0.3.0/src/SpiderMonkey.rsp +12 -0
- data/vendor/jsl-0.3.0/src/_jsl_online.php +223 -0
- data/vendor/jsl-0.3.0/src/config/AIX4.1.mk +65 -0
- data/vendor/jsl-0.3.0/src/config/AIX4.2.mk +64 -0
- data/vendor/jsl-0.3.0/src/config/AIX4.3.mk +65 -0
- data/vendor/jsl-0.3.0/src/config/Darwin.mk +81 -0
- data/vendor/jsl-0.3.0/src/config/Darwin1.3.mk +81 -0
- data/vendor/jsl-0.3.0/src/config/Darwin1.4.mk +41 -0
- data/vendor/jsl-0.3.0/src/config/Darwin5.2.mk +81 -0
- data/vendor/jsl-0.3.0/src/config/Darwin5.3.mk +81 -0
- data/vendor/jsl-0.3.0/src/config/HP-UXB.10.10.mk +77 -0
- data/vendor/jsl-0.3.0/src/config/HP-UXB.10.20.mk +77 -0
- data/vendor/jsl-0.3.0/src/config/HP-UXB.11.00.mk +80 -0
- data/vendor/jsl-0.3.0/src/config/IRIX.mk +87 -0
- data/vendor/jsl-0.3.0/src/config/IRIX5.3.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/IRIX6.1.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/IRIX6.2.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/IRIX6.3.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/IRIX6.5.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/Linux_All.mk +103 -0
- data/vendor/jsl-0.3.0/src/config/Mac_OS10.0.mk +82 -0
- data/vendor/jsl-0.3.0/src/config/OSF1V4.0.mk +72 -0
- data/vendor/jsl-0.3.0/src/config/OSF1V5.0.mk +69 -0
- data/vendor/jsl-0.3.0/src/config/SunOS4.1.4.mk +101 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.3.mk +91 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.4.mk +92 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.5.1.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.5.mk +87 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.6.mk +89 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.7.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.8.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/SunOS5.9.mk +44 -0
- data/vendor/jsl-0.3.0/src/config/WINNT4.0.mk +112 -0
- data/vendor/jsl-0.3.0/src/config/WINNT5.0.mk +112 -0
- data/vendor/jsl-0.3.0/src/config/WINNT5.1.mk +112 -0
- data/vendor/jsl-0.3.0/src/config/WINNT5.2.mk +112 -0
- data/vendor/jsl-0.3.0/src/config/dgux.mk +64 -0
- data/vendor/jsl-0.3.0/src/config.mk +166 -0
- data/vendor/jsl-0.3.0/src/editline/Makefile.ref +144 -0
- data/vendor/jsl-0.3.0/src/editline/README +83 -0
- data/vendor/jsl-0.3.0/src/editline/editline.3 +175 -0
- data/vendor/jsl-0.3.0/src/editline/editline.c +1369 -0
- data/vendor/jsl-0.3.0/src/editline/editline.h +135 -0
- data/vendor/jsl-0.3.0/src/editline/sysunix.c +182 -0
- data/vendor/jsl-0.3.0/src/editline/unix.h +82 -0
- data/vendor/jsl-0.3.0/src/fdlibm/Makefile.in +127 -0
- data/vendor/jsl-0.3.0/src/fdlibm/Makefile.ref +192 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_acos.c +147 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_acosh.c +105 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_asin.c +156 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_atan2.c +165 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_atanh.c +110 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_cosh.c +133 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_exp.c +202 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_fmod.c +184 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_gamma.c +71 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_gamma_r.c +70 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_hypot.c +173 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_j0.c +524 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_j1.c +523 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_jn.c +315 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_lgamma.c +71 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_lgamma_r.c +347 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_log.c +184 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_log10.c +134 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_pow.c +386 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_rem_pio2.c +221 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_remainder.c +120 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_scalb.c +89 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_sinh.c +122 -0
- data/vendor/jsl-0.3.0/src/fdlibm/e_sqrt.c +497 -0
- data/vendor/jsl-0.3.0/src/fdlibm/fdlibm.dsp +160 -0
- data/vendor/jsl-0.3.0/src/fdlibm/fdlibm.h +273 -0
- data/vendor/jsl-0.3.0/src/fdlibm/fdlibm.mak +1453 -0
- data/vendor/jsl-0.3.0/src/fdlibm/fdlibm.mdp +0 -0
- data/vendor/jsl-0.3.0/src/fdlibm/k_cos.c +134 -0
- data/vendor/jsl-0.3.0/src/fdlibm/k_rem_pio2.c +354 -0
- data/vendor/jsl-0.3.0/src/fdlibm/k_sin.c +114 -0
- data/vendor/jsl-0.3.0/src/fdlibm/k_standard.c +785 -0
- data/vendor/jsl-0.3.0/src/fdlibm/k_tan.c +170 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_asinh.c +101 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_atan.c +175 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_cbrt.c +133 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_ceil.c +120 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_copysign.c +72 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_cos.c +118 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_erf.c +356 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_expm1.c +267 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_fabs.c +70 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_finite.c +71 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_floor.c +121 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_frexp.c +99 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_ilogb.c +85 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_isnan.c +74 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_ldexp.c +66 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_lib_version.c +73 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_log1p.c +211 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_logb.c +79 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_matherr.c +64 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_modf.c +132 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_nextafter.c +124 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_rint.c +131 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_scalbn.c +107 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_signgam.c +40 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_significand.c +68 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_sin.c +118 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_tan.c +112 -0
- data/vendor/jsl-0.3.0/src/fdlibm/s_tanh.c +122 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_acos.c +78 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_acosh.c +78 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_asin.c +80 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_atan2.c +79 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_atanh.c +81 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_cosh.c +77 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_exp.c +88 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_fmod.c +78 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_gamma.c +85 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_gamma_r.c +81 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_hypot.c +78 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_j0.c +105 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_j1.c +106 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_jn.c +128 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_lgamma.c +85 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_lgamma_r.c +81 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_log.c +78 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_log10.c +81 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_pow.c +99 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_remainder.c +77 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_scalb.c +95 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_sinh.c +77 -0
- data/vendor/jsl-0.3.0/src/fdlibm/w_sqrt.c +77 -0
- data/vendor/jsl-0.3.0/src/js.c +2447 -0
- data/vendor/jsl-0.3.0/src/js.dsp +420 -0
- data/vendor/jsl-0.3.0/src/js.mak +4025 -0
- data/vendor/jsl-0.3.0/src/js.mdp +0 -0
- data/vendor/jsl-0.3.0/src/js.msg +291 -0
- data/vendor/jsl-0.3.0/src/js.pkg +2 -0
- data/vendor/jsl-0.3.0/src/js3240.rc +79 -0
- data/vendor/jsl-0.3.0/src/jsOS240.def +654 -0
- data/vendor/jsl-0.3.0/src/jsapi.c +4405 -0
- data/vendor/jsl-0.3.0/src/jsapi.h +1856 -0
- data/vendor/jsl-0.3.0/src/jsarena.c +567 -0
- data/vendor/jsl-0.3.0/src/jsarena.h +302 -0
- data/vendor/jsl-0.3.0/src/jsarray.c +1428 -0
- data/vendor/jsl-0.3.0/src/jsarray.h +77 -0
- data/vendor/jsl-0.3.0/src/jsatom.c +927 -0
- data/vendor/jsl-0.3.0/src/jsatom.h +426 -0
- data/vendor/jsl-0.3.0/src/jsbit.h +113 -0
- data/vendor/jsl-0.3.0/src/jsbool.c +220 -0
- data/vendor/jsl-0.3.0/src/jsbool.h +62 -0
- data/vendor/jsl-0.3.0/src/jsclist.h +139 -0
- data/vendor/jsl-0.3.0/src/jscntxt.c +1036 -0
- data/vendor/jsl-0.3.0/src/jscntxt.h +608 -0
- data/vendor/jsl-0.3.0/src/jscompat.h +57 -0
- data/vendor/jsl-0.3.0/src/jsconfig.h +489 -0
- data/vendor/jsl-0.3.0/src/jsconfig.mk +181 -0
- data/vendor/jsl-0.3.0/src/jscpucfg.c +377 -0
- data/vendor/jsl-0.3.0/src/jscpucfg.h +204 -0
- data/vendor/jsl-0.3.0/src/jsdate.c +2238 -0
- data/vendor/jsl-0.3.0/src/jsdate.h +118 -0
- data/vendor/jsl-0.3.0/src/jsdbgapi.c +1260 -0
- data/vendor/jsl-0.3.0/src/jsdbgapi.h +345 -0
- data/vendor/jsl-0.3.0/src/jsdhash.c +763 -0
- data/vendor/jsl-0.3.0/src/jsdhash.h +579 -0
- data/vendor/jsl-0.3.0/src/jsdtoa.c +3135 -0
- data/vendor/jsl-0.3.0/src/jsdtoa.h +130 -0
- data/vendor/jsl-0.3.0/src/jsemit.c +4851 -0
- data/vendor/jsl-0.3.0/src/jsemit.h +576 -0
- data/vendor/jsl-0.3.0/src/jsexn.c +1084 -0
- data/vendor/jsl-0.3.0/src/jsexn.h +102 -0
- data/vendor/jsl-0.3.0/src/jsfile.c +2610 -0
- data/vendor/jsl-0.3.0/src/jsfile.h +50 -0
- data/vendor/jsl-0.3.0/src/jsfile.msg +89 -0
- data/vendor/jsl-0.3.0/src/jsfun.c +2015 -0
- data/vendor/jsl-0.3.0/src/jsfun.h +158 -0
- data/vendor/jsl-0.3.0/src/jsgc.c +1441 -0
- data/vendor/jsl-0.3.0/src/jsgc.h +230 -0
- data/vendor/jsl-0.3.0/src/jshash.c +471 -0
- data/vendor/jsl-0.3.0/src/jshash.h +152 -0
- data/vendor/jsl-0.3.0/src/jsify.pl +485 -0
- data/vendor/jsl-0.3.0/src/jsinterp.c +4797 -0
- data/vendor/jsl-0.3.0/src/jsinterp.h +302 -0
- data/vendor/jsl-0.3.0/src/jsl-test.js +28 -0
- data/vendor/jsl-0.3.0/src/jsl.c +2371 -0
- data/vendor/jsl-0.3.0/src/jsl.conf +127 -0
- data/vendor/jsl-0.3.0/src/jsl.conf.old +124 -0
- data/vendor/jsl-0.3.0/src/jsl.dsp +242 -0
- data/vendor/jsl-0.3.0/src/jsl.dsw +59 -0
- data/vendor/jsl-0.3.0/src/jslibmath.h +290 -0
- data/vendor/jsl-0.3.0/src/jslock.c +1261 -0
- data/vendor/jsl-0.3.0/src/jslock.h +289 -0
- data/vendor/jsl-0.3.0/src/jslocko.asm +59 -0
- data/vendor/jsl-0.3.0/src/jslog2.c +83 -0
- data/vendor/jsl-0.3.0/src/jslong.c +281 -0
- data/vendor/jsl-0.3.0/src/jslong.h +437 -0
- data/vendor/jsl-0.3.0/src/jsmath.c +477 -0
- data/vendor/jsl-0.3.0/src/jsmath.h +55 -0
- data/vendor/jsl-0.3.0/src/jsnum.c +1148 -0
- data/vendor/jsl-0.3.0/src/jsnum.h +257 -0
- data/vendor/jsl-0.3.0/src/jsobj.c +4066 -0
- data/vendor/jsl-0.3.0/src/jsobj.h +475 -0
- data/vendor/jsl-0.3.0/src/jsopcode.c +2730 -0
- data/vendor/jsl-0.3.0/src/jsopcode.h +275 -0
- data/vendor/jsl-0.3.0/src/jsopcode.tbl +344 -0
- data/vendor/jsl-0.3.0/src/jsosdep.h +127 -0
- data/vendor/jsl-0.3.0/src/jsotypes.h +211 -0
- data/vendor/jsl-0.3.0/src/jsparse.c +4438 -0
- data/vendor/jsl-0.3.0/src/jsparse.h +345 -0
- data/vendor/jsl-0.3.0/src/jsprf.c +1212 -0
- data/vendor/jsl-0.3.0/src/jsprf.h +148 -0
- data/vendor/jsl-0.3.0/src/jsprvtd.h +174 -0
- data/vendor/jsl-0.3.0/src/jspubtd.h +586 -0
- data/vendor/jsl-0.3.0/src/jsregexp.c +3831 -0
- data/vendor/jsl-0.3.0/src/jsregexp.h +180 -0
- data/vendor/jsl-0.3.0/src/jsscan.c +1814 -0
- data/vendor/jsl-0.3.0/src/jsscan.h +267 -0
- data/vendor/jsl-0.3.0/src/jsscope.c +1639 -0
- data/vendor/jsl-0.3.0/src/jsscope.h +389 -0
- data/vendor/jsl-0.3.0/src/jsscript.c +1284 -0
- data/vendor/jsl-0.3.0/src/jsscript.h +179 -0
- data/vendor/jsl-0.3.0/src/jsshell.msg +50 -0
- data/vendor/jsl-0.3.0/src/jsstddef.h +83 -0
- data/vendor/jsl-0.3.0/src/jsstr.c +4502 -0
- data/vendor/jsl-0.3.0/src/jsstr.h +448 -0
- data/vendor/jsl-0.3.0/src/jstypes.h +391 -0
- data/vendor/jsl-0.3.0/src/jsutil.c +157 -0
- data/vendor/jsl-0.3.0/src/jsutil.h +75 -0
- data/vendor/jsl-0.3.0/src/jsxdrapi.c +686 -0
- data/vendor/jsl-0.3.0/src/jsxdrapi.h +193 -0
- data/vendor/jsl-0.3.0/src/liveconnect/LiveConnect.dsp +157 -0
- data/vendor/jsl-0.3.0/src/liveconnect/LiveConnectShell.dsp +120 -0
- data/vendor/jsl-0.3.0/src/liveconnect/LiveConnectShell.dsw +44 -0
- data/vendor/jsl-0.3.0/src/liveconnect/Makefile.in +106 -0
- data/vendor/jsl-0.3.0/src/liveconnect/Makefile.ref +169 -0
- data/vendor/jsl-0.3.0/src/liveconnect/README.html +719 -0
- data/vendor/jsl-0.3.0/src/liveconnect/_jni/netscape_javascript_JSException.h +14 -0
- data/vendor/jsl-0.3.0/src/liveconnect/_jni/netscape_javascript_JSObject.h +155 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/Makefile.in +89 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/Makefile.ref +57 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/netscape/Makefile.ref +47 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/netscape/javascript/JSException.java +140 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/netscape/javascript/JSObject.java +183 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/netscape/javascript/JSProxy.java +58 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/netscape/javascript/JSRunnable.java +70 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/netscape/javascript/JSUtil.java +59 -0
- data/vendor/jsl-0.3.0/src/liveconnect/classes/netscape/javascript/Makefile.ref +53 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/AIX4.1.mk +45 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/AIX4.2.mk +45 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/AIX4.3.mk +50 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/HP-UXB.10.10.mk +43 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/HP-UXB.10.20.mk +43 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/HP-UXB.11.00.mk +43 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/IRIX6.2.mk +43 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/IRIX6.3.mk +43 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/IRIX6.5.mk +43 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/Linux_All.mk +73 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/OSF1V4.0.mk +65 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/OSF1V5.0.mk +62 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/SunOS5.5.1.mk +55 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/SunOS5.6.mk +39 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/SunOS5.7.mk +39 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/SunOS5.8.mk +39 -0
- data/vendor/jsl-0.3.0/src/liveconnect/config/WINNT4.0.mk +53 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj.c +884 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj.msg +98 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_JSObject.c +1379 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_JavaArray.c +481 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_JavaClass.c +749 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_JavaMember.c +186 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_JavaObject.c +1099 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_JavaPackage.c +548 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_array.c +207 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_class.c +765 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_convert.c +954 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_field.c +421 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_hash.c +504 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_hash.h +161 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_method.c +1823 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_nodl.c +1 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_private.h +689 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_simpleapi.c +219 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsj_utils.c +513 -0
- data/vendor/jsl-0.3.0/src/liveconnect/jsjava.h +313 -0
- data/vendor/jsl-0.3.0/src/liveconnect/liveconnect.pkg +3 -0
- data/vendor/jsl-0.3.0/src/liveconnect/netscape_javascript_JSObject.h +155 -0
- data/vendor/jsl-0.3.0/src/liveconnect/nsCLiveconnect.cpp +785 -0
- data/vendor/jsl-0.3.0/src/liveconnect/nsCLiveconnect.h +197 -0
- data/vendor/jsl-0.3.0/src/liveconnect/nsCLiveconnectFactory.cpp +163 -0
- data/vendor/jsl-0.3.0/src/liveconnect/nsCLiveconnectFactory.h +76 -0
- data/vendor/jsl-0.3.0/src/liveconnect/nsILiveconnect.h +195 -0
- data/vendor/jsl-0.3.0/src/liveconnect/nsISecureLiveconnect.h +84 -0
- data/vendor/jsl-0.3.0/src/liveconnect/nsISecurityContext.h +135 -0
- data/vendor/jsl-0.3.0/src/liveconnect/win32.order +6 -0
- data/vendor/jsl-0.3.0/src/lock_SunOS.s +114 -0
- data/vendor/jsl-0.3.0/src/perfect.js +39 -0
- data/vendor/jsl-0.3.0/src/perlconnect/JS.def +6 -0
- data/vendor/jsl-0.3.0/src/perlconnect/JS.dsp +107 -0
- data/vendor/jsl-0.3.0/src/perlconnect/JS.pm +318 -0
- data/vendor/jsl-0.3.0/src/perlconnect/JS.xs +1050 -0
- data/vendor/jsl-0.3.0/src/perlconnect/Makefile.PL +67 -0
- data/vendor/jsl-0.3.0/src/perlconnect/Makefile.ref +152 -0
- data/vendor/jsl-0.3.0/src/perlconnect/PerlConnect.dsp +103 -0
- data/vendor/jsl-0.3.0/src/perlconnect/PerlConnect.dsw +59 -0
- data/vendor/jsl-0.3.0/src/perlconnect/PerlConnect.pm +126 -0
- data/vendor/jsl-0.3.0/src/perlconnect/PerlConnectShell.dsp +89 -0
- data/vendor/jsl-0.3.0/src/perlconnect/README.html +345 -0
- data/vendor/jsl-0.3.0/src/perlconnect/bg.jpg +0 -0
- data/vendor/jsl-0.3.0/src/perlconnect/jsperl.c +1100 -0
- data/vendor/jsl-0.3.0/src/perlconnect/jsperl.h +52 -0
- data/vendor/jsl-0.3.0/src/perlconnect/jsperlbuild.pl +81 -0
- data/vendor/jsl-0.3.0/src/perlconnect/jsperlpvt.h +57 -0
- data/vendor/jsl-0.3.0/src/perlconnect/test.js +73 -0
- data/vendor/jsl-0.3.0/src/perlconnect/test.pl +244 -0
- data/vendor/jsl-0.3.0/src/perlconnect/typemap +121 -0
- data/vendor/jsl-0.3.0/src/plify_jsdhash.sed +31 -0
- data/vendor/jsl-0.3.0/src/prmjtime.c +646 -0
- data/vendor/jsl-0.3.0/src/prmjtime.h +95 -0
- data/vendor/jsl-0.3.0/src/resource.h +15 -0
- data/vendor/jsl-0.3.0/src/rules.mk +193 -0
- data/vendor/jsl-0.3.0/src/win32.order +391 -0
- data/vendor/jsl-0.3.0/tests/conf/always_use_option_explicit.js +4 -0
- data/vendor/jsl-0.3.0/tests/conf/define.js +8 -0
- data/vendor/jsl-0.3.0/tests/conf/jscript_function_extensions-1.js +7 -0
- data/vendor/jsl-0.3.0/tests/conf/jscript_function_extensions-2.js +8 -0
- data/vendor/jsl-0.3.0/tests/conf/jscript_function_extensions-3.js +27 -0
- data/vendor/jsl-0.3.0/tests/conf/jscript_function_extensions-4.js +4 -0
- data/vendor/jsl-0.3.0/tests/conf/lambda_assign_requires_semicolon.js +24 -0
- data/vendor/jsl-0.3.0/tests/conf/legacy_control_comments.js +8 -0
- data/vendor/jsl-0.3.0/tests/control_comments/control_comments.js +33 -0
- data/vendor/jsl-0.3.0/tests/control_comments/declare.js +26 -0
- data/vendor/jsl-0.3.0/tests/control_comments/import-overflow.js +9 -0
- data/vendor/jsl-0.3.0/tests/control_comments/import.js +5 -0
- data/vendor/jsl-0.3.0/tests/control_comments/import2.js +2 -0
- data/vendor/jsl-0.3.0/tests/control_comments/invalid_fallthru.js +13 -0
- data/vendor/jsl-0.3.0/tests/control_comments/option_explicit-with.js +12 -0
- data/vendor/jsl-0.3.0/tests/control_comments/option_explicit.js +64 -0
- data/vendor/jsl-0.3.0/tests/errors/unterminated_comment.js +8 -0
- data/vendor/jsl-0.3.0/tests/html/script_tag_in_js_literal.html +14 -0
- data/vendor/jsl-0.3.0/tests/run_tests.pl +71 -0
- data/vendor/jsl-0.3.0/tests/warnings/ambiguous_else_stmt.js +21 -0
- data/vendor/jsl-0.3.0/tests/warnings/ambiguous_nested_stmt.js +66 -0
- data/vendor/jsl-0.3.0/tests/warnings/ambiguous_newline.js +261 -0
- data/vendor/jsl-0.3.0/tests/warnings/anon_no_return_value.js +26 -0
- data/vendor/jsl-0.3.0/tests/warnings/assign_to_function_call.js +16 -0
- data/vendor/jsl-0.3.0/tests/warnings/block_without_braces.js +13 -0
- data/vendor/jsl-0.3.0/tests/warnings/comma_separated_stmts.js +17 -0
- data/vendor/jsl-0.3.0/tests/warnings/comparison_type_conv.js +44 -0
- data/vendor/jsl-0.3.0/tests/warnings/default_not_at_end.js +15 -0
- data/vendor/jsl-0.3.0/tests/warnings/dup_option_explicit.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/duplicate_case_in_switch.js +62 -0
- data/vendor/jsl-0.3.0/tests/warnings/duplicate_formal.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/empty_statement.js +29 -0
- data/vendor/jsl-0.3.0/tests/warnings/equal_as_assign.js +7 -0
- data/vendor/jsl-0.3.0/tests/warnings/inc_dec_within_stmt-ignore.js +21 -0
- data/vendor/jsl-0.3.0/tests/warnings/inc_dec_within_stmt.js +63 -0
- data/vendor/jsl-0.3.0/tests/warnings/jsl_cc_not_understood.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/leading_decimal_point.js +7 -0
- data/vendor/jsl-0.3.0/tests/warnings/legacy_cc_not_understood.js +9 -0
- data/vendor/jsl-0.3.0/tests/warnings/meaningless_block.js +12 -0
- data/vendor/jsl-0.3.0/tests/warnings/misplaced_regex.js +20 -0
- data/vendor/jsl-0.3.0/tests/warnings/missing_break.js +87 -0
- data/vendor/jsl-0.3.0/tests/warnings/missing_break_for_last_case.js +19 -0
- data/vendor/jsl-0.3.0/tests/warnings/missing_default_case.js +51 -0
- data/vendor/jsl-0.3.0/tests/warnings/missing_option_explicit.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/missing_semicolon.js +19 -0
- data/vendor/jsl-0.3.0/tests/warnings/multiple_plus_minus.js +10 -0
- data/vendor/jsl-0.3.0/tests/warnings/nested_comment.js +6 -0
- data/vendor/jsl-0.3.0/tests/warnings/no_return_value.js +25 -0
- data/vendor/jsl-0.3.0/tests/warnings/octal_number.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/parseint_missing_radix.js +15 -0
- data/vendor/jsl-0.3.0/tests/warnings/partial_option_explicit.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/redeclared_var.js +10 -0
- data/vendor/jsl-0.3.0/tests/warnings/spidermonkey/bad_backref.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/spidermonkey/deprecated_usage.js +11 -0
- data/vendor/jsl-0.3.0/tests/warnings/spidermonkey/invalid_backref.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/spidermonkey/trailing_comma.js +5 -0
- data/vendor/jsl-0.3.0/tests/warnings/trailing_comma_in_array.js +8 -0
- data/vendor/jsl-0.3.0/tests/warnings/trailing_decimal_point.js +7 -0
- data/vendor/jsl-0.3.0/tests/warnings/unreachable_code.js +29 -0
- data/vendor/jsl-0.3.0/tests/warnings/use_of_label.js +19 -0
- data/vendor/jsl-0.3.0/tests/warnings/useless_assign.js +20 -0
- data/vendor/jsl-0.3.0/tests/warnings/useless_comparison.js +55 -0
- data/vendor/jsl-0.3.0/tests/warnings/useless_void.js +6 -0
- data/vendor/jsl-0.3.0/tests/warnings/var_hides_arg.js +4 -0
- data/vendor/jsl-0.3.0/tests/warnings/with_statement.js +7 -0
- data/vendor/yuicompressor-2.4.2.jar +0 -0
- metadata +605 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
2
|
+
*
|
|
3
|
+
* ***** BEGIN LICENSE BLOCK *****
|
|
4
|
+
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
5
|
+
*
|
|
6
|
+
* The contents of this file are subject to the Mozilla Public License Version
|
|
7
|
+
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
8
|
+
* the License. You may obtain a copy of the License at
|
|
9
|
+
* http://www.mozilla.org/MPL/
|
|
10
|
+
*
|
|
11
|
+
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
12
|
+
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
13
|
+
* for the specific language governing rights and limitations under the
|
|
14
|
+
* License.
|
|
15
|
+
*
|
|
16
|
+
* The Original Code is Mozilla Communicator client code, released
|
|
17
|
+
* March 31, 1998.
|
|
18
|
+
*
|
|
19
|
+
* The Initial Developer of the Original Code is
|
|
20
|
+
* Netscape Communications Corporation.
|
|
21
|
+
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
22
|
+
* the Initial Developer. All Rights Reserved.
|
|
23
|
+
*
|
|
24
|
+
* Contributor(s):
|
|
25
|
+
*
|
|
26
|
+
* Alternatively, the contents of this file may be used under the terms of
|
|
27
|
+
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
28
|
+
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
29
|
+
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
30
|
+
* of those above. If you wish to allow use of your version of this file only
|
|
31
|
+
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
32
|
+
* use your version of this file under the terms of the MPL, indicate your
|
|
33
|
+
* decision by deleting the provisions above and replace them with the notice
|
|
34
|
+
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
35
|
+
* the provisions above, a recipient may use your version of this file under
|
|
36
|
+
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
37
|
+
*
|
|
38
|
+
* ***** END LICENSE BLOCK ***** */
|
|
39
|
+
|
|
40
|
+
/* This is the public header, which means that this is the only thing one */
|
|
41
|
+
/* needs to include to enable the Perl object. See README.html for more */
|
|
42
|
+
/* documentation */
|
|
43
|
+
|
|
44
|
+
#include <jsapi.h>
|
|
45
|
+
|
|
46
|
+
/*
|
|
47
|
+
This is the only function that must be called by an
|
|
48
|
+
application that wants to use PerlConnect.
|
|
49
|
+
*/
|
|
50
|
+
JS_EXTERN_API(JSObject*)
|
|
51
|
+
JS_InitPerlClass(JSContext *cx, JSObject *obj);
|
|
52
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#
|
|
2
|
+
# ***** BEGIN LICENSE BLOCK *****
|
|
3
|
+
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
4
|
+
#
|
|
5
|
+
# The contents of this file are subject to the Mozilla Public License Version
|
|
6
|
+
# 1.1 (the "License"); you may not use this file except in compliance with
|
|
7
|
+
# the License. You may obtain a copy of the License at
|
|
8
|
+
# http://www.mozilla.org/MPL/
|
|
9
|
+
#
|
|
10
|
+
# Software distributed under the License is distributed on an "AS IS" basis,
|
|
11
|
+
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
12
|
+
# for the specific language governing rights and limitations under the
|
|
13
|
+
# License.
|
|
14
|
+
#
|
|
15
|
+
# The Original Code is Mozilla Communicator client code, released
|
|
16
|
+
# March 31, 1998.
|
|
17
|
+
#
|
|
18
|
+
# The Initial Developer of the Original Code is
|
|
19
|
+
# Netscape Communications Corporation.
|
|
20
|
+
# Portions created by the Initial Developer are Copyright (C) 1999
|
|
21
|
+
# the Initial Developer. All Rights Reserved.
|
|
22
|
+
#
|
|
23
|
+
# Contributor(s):
|
|
24
|
+
#
|
|
25
|
+
# Alternatively, the contents of this file may be used under the terms of
|
|
26
|
+
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
27
|
+
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
28
|
+
# in which case the provisions of the GPL or the LGPL are applicable instead
|
|
29
|
+
# of those above. If you wish to allow use of your version of this file only
|
|
30
|
+
# under the terms of either the GPL or the LGPL, and not to allow others to
|
|
31
|
+
# use your version of this file under the terms of the MPL, indicate your
|
|
32
|
+
# decision by deleting the provisions above and replace them with the notice
|
|
33
|
+
# and other provisions required by the GPL or the LGPL. If you do not delete
|
|
34
|
+
# the provisions above, a recipient may use your version of this file under
|
|
35
|
+
# the terms of any one of the MPL, the GPL or the LGPL.
|
|
36
|
+
#
|
|
37
|
+
# ***** END LICENSE BLOCK *****
|
|
38
|
+
|
|
39
|
+
#
|
|
40
|
+
# Helper perl script to abstract the location of xsubpp
|
|
41
|
+
#
|
|
42
|
+
|
|
43
|
+
# Thanks to Dave Neuer <dneuer@futuristics.net> for the original
|
|
44
|
+
# version of this file. Entered as NPL with his permission.
|
|
45
|
+
|
|
46
|
+
use File::Find;
|
|
47
|
+
use Cwd;
|
|
48
|
+
|
|
49
|
+
$notfound = 1;
|
|
50
|
+
|
|
51
|
+
foreach(@INC){
|
|
52
|
+
next if /^\.$/;
|
|
53
|
+
if(-e $_){
|
|
54
|
+
find(\&find_ExtUtils, $_);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if(-e $xsubpp && -e $typemap){
|
|
59
|
+
$res = `perl $xsubpp -typemap $typemap -typemap typemap JS.xs > JS.c`;
|
|
60
|
+
if(-e "JS.c"){
|
|
61
|
+
print "Successfuly built JS.c\n";
|
|
62
|
+
exit(0);
|
|
63
|
+
}
|
|
64
|
+
else{
|
|
65
|
+
die("Couldn't build JS.c: $res");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else{
|
|
69
|
+
die("Couldn't locate files neccessary for building JS.c");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
sub find_ExtUtils{
|
|
73
|
+
if($notfound){
|
|
74
|
+
if($File::Find::dir =~ /ExtUtils/){
|
|
75
|
+
my $path = cwd;
|
|
76
|
+
$xsubpp = $path . "/xsubpp";
|
|
77
|
+
$typemap = $path . "/typemap";
|
|
78
|
+
undef $notfound;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
2
|
+
*
|
|
3
|
+
* ***** BEGIN LICENSE BLOCK *****
|
|
4
|
+
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
5
|
+
*
|
|
6
|
+
* The contents of this file are subject to the Mozilla Public License Version
|
|
7
|
+
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
8
|
+
* the License. You may obtain a copy of the License at
|
|
9
|
+
* http://www.mozilla.org/MPL/
|
|
10
|
+
*
|
|
11
|
+
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
12
|
+
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
13
|
+
* for the specific language governing rights and limitations under the
|
|
14
|
+
* License.
|
|
15
|
+
*
|
|
16
|
+
* The Original Code is Mozilla Communicator client code, released
|
|
17
|
+
* March 31, 1998.
|
|
18
|
+
*
|
|
19
|
+
* The Initial Developer of the Original Code is
|
|
20
|
+
* Netscape Communications Corporation.
|
|
21
|
+
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
22
|
+
* the Initial Developer. All Rights Reserved.
|
|
23
|
+
*
|
|
24
|
+
* Contributor(s):
|
|
25
|
+
*
|
|
26
|
+
* Alternatively, the contents of this file may be used under the terms of
|
|
27
|
+
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
28
|
+
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
29
|
+
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
30
|
+
* of those above. If you wish to allow use of your version of this file only
|
|
31
|
+
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
32
|
+
* use your version of this file under the terms of the MPL, indicate your
|
|
33
|
+
* decision by deleting the provisions above and replace them with the notice
|
|
34
|
+
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
35
|
+
* the provisions above, a recipient may use your version of this file under
|
|
36
|
+
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
37
|
+
*
|
|
38
|
+
* ***** END LICENSE BLOCK ***** */
|
|
39
|
+
|
|
40
|
+
#include "EXTERN.h"
|
|
41
|
+
#include "perl.h"
|
|
42
|
+
#include "jsperl.h"
|
|
43
|
+
/* Copyright � 1998 Netscape Communications Corporation, All Rights Reserved.*/
|
|
44
|
+
/* This is the private header, which means that it shouldn't be included */
|
|
45
|
+
/* unless you need to use some of the jsval<->SV* conversion functions */
|
|
46
|
+
/* provided by PerlConnect needs to include to enable the Perl object. See */
|
|
47
|
+
/* README.html for more documentation */
|
|
48
|
+
|
|
49
|
+
/*
|
|
50
|
+
This and the following function are used to convert
|
|
51
|
+
between Perl's "SV*" and JS's "jsval" types.
|
|
52
|
+
*/
|
|
53
|
+
JS_EXTERN_API(SV*)
|
|
54
|
+
JSVALToSV(JSContext *cx, JSObject *obj, jsval v, SV** sv);
|
|
55
|
+
|
|
56
|
+
JS_EXTERN_API(JSBool)
|
|
57
|
+
SVToJSVAL(JSContext *cx, JSObject *obj, SV *ref, jsval *rval);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* ***** BEGIN LICENSE BLOCK *****
|
|
2
|
+
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
3
|
+
*
|
|
4
|
+
* The contents of this file are subject to the Mozilla Public License Version
|
|
5
|
+
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
6
|
+
* the License. You may obtain a copy of the License at
|
|
7
|
+
* http://www.mozilla.org/MPL/
|
|
8
|
+
*
|
|
9
|
+
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
10
|
+
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
11
|
+
* for the specific language governing rights and limitations under the
|
|
12
|
+
* License.
|
|
13
|
+
*
|
|
14
|
+
* The Original Code is Mozilla Communicator client code, released
|
|
15
|
+
* March 31, 1998.
|
|
16
|
+
*
|
|
17
|
+
* The Initial Developer of the Original Code is
|
|
18
|
+
* Netscape Communications Corporation.
|
|
19
|
+
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
20
|
+
* the Initial Developer. All Rights Reserved.
|
|
21
|
+
*
|
|
22
|
+
* Contributor(s):
|
|
23
|
+
*
|
|
24
|
+
* Alternatively, the contents of this file may be used under the terms of
|
|
25
|
+
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
26
|
+
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
27
|
+
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
28
|
+
* of those above. If you wish to allow use of your version of this file only
|
|
29
|
+
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
30
|
+
* use your version of this file under the terms of the MPL, indicate your
|
|
31
|
+
* decision by deleting the provisions above and replace them with the notice
|
|
32
|
+
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
33
|
+
* the provisions above, a recipient may use your version of this file under
|
|
34
|
+
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
35
|
+
*
|
|
36
|
+
* ***** END LICENSE BLOCK ***** */
|
|
37
|
+
|
|
38
|
+
/*******************************************************************************
|
|
39
|
+
* PerlConnect test file. Some primitive testing in "silent mode" -- that is,
|
|
40
|
+
* you should be able to run
|
|
41
|
+
* perlconnectshell test.js
|
|
42
|
+
* without any error messages. See README.html for more info.
|
|
43
|
+
*******************************************************************************/
|
|
44
|
+
|
|
45
|
+
// Init
|
|
46
|
+
assert(p = new Perl('Sys::Hostname', 'Time::gmtime'), "Perl initialization failed");
|
|
47
|
+
// Simple eval
|
|
48
|
+
assert(p.eval("'-' x 3") == '---', "Wrong value returned from eval");
|
|
49
|
+
|
|
50
|
+
assert(p.eval("undef()")==undefined, "Wrong value returned from eval");
|
|
51
|
+
// Arrays
|
|
52
|
+
assert(a=p.eval("(1, 2, 3);"), "eval failed, 1");
|
|
53
|
+
assert(a[1]==2, "Wrong value");
|
|
54
|
+
assert(a.length==3, "Wrong length");
|
|
55
|
+
// Hashes
|
|
56
|
+
assert(h=p.eval("{'one'=>1, 'two'=>2};"), "eval failed, 2");
|
|
57
|
+
assert(h["two"]==2, "Wrong value");
|
|
58
|
+
// Func. call
|
|
59
|
+
assert(p.eval("&hostname()") == p.call("hostname"), "Wrong value returned from eval or call");
|
|
60
|
+
// Complex call
|
|
61
|
+
assert(b=p.Time.gmtime.gmtime(), "call failed");
|
|
62
|
+
assert(b.length==9, "Wrong length")
|
|
63
|
+
// Variables
|
|
64
|
+
// Scalars
|
|
65
|
+
assert(p.eval("$a = 100; $b = 'abc';"), "eval failed, 3");
|
|
66
|
+
assert(p.$a ==100, "Wrong variable value, 1");
|
|
67
|
+
assert(p["$b"] == 'abc', "Wrong variable value, 2");
|
|
68
|
+
|
|
69
|
+
/* Auxilary function */
|
|
70
|
+
function assert(cond, msg)
|
|
71
|
+
{
|
|
72
|
+
cond || print("Error: " + msg+"\n");
|
|
73
|
+
} // assert
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
#
|
|
2
|
+
# ***** BEGIN LICENSE BLOCK *****
|
|
3
|
+
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
4
|
+
#
|
|
5
|
+
# The contents of this file are subject to the Mozilla Public License Version
|
|
6
|
+
# 1.1 (the "License"); you may not use this file except in compliance with
|
|
7
|
+
# the License. You may obtain a copy of the License at
|
|
8
|
+
# http://www.mozilla.org/MPL/
|
|
9
|
+
#
|
|
10
|
+
# Software distributed under the License is distributed on an "AS IS" basis,
|
|
11
|
+
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
12
|
+
# for the specific language governing rights and limitations under the
|
|
13
|
+
# License.
|
|
14
|
+
#
|
|
15
|
+
# The Original Code is Mozilla Communicator client code, released
|
|
16
|
+
# March 31, 1998.
|
|
17
|
+
#
|
|
18
|
+
# The Initial Developer of the Original Code is
|
|
19
|
+
# Netscape Communications Corporation.
|
|
20
|
+
# Portions created by the Initial Developer are Copyright (C) 1998
|
|
21
|
+
# the Initial Developer. All Rights Reserved.
|
|
22
|
+
#
|
|
23
|
+
# Contributor(s):
|
|
24
|
+
#
|
|
25
|
+
# Alternatively, the contents of this file may be used under the terms of
|
|
26
|
+
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
27
|
+
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
28
|
+
# in which case the provisions of the GPL or the LGPL are applicable instead
|
|
29
|
+
# of those above. If you wish to allow use of your version of this file only
|
|
30
|
+
# under the terms of either the GPL or the LGPL, and not to allow others to
|
|
31
|
+
# use your version of this file under the terms of the MPL, indicate your
|
|
32
|
+
# decision by deleting the provisions above and replace them with the notice
|
|
33
|
+
# and other provisions required by the GPL or the LGPL. If you do not delete
|
|
34
|
+
# the provisions above, a recipient may use your version of this file under
|
|
35
|
+
# the terms of any one of the MPL, the GPL or the LGPL.
|
|
36
|
+
#
|
|
37
|
+
# ***** END LICENSE BLOCK *****
|
|
38
|
+
|
|
39
|
+
#
|
|
40
|
+
# Test file for JS.pm
|
|
41
|
+
#
|
|
42
|
+
|
|
43
|
+
############################################################
|
|
44
|
+
# support packages for test script
|
|
45
|
+
############################################################
|
|
46
|
+
|
|
47
|
+
############################################################
|
|
48
|
+
# Fotrik
|
|
49
|
+
package Father;
|
|
50
|
+
|
|
51
|
+
sub old_meth {
|
|
52
|
+
return "Father::old_meth";
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
############################################################
|
|
57
|
+
# Synacek
|
|
58
|
+
package Son;
|
|
59
|
+
use vars qw( @ISA );
|
|
60
|
+
@ISA = qw( Father );
|
|
61
|
+
|
|
62
|
+
sub new {
|
|
63
|
+
my $class = shift;
|
|
64
|
+
$class = ref $class || $class;
|
|
65
|
+
my $self = {};
|
|
66
|
+
bless $self, $class;
|
|
67
|
+
return $self;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
sub new_meth {
|
|
71
|
+
return "Son::new_meth";
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
############################################################
|
|
75
|
+
# Proxy
|
|
76
|
+
package Proxy;
|
|
77
|
+
|
|
78
|
+
sub new {
|
|
79
|
+
my $class = shift;
|
|
80
|
+
$class = ref $class || $class;
|
|
81
|
+
my $self = { property => shift };
|
|
82
|
+
bless $self, $class;
|
|
83
|
+
return $self;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
sub getObj {
|
|
87
|
+
my $ret = new Son();
|
|
88
|
+
return $ret;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
sub getValue {
|
|
92
|
+
my $self = shift;
|
|
93
|
+
return $self->{ property };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
sub getArray {
|
|
97
|
+
my $self = shift;
|
|
98
|
+
return [34, 35, 36, 37, 38];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
sub getHash {
|
|
102
|
+
my $self = shift;
|
|
103
|
+
return { testkey1 => 'testvalue1',
|
|
104
|
+
testkey2 => 'testvalue2',
|
|
105
|
+
testkey3 => 'testvalue3', };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
############################################################
|
|
109
|
+
# main part of the test script
|
|
110
|
+
############################################################
|
|
111
|
+
|
|
112
|
+
package main;
|
|
113
|
+
use JS;
|
|
114
|
+
|
|
115
|
+
BEGIN {
|
|
116
|
+
$| = 1; print "1..12\n";
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
END
|
|
120
|
+
{ print "not ok 1\n" unless $loaded; }
|
|
121
|
+
|
|
122
|
+
$loaded = 1;
|
|
123
|
+
print "ok 1\n";
|
|
124
|
+
|
|
125
|
+
use strict; #no typos, please
|
|
126
|
+
|
|
127
|
+
my $rt = new JS(1_204 ** 2);
|
|
128
|
+
my $cx = $rt->createContext(8 * 1_024);
|
|
129
|
+
|
|
130
|
+
my $jsval;
|
|
131
|
+
my $testc = 1; #testcounter
|
|
132
|
+
############################################################
|
|
133
|
+
# the simplest test
|
|
134
|
+
$testc++;
|
|
135
|
+
$jsval = $cx->eval('6;');
|
|
136
|
+
print $jsval == 6 ? "ok $testc\n" : "not ok $testc\n"; #2
|
|
137
|
+
|
|
138
|
+
############################################################
|
|
139
|
+
#second very simple test
|
|
140
|
+
$testc++;
|
|
141
|
+
$jsval = $cx->eval('"hallo";');
|
|
142
|
+
print $jsval eq "hallo" ? "ok $testc\n" : "not ok $testc\n"; #3
|
|
143
|
+
|
|
144
|
+
############################################################
|
|
145
|
+
# third very simple test
|
|
146
|
+
$testc++;
|
|
147
|
+
$jsval = $cx->eval("1.23");
|
|
148
|
+
print $jsval == 1.23 ? "ok $testc\n" : "not ok $testc\n"; #4
|
|
149
|
+
|
|
150
|
+
############################################################
|
|
151
|
+
#undef is little bit tricky
|
|
152
|
+
$testc++;
|
|
153
|
+
$jsval = $cx->eval('undefined');
|
|
154
|
+
print ! defined $jsval ? "ok $testc\n" : "not ok $testc\n"; #5
|
|
155
|
+
|
|
156
|
+
############################################################
|
|
157
|
+
#can ve tie js objects? (generally to hash, Arrays to arrays too)
|
|
158
|
+
$testc++;
|
|
159
|
+
$jsval = $cx->eval('foo = new Object(); foo.prop = 11; foo;');
|
|
160
|
+
my %hash;
|
|
161
|
+
#read js property
|
|
162
|
+
tie %hash, 'JS::Object', $jsval;
|
|
163
|
+
print $hash{prop} == 11 ? "ok $testc\n" : "not ok $testc\n"; #6
|
|
164
|
+
|
|
165
|
+
############################################################
|
|
166
|
+
#set js propertry
|
|
167
|
+
$testc++;
|
|
168
|
+
$hash{prop2} = 2;
|
|
169
|
+
$jsval = $cx->eval('foo.prop2;');
|
|
170
|
+
print $jsval == 2 ? "ok $testc\n" : "not ok $testc\n"; #7
|
|
171
|
+
|
|
172
|
+
############################################################
|
|
173
|
+
#tie array
|
|
174
|
+
$testc++;
|
|
175
|
+
my @arr;
|
|
176
|
+
$jsval = $cx->eval('arr = new Array(); arr[0] = 0; arr[1] = 1; arr;');
|
|
177
|
+
tie @arr, "JS::Object", $jsval;
|
|
178
|
+
print ((($#arr == 1) && ($arr[1] == 1)) ? "ok $testc\n" : "not ok $testc\n");#8
|
|
179
|
+
|
|
180
|
+
############################################################
|
|
181
|
+
# object delegation test
|
|
182
|
+
$testc++;
|
|
183
|
+
$cx->createObject(new Proxy("init_value"), "perlobj",
|
|
184
|
+
{ getObj => \&Proxy::getObj,
|
|
185
|
+
getValue => \&Proxy::getValue,
|
|
186
|
+
getArray => \&Proxy::getArray,
|
|
187
|
+
getHash => \&Proxy::getHash,
|
|
188
|
+
});
|
|
189
|
+
$jsval = $cx->eval("perlobj.getValue()");
|
|
190
|
+
print $jsval eq "init_value" ? "ok $testc\n" : "not ok $testc\n"; #9
|
|
191
|
+
|
|
192
|
+
############################################################
|
|
193
|
+
# perl object returned to js
|
|
194
|
+
$testc++;
|
|
195
|
+
$jsval = $cx->eval("po = perlobj.getObj(); po.new_meth()");
|
|
196
|
+
print $jsval eq "Son::new_meth" ? "ok $testc\n" : "not ok $testc\n"; #10
|
|
197
|
+
|
|
198
|
+
############################################################
|
|
199
|
+
# and what about inherited methods?
|
|
200
|
+
$testc++;
|
|
201
|
+
$jsval = $cx->eval("po.old_meth()");
|
|
202
|
+
print $jsval eq "Father::old_meth" ? "ok $testc\n" : "not ok $testc\n"; #11
|
|
203
|
+
|
|
204
|
+
############################################################
|
|
205
|
+
# pass an array, check the element
|
|
206
|
+
$testc++;
|
|
207
|
+
$jsval = $cx->eval("parr = perlobj.getArray(); parr[2];");
|
|
208
|
+
print $jsval == 36 ? "ok $testc\n" : "not ok $testc\n"; #12
|
|
209
|
+
|
|
210
|
+
############################################################
|
|
211
|
+
# check the array length
|
|
212
|
+
$testc++;
|
|
213
|
+
$jsval = $cx->eval("parr.length");
|
|
214
|
+
print $jsval == 5 ? "ok $testc\n" : "not ok $testc\n"; #13
|
|
215
|
+
|
|
216
|
+
############################################################
|
|
217
|
+
# pass a hash, check the element
|
|
218
|
+
$testc++;
|
|
219
|
+
$jsval = $cx->eval("phash = perlobj.getHash(); phash.testkey1;");
|
|
220
|
+
print $jsval eq 'testvalue1' ? "ok $testc\n" : "not ok $testc\n"; #14
|
|
221
|
+
|
|
222
|
+
############################################################
|
|
223
|
+
# error test
|
|
224
|
+
$testc++;
|
|
225
|
+
my $line;
|
|
226
|
+
my $err;
|
|
227
|
+
sub js_ErrorReporter {
|
|
228
|
+
my ($msg, $file, $line, $linebuf, $token) = @_;
|
|
229
|
+
$err = "line $line $msg";
|
|
230
|
+
}
|
|
231
|
+
$cx->setErrorReporter( \&js_ErrorReporter );
|
|
232
|
+
$cx->eval("x = 2 + 4;\nx.method()\n");
|
|
233
|
+
print $err =~ /^line 1/ ? "ok $testc\n" : "not ok $testc\n"; #15
|
|
234
|
+
|
|
235
|
+
############################################################
|
|
236
|
+
# cleanup
|
|
237
|
+
# so far we have to undef context value, to make sure,
|
|
238
|
+
# it is disposed before runtime
|
|
239
|
+
undef $cx;
|
|
240
|
+
undef $rt;
|
|
241
|
+
|
|
242
|
+
__END__
|
|
243
|
+
|
|
244
|
+
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
#
|
|
2
|
+
# ***** BEGIN LICENSE BLOCK *****
|
|
3
|
+
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
4
|
+
#
|
|
5
|
+
# The contents of this file are subject to the Mozilla Public License Version
|
|
6
|
+
# 1.1 (the "License"); you may not use this file except in compliance with
|
|
7
|
+
# the License. You may obtain a copy of the License at
|
|
8
|
+
# http://www.mozilla.org/MPL/
|
|
9
|
+
#
|
|
10
|
+
# Software distributed under the License is distributed on an "AS IS" basis,
|
|
11
|
+
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
12
|
+
# for the specific language governing rights and limitations under the
|
|
13
|
+
# License.
|
|
14
|
+
#
|
|
15
|
+
# The Original Code is Mozilla Communicator client code, released
|
|
16
|
+
# March 31, 1998.
|
|
17
|
+
#
|
|
18
|
+
# The Initial Developer of the Original Code is
|
|
19
|
+
# Netscape Communications Corporation.
|
|
20
|
+
# Portions created by the Initial Developer are Copyright (C) 1998
|
|
21
|
+
# the Initial Developer. All Rights Reserved.
|
|
22
|
+
#
|
|
23
|
+
# Contributor(s):
|
|
24
|
+
#
|
|
25
|
+
# Alternatively, the contents of this file may be used under the terms of
|
|
26
|
+
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
27
|
+
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
28
|
+
# in which case the provisions of the GPL or the LGPL are applicable instead
|
|
29
|
+
# of those above. If you wish to allow use of your version of this file only
|
|
30
|
+
# under the terms of either the GPL or the LGPL, and not to allow others to
|
|
31
|
+
# use your version of this file under the terms of the MPL, indicate your
|
|
32
|
+
# decision by deleting the provisions above and replace them with the notice
|
|
33
|
+
# and other provisions required by the GPL or the LGPL. If you do not delete
|
|
34
|
+
# the provisions above, a recipient may use your version of this file under
|
|
35
|
+
# the terms of any one of the MPL, the GPL or the LGPL.
|
|
36
|
+
#
|
|
37
|
+
# ***** END LICENSE BLOCK *****
|
|
38
|
+
|
|
39
|
+
#
|
|
40
|
+
# Typemap for PerlConnect
|
|
41
|
+
#
|
|
42
|
+
|
|
43
|
+
TYPEMAP
|
|
44
|
+
# These types have direct equivalents implemented as Perl packages
|
|
45
|
+
JSRuntime * RUNTIME
|
|
46
|
+
JSContext * CONTEXT
|
|
47
|
+
JSScript * SCRIPT
|
|
48
|
+
jsval jsval
|
|
49
|
+
# This is an auxilary type. Object serves as a wrapper for it
|
|
50
|
+
JSObject * OBJECT
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
OUTPUT
|
|
54
|
+
jsval
|
|
55
|
+
{
|
|
56
|
+
SV *foo = sv_newmortal();
|
|
57
|
+
JSVALToSV(cx, JS_GetGlobalObject(cx), $var, &foo);
|
|
58
|
+
sv_setsv($arg, foo);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
OBJECT
|
|
62
|
+
sv_setref_pv($arg, "JS::Object", (void*)$var);
|
|
63
|
+
|
|
64
|
+
#CONTEXT
|
|
65
|
+
# sv_setref_pv($arg, "JS::Context", (void*)$var);
|
|
66
|
+
|
|
67
|
+
SCRIPT
|
|
68
|
+
sv_setref_pv($arg, "JS::Script", (void*)$var);
|
|
69
|
+
|
|
70
|
+
RUNTIME
|
|
71
|
+
sv_setref_pv($arg, "JS::Runtime", (void*)$var);
|
|
72
|
+
|
|
73
|
+
#JS_OBJECT
|
|
74
|
+
# sv_setref_pv($arg, "JSObject", (void*)$var);
|
|
75
|
+
|
|
76
|
+
INPUT
|
|
77
|
+
jsval
|
|
78
|
+
{
|
|
79
|
+
/* JSContext *cx = getContext(); */
|
|
80
|
+
SVToJSVAL(cx, JS_GetGlobalObject(cx), newRV($arg), &$var);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
OBJECT
|
|
84
|
+
if(sv_isa($arg, \"JS::Object\"))
|
|
85
|
+
$var = ($type)SvIV((SV*)SvRV($arg));
|
|
86
|
+
else{
|
|
87
|
+
warn(\"${Package}::$func_name() -- $var is not a blessed JS::Object reference\");
|
|
88
|
+
XSRETURN_UNDEF;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
#CONTEXT
|
|
92
|
+
# if(sv_isa($arg, \"JS::Context\"))
|
|
93
|
+
# $var = ($type)SvIV((SV*)SvRV($arg));
|
|
94
|
+
# else{
|
|
95
|
+
# warn(\"${Package}::$func_name() -- $var is not a blessed JS::Context reference\");
|
|
96
|
+
# XSRETURN_UNDEF;
|
|
97
|
+
# }
|
|
98
|
+
|
|
99
|
+
CONTEXT
|
|
100
|
+
if(sv_isa($arg, \"JS::Context\"))
|
|
101
|
+
$var = ($type)SvIV(*hv_fetch((HV*)SvRV($arg), \"_handle\", 7, 0));
|
|
102
|
+
else{
|
|
103
|
+
warn(\"${Package}::$func_name() -- $var is not a blessed JS::Context reference\");
|
|
104
|
+
XSRETURN_UNDEF;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
SCRIPT
|
|
108
|
+
if(sv_isa($arg, \"JS::Script\"))
|
|
109
|
+
$var = ($type)SvIV((SV*)SvRV($arg));
|
|
110
|
+
else{
|
|
111
|
+
warn(\"${Package}::$func_name() -- $var is not a blessed JS::Script reference\");
|
|
112
|
+
XSRETURN_UNDEF;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
RUNTIME
|
|
116
|
+
if(sv_isa($arg, \"JS::Runtime\"))
|
|
117
|
+
$var = ($type)SvIV((SV*)SvRV($arg));
|
|
118
|
+
else{
|
|
119
|
+
warn(\"${Package}::$func_name() -- $var is not a blessed JS::Runtime reference\");
|
|
120
|
+
XSRETURN_UNDEF;
|
|
121
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/ * Double hashing implementation./a\
|
|
2
|
+
* GENERATED BY js/src/plify_jsdhash.sed -- DO NOT EDIT!!!
|
|
3
|
+
/ * Double hashing, a la Knuth 6./a\
|
|
4
|
+
* GENERATED BY js/src/plify_jsdhash.sed -- DO NOT EDIT!!!
|
|
5
|
+
s/jsdhash_h___/pldhash_h___/
|
|
6
|
+
s/jsdhash\.bigdump/pldhash.bigdump/
|
|
7
|
+
s/jstypes\.h/prtypes.h/
|
|
8
|
+
s/jsbit\.h/prbit.h/
|
|
9
|
+
s/jsdhash\.h/pldhash.h/
|
|
10
|
+
s/jsdhash\.c/pldhash.c/
|
|
11
|
+
s/jsdhash:/pldhash:/
|
|
12
|
+
s/jsutil\.h/prlog.h/
|
|
13
|
+
s/JS_DHASH/PL_DHASH/g
|
|
14
|
+
s/JS_DHash/PL_DHash/g
|
|
15
|
+
s/JSDHash/PLDHash/g
|
|
16
|
+
s/JSHash/PLHash/g
|
|
17
|
+
s/uint32 /PRUint32/g
|
|
18
|
+
s/\([^U]\)int32 /\1PRInt32/g
|
|
19
|
+
s/uint16 /PRUint16/g
|
|
20
|
+
s/\([^U]\)int16 /\1PRInt16/g
|
|
21
|
+
s/uint32/PRUint32/g
|
|
22
|
+
s/\([^U]\)int32/\1PRInt32/g
|
|
23
|
+
s/uint16/PRUint16/g
|
|
24
|
+
s/\([^U]\)int16/\1PRInt16/g
|
|
25
|
+
s/JSBool/PRBool/g
|
|
26
|
+
s/extern JS_PUBLIC_API/PR_EXTERN/
|
|
27
|
+
s/JS_PUBLIC_API/PR_IMPLEMENT/
|
|
28
|
+
s/JS_DLL_CALLBACK/PR_CALLBACK/
|
|
29
|
+
s/JS_STATIC_DLL_CALLBACK/PR_STATIC_CALLBACK/
|
|
30
|
+
s/JS_NewDHashTable/PL_NewDHashTable/
|
|
31
|
+
s/JS_/PR_/g
|