jbarnette-johnson 1.0.0.200806240111 → 1.0.0.200807291507
Sign up to get free protection for your applications and to get access to all the features.
- data/MANIFEST +1 -0
- data/Rakefile +3 -10
- data/bin/johnson +2 -1
- data/ext/spidermonkey/context.c +3 -4
- data/ext/spidermonkey/context.h +1 -1
- data/ext/spidermonkey/conversions.c +39 -33
- data/ext/spidermonkey/debugger.c +5 -5
- data/ext/spidermonkey/immutable_node.c.erb +11 -11
- data/ext/spidermonkey/jroot.h +4 -4
- data/ext/spidermonkey/js_land_proxy.c +9 -8
- data/ext/spidermonkey/ruby_land_proxy.c +5 -4
- data/ext/spidermonkey/runtime.c +1 -1
- data/johnson.gemspec +36 -0
- data/lib/hoe.rb +0 -7
- data/lib/johnson/cli/options.rb +10 -4
- data/lib/johnson/spidermonkey/runtime.rb +2 -2
- data/lib/johnson/version.rb +4 -2
- data/lib/johnson.rb +1 -0
- data/test/johnson/runtime_test.rb +11 -0
- data/test/johnson/spidermonkey/ruby_land_proxy_test.rb +6 -0
- data/vendor/spidermonkey/.cvsignore +9 -0
- data/vendor/spidermonkey/Makefile.in +462 -0
- data/vendor/spidermonkey/Makefile.ref +364 -0
- data/vendor/spidermonkey/README.html +820 -0
- data/vendor/spidermonkey/SpiderMonkey.rsp +12 -0
- data/vendor/spidermonkey/Y.js +19 -0
- data/vendor/spidermonkey/build.mk +43 -0
- data/vendor/spidermonkey/config/AIX4.1.mk +65 -0
- data/vendor/spidermonkey/config/AIX4.2.mk +64 -0
- data/vendor/spidermonkey/config/AIX4.3.mk +65 -0
- data/vendor/spidermonkey/config/Darwin.mk +83 -0
- data/vendor/spidermonkey/config/Darwin1.3.mk +81 -0
- data/vendor/spidermonkey/config/Darwin1.4.mk +41 -0
- data/vendor/spidermonkey/config/Darwin5.2.mk +81 -0
- data/vendor/spidermonkey/config/Darwin5.3.mk +81 -0
- data/vendor/spidermonkey/config/HP-UXB.10.10.mk +77 -0
- data/vendor/spidermonkey/config/HP-UXB.10.20.mk +77 -0
- data/vendor/spidermonkey/config/HP-UXB.11.00.mk +80 -0
- data/vendor/spidermonkey/config/IRIX.mk +87 -0
- data/vendor/spidermonkey/config/IRIX5.3.mk +44 -0
- data/vendor/spidermonkey/config/IRIX6.1.mk +44 -0
- data/vendor/spidermonkey/config/IRIX6.2.mk +44 -0
- data/vendor/spidermonkey/config/IRIX6.3.mk +44 -0
- data/vendor/spidermonkey/config/IRIX6.5.mk +44 -0
- data/vendor/spidermonkey/config/Linux_All.mk +103 -0
- data/vendor/spidermonkey/config/Mac_OS10.0.mk +82 -0
- data/vendor/spidermonkey/config/OSF1V4.0.mk +72 -0
- data/vendor/spidermonkey/config/OSF1V5.0.mk +69 -0
- data/vendor/spidermonkey/config/SunOS4.1.4.mk +101 -0
- data/vendor/spidermonkey/config/SunOS5.10.mk +50 -0
- data/vendor/spidermonkey/config/SunOS5.3.mk +91 -0
- data/vendor/spidermonkey/config/SunOS5.4.mk +92 -0
- data/vendor/spidermonkey/config/SunOS5.5.1.mk +44 -0
- data/vendor/spidermonkey/config/SunOS5.5.mk +87 -0
- data/vendor/spidermonkey/config/SunOS5.6.mk +89 -0
- data/vendor/spidermonkey/config/SunOS5.7.mk +44 -0
- data/vendor/spidermonkey/config/SunOS5.8.mk +44 -0
- data/vendor/spidermonkey/config/SunOS5.9.mk +44 -0
- data/vendor/spidermonkey/config/WINNT4.0.mk +117 -0
- data/vendor/spidermonkey/config/WINNT5.0.mk +117 -0
- data/vendor/spidermonkey/config/WINNT5.1.mk +117 -0
- data/vendor/spidermonkey/config/WINNT5.2.mk +117 -0
- data/vendor/spidermonkey/config/WINNT6.0.mk +117 -0
- data/vendor/spidermonkey/config/dgux.mk +64 -0
- data/vendor/spidermonkey/config.mk +192 -0
- data/vendor/spidermonkey/editline/Makefile.ref +144 -0
- data/vendor/spidermonkey/editline/README +83 -0
- data/vendor/spidermonkey/editline/editline.3 +175 -0
- data/vendor/spidermonkey/editline/editline.c +1369 -0
- data/vendor/spidermonkey/editline/editline.h +135 -0
- data/vendor/spidermonkey/editline/sysunix.c +182 -0
- data/vendor/spidermonkey/editline/unix.h +82 -0
- data/vendor/spidermonkey/fdlibm/.cvsignore +7 -0
- data/vendor/spidermonkey/fdlibm/Makefile.in +127 -0
- data/vendor/spidermonkey/fdlibm/Makefile.ref +192 -0
- data/vendor/spidermonkey/fdlibm/e_acos.c +147 -0
- data/vendor/spidermonkey/fdlibm/e_acosh.c +105 -0
- data/vendor/spidermonkey/fdlibm/e_asin.c +156 -0
- data/vendor/spidermonkey/fdlibm/e_atan2.c +165 -0
- data/vendor/spidermonkey/fdlibm/e_atanh.c +110 -0
- data/vendor/spidermonkey/fdlibm/e_cosh.c +133 -0
- data/vendor/spidermonkey/fdlibm/e_exp.c +202 -0
- data/vendor/spidermonkey/fdlibm/e_fmod.c +184 -0
- data/vendor/spidermonkey/fdlibm/e_gamma.c +71 -0
- data/vendor/spidermonkey/fdlibm/e_gamma_r.c +70 -0
- data/vendor/spidermonkey/fdlibm/e_hypot.c +173 -0
- data/vendor/spidermonkey/fdlibm/e_j0.c +524 -0
- data/vendor/spidermonkey/fdlibm/e_j1.c +523 -0
- data/vendor/spidermonkey/fdlibm/e_jn.c +315 -0
- data/vendor/spidermonkey/fdlibm/e_lgamma.c +71 -0
- data/vendor/spidermonkey/fdlibm/e_lgamma_r.c +347 -0
- data/vendor/spidermonkey/fdlibm/e_log.c +184 -0
- data/vendor/spidermonkey/fdlibm/e_log10.c +134 -0
- data/vendor/spidermonkey/fdlibm/e_pow.c +386 -0
- data/vendor/spidermonkey/fdlibm/e_rem_pio2.c +222 -0
- data/vendor/spidermonkey/fdlibm/e_remainder.c +120 -0
- data/vendor/spidermonkey/fdlibm/e_scalb.c +89 -0
- data/vendor/spidermonkey/fdlibm/e_sinh.c +122 -0
- data/vendor/spidermonkey/fdlibm/e_sqrt.c +497 -0
- data/vendor/spidermonkey/fdlibm/fdlibm.h +273 -0
- data/vendor/spidermonkey/fdlibm/fdlibm.mak +1453 -0
- data/vendor/spidermonkey/fdlibm/fdlibm.mdp +0 -0
- data/vendor/spidermonkey/fdlibm/k_cos.c +135 -0
- data/vendor/spidermonkey/fdlibm/k_rem_pio2.c +354 -0
- data/vendor/spidermonkey/fdlibm/k_sin.c +114 -0
- data/vendor/spidermonkey/fdlibm/k_standard.c +785 -0
- data/vendor/spidermonkey/fdlibm/k_tan.c +170 -0
- data/vendor/spidermonkey/fdlibm/s_asinh.c +101 -0
- data/vendor/spidermonkey/fdlibm/s_atan.c +175 -0
- data/vendor/spidermonkey/fdlibm/s_cbrt.c +133 -0
- data/vendor/spidermonkey/fdlibm/s_ceil.c +120 -0
- data/vendor/spidermonkey/fdlibm/s_copysign.c +72 -0
- data/vendor/spidermonkey/fdlibm/s_cos.c +118 -0
- data/vendor/spidermonkey/fdlibm/s_erf.c +356 -0
- data/vendor/spidermonkey/fdlibm/s_expm1.c +267 -0
- data/vendor/spidermonkey/fdlibm/s_fabs.c +70 -0
- data/vendor/spidermonkey/fdlibm/s_finite.c +71 -0
- data/vendor/spidermonkey/fdlibm/s_floor.c +121 -0
- data/vendor/spidermonkey/fdlibm/s_frexp.c +99 -0
- data/vendor/spidermonkey/fdlibm/s_ilogb.c +85 -0
- data/vendor/spidermonkey/fdlibm/s_isnan.c +74 -0
- data/vendor/spidermonkey/fdlibm/s_ldexp.c +66 -0
- data/vendor/spidermonkey/fdlibm/s_lib_version.c +73 -0
- data/vendor/spidermonkey/fdlibm/s_log1p.c +211 -0
- data/vendor/spidermonkey/fdlibm/s_logb.c +79 -0
- data/vendor/spidermonkey/fdlibm/s_matherr.c +64 -0
- data/vendor/spidermonkey/fdlibm/s_modf.c +132 -0
- data/vendor/spidermonkey/fdlibm/s_nextafter.c +124 -0
- data/vendor/spidermonkey/fdlibm/s_rint.c +131 -0
- data/vendor/spidermonkey/fdlibm/s_scalbn.c +107 -0
- data/vendor/spidermonkey/fdlibm/s_signgam.c +40 -0
- data/vendor/spidermonkey/fdlibm/s_significand.c +68 -0
- data/vendor/spidermonkey/fdlibm/s_sin.c +118 -0
- data/vendor/spidermonkey/fdlibm/s_tan.c +112 -0
- data/vendor/spidermonkey/fdlibm/s_tanh.c +122 -0
- data/vendor/spidermonkey/fdlibm/w_acos.c +78 -0
- data/vendor/spidermonkey/fdlibm/w_acosh.c +78 -0
- data/vendor/spidermonkey/fdlibm/w_asin.c +80 -0
- data/vendor/spidermonkey/fdlibm/w_atan2.c +79 -0
- data/vendor/spidermonkey/fdlibm/w_atanh.c +81 -0
- data/vendor/spidermonkey/fdlibm/w_cosh.c +77 -0
- data/vendor/spidermonkey/fdlibm/w_exp.c +88 -0
- data/vendor/spidermonkey/fdlibm/w_fmod.c +78 -0
- data/vendor/spidermonkey/fdlibm/w_gamma.c +85 -0
- data/vendor/spidermonkey/fdlibm/w_gamma_r.c +81 -0
- data/vendor/spidermonkey/fdlibm/w_hypot.c +78 -0
- data/vendor/spidermonkey/fdlibm/w_j0.c +105 -0
- data/vendor/spidermonkey/fdlibm/w_j1.c +106 -0
- data/vendor/spidermonkey/fdlibm/w_jn.c +128 -0
- data/vendor/spidermonkey/fdlibm/w_lgamma.c +85 -0
- data/vendor/spidermonkey/fdlibm/w_lgamma_r.c +81 -0
- data/vendor/spidermonkey/fdlibm/w_log.c +78 -0
- data/vendor/spidermonkey/fdlibm/w_log10.c +81 -0
- data/vendor/spidermonkey/fdlibm/w_pow.c +99 -0
- data/vendor/spidermonkey/fdlibm/w_remainder.c +77 -0
- data/vendor/spidermonkey/fdlibm/w_scalb.c +95 -0
- data/vendor/spidermonkey/fdlibm/w_sinh.c +77 -0
- data/vendor/spidermonkey/fdlibm/w_sqrt.c +77 -0
- data/vendor/spidermonkey/javascript-trace.d +73 -0
- data/vendor/spidermonkey/js.c +3951 -0
- data/vendor/spidermonkey/js.mak +4438 -0
- data/vendor/spidermonkey/js.mdp +0 -0
- data/vendor/spidermonkey/js.msg +307 -0
- data/vendor/spidermonkey/js.pkg +2 -0
- data/vendor/spidermonkey/js3240.rc +79 -0
- data/vendor/spidermonkey/jsOS240.def +654 -0
- data/vendor/spidermonkey/jsapi.c +5836 -0
- data/vendor/spidermonkey/jsapi.h +2624 -0
- data/vendor/spidermonkey/jsarena.c +450 -0
- data/vendor/spidermonkey/jsarena.h +318 -0
- data/vendor/spidermonkey/jsarray.c +2988 -0
- data/vendor/spidermonkey/jsarray.h +124 -0
- data/vendor/spidermonkey/jsatom.c +1045 -0
- data/vendor/spidermonkey/jsatom.h +442 -0
- data/vendor/spidermonkey/jsbit.h +253 -0
- data/vendor/spidermonkey/jsbool.c +176 -0
- data/vendor/spidermonkey/jsbool.h +73 -0
- data/vendor/spidermonkey/jsclist.h +139 -0
- data/vendor/spidermonkey/jscntxt.c +1348 -0
- data/vendor/spidermonkey/jscntxt.h +1120 -0
- data/vendor/spidermonkey/jscompat.h +57 -0
- data/vendor/spidermonkey/jsconfig.h +248 -0
- data/vendor/spidermonkey/jsconfig.mk +181 -0
- data/vendor/spidermonkey/jscpucfg.c +383 -0
- data/vendor/spidermonkey/jscpucfg.h +212 -0
- data/vendor/spidermonkey/jsdate.c +2398 -0
- data/vendor/spidermonkey/jsdate.h +124 -0
- data/vendor/spidermonkey/jsdbgapi.c +1799 -0
- data/vendor/spidermonkey/jsdbgapi.h +464 -0
- data/vendor/spidermonkey/jsdhash.c +868 -0
- data/vendor/spidermonkey/jsdhash.h +592 -0
- data/vendor/spidermonkey/jsdtoa.c +3167 -0
- data/vendor/spidermonkey/jsdtoa.h +130 -0
- data/vendor/spidermonkey/jsdtracef.c +317 -0
- data/vendor/spidermonkey/jsdtracef.h +77 -0
- data/vendor/spidermonkey/jsemit.c +6909 -0
- data/vendor/spidermonkey/jsemit.h +741 -0
- data/vendor/spidermonkey/jsexn.c +1371 -0
- data/vendor/spidermonkey/jsexn.h +96 -0
- data/vendor/spidermonkey/jsfile.c +2736 -0
- data/vendor/spidermonkey/jsfile.h +56 -0
- data/vendor/spidermonkey/jsfile.msg +90 -0
- data/vendor/spidermonkey/jsfun.c +2634 -0
- data/vendor/spidermonkey/jsfun.h +254 -0
- data/vendor/spidermonkey/jsgc.c +3554 -0
- data/vendor/spidermonkey/jsgc.h +403 -0
- data/vendor/spidermonkey/jshash.c +476 -0
- data/vendor/spidermonkey/jshash.h +151 -0
- data/vendor/spidermonkey/jsify.pl +485 -0
- data/vendor/spidermonkey/jsinterp.c +6981 -0
- data/vendor/spidermonkey/jsinterp.h +521 -0
- data/vendor/spidermonkey/jsinvoke.c +43 -0
- data/vendor/spidermonkey/jsiter.c +1067 -0
- data/vendor/spidermonkey/jsiter.h +122 -0
- data/vendor/spidermonkey/jskeyword.tbl +124 -0
- data/vendor/spidermonkey/jskwgen.c +460 -0
- data/vendor/spidermonkey/jslibmath.h +266 -0
- data/vendor/spidermonkey/jslock.c +1309 -0
- data/vendor/spidermonkey/jslock.h +313 -0
- data/vendor/spidermonkey/jslocko.asm +60 -0
- data/vendor/spidermonkey/jslog2.c +94 -0
- data/vendor/spidermonkey/jslong.c +264 -0
- data/vendor/spidermonkey/jslong.h +412 -0
- data/vendor/spidermonkey/jsmath.c +568 -0
- data/vendor/spidermonkey/jsmath.h +57 -0
- data/vendor/spidermonkey/jsnum.c +1228 -0
- data/vendor/spidermonkey/jsnum.h +283 -0
- data/vendor/spidermonkey/jsobj.c +5266 -0
- data/vendor/spidermonkey/jsobj.h +709 -0
- data/vendor/spidermonkey/jsopcode.c +5245 -0
- data/vendor/spidermonkey/jsopcode.h +394 -0
- data/vendor/spidermonkey/jsopcode.tbl +523 -0
- data/vendor/spidermonkey/jsotypes.h +202 -0
- data/vendor/spidermonkey/jsparse.c +6680 -0
- data/vendor/spidermonkey/jsparse.h +511 -0
- data/vendor/spidermonkey/jsprf.c +1262 -0
- data/vendor/spidermonkey/jsprf.h +150 -0
- data/vendor/spidermonkey/jsproto.tbl +128 -0
- data/vendor/spidermonkey/jsprvtd.h +267 -0
- data/vendor/spidermonkey/jspubtd.h +744 -0
- data/vendor/spidermonkey/jsregexp.c +4352 -0
- data/vendor/spidermonkey/jsregexp.h +183 -0
- data/vendor/spidermonkey/jsreops.tbl +145 -0
- data/vendor/spidermonkey/jsscan.c +2003 -0
- data/vendor/spidermonkey/jsscan.h +387 -0
- data/vendor/spidermonkey/jsscope.c +1948 -0
- data/vendor/spidermonkey/jsscope.h +418 -0
- data/vendor/spidermonkey/jsscript.c +1832 -0
- data/vendor/spidermonkey/jsscript.h +287 -0
- data/vendor/spidermonkey/jsshell.msg +50 -0
- data/vendor/spidermonkey/jsstddef.h +83 -0
- data/vendor/spidermonkey/jsstr.c +5004 -0
- data/vendor/spidermonkey/jsstr.h +641 -0
- data/vendor/spidermonkey/jstypes.h +475 -0
- data/vendor/spidermonkey/jsutil.c +345 -0
- data/vendor/spidermonkey/jsutil.h +157 -0
- data/vendor/spidermonkey/jsxdrapi.c +800 -0
- data/vendor/spidermonkey/jsxdrapi.h +218 -0
- data/vendor/spidermonkey/jsxml.c +8471 -0
- data/vendor/spidermonkey/jsxml.h +349 -0
- data/vendor/spidermonkey/lock_SunOS.s +119 -0
- data/vendor/spidermonkey/perfect.js +39 -0
- data/vendor/spidermonkey/plify_jsdhash.sed +36 -0
- data/vendor/spidermonkey/prmjtime.c +846 -0
- data/vendor/spidermonkey/prmjtime.h +103 -0
- data/vendor/spidermonkey/resource.h +15 -0
- data/vendor/spidermonkey/rules.mk +197 -0
- data/vendor/spidermonkey/win32.order +384 -0
- metadata +4 -3
data/ext/spidermonkey/runtime.c
CHANGED
@@ -284,7 +284,7 @@ static void deallocate(JohnsonRuntime* runtime)
|
|
284
284
|
|
285
285
|
static VALUE allocate(VALUE klass)
|
286
286
|
{
|
287
|
-
JohnsonRuntime* runtime = calloc(
|
287
|
+
JohnsonRuntime* runtime = calloc(1L, sizeof(JohnsonRuntime));
|
288
288
|
return Data_Wrap_Struct(klass, 0, deallocate, runtime);
|
289
289
|
}
|
290
290
|
|
data/johnson.gemspec
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = %q{johnson}
|
3
|
+
s.version = "1.0.0.200807291507"
|
4
|
+
|
5
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
6
|
+
s.authors = ["John Barnette", "Aaron Patterson", "Yehuda Katz", "Matthew Draper"]
|
7
|
+
s.date = %q{2008-07-29}
|
8
|
+
s.default_executable = %q{johnson}
|
9
|
+
s.description = %q{Johnson wraps JavaScript in a loving Ruby embrace.}
|
10
|
+
s.email = %q{johnson-talk@googlegroups.com}
|
11
|
+
s.executables = ["johnson"]
|
12
|
+
s.extensions = ["Rakefile"]
|
13
|
+
s.extra_rdoc_files = ["README.rdoc", "cross-compile.txt"]
|
14
|
+
s.files = ["CHANGELOG", "MANIFEST", "MINGW32.mk", "README.rdoc", "Rakefile", "bin/johnson", "cross-compile.txt", "ext/spidermonkey/context.c", "ext/spidermonkey/context.h", "ext/spidermonkey/conversions.c", "ext/spidermonkey/conversions.h", "ext/spidermonkey/debugger.c", "ext/spidermonkey/debugger.h", "ext/spidermonkey/extconf.rb", "ext/spidermonkey/extensions.c", "ext/spidermonkey/extensions.h", "ext/spidermonkey/global.c", "ext/spidermonkey/global.h", "ext/spidermonkey/idhash.c", "ext/spidermonkey/idhash.h", "ext/spidermonkey/immutable_node.c", "ext/spidermonkey/immutable_node.c.erb", "ext/spidermonkey/immutable_node.h", "ext/spidermonkey/jroot.h", "ext/spidermonkey/js_land_proxy.c", "ext/spidermonkey/js_land_proxy.h", "ext/spidermonkey/ruby_land_proxy.c", "ext/spidermonkey/ruby_land_proxy.h", "ext/spidermonkey/runtime.c", "ext/spidermonkey/runtime.h", "ext/spidermonkey/spidermonkey.c", "ext/spidermonkey/spidermonkey.h", "johnson.gemspec", "js/johnson/browser.js", "js/johnson/browser/env.js", "js/johnson/browser/jquery.js", "js/johnson/browser/xmlsax.js", "js/johnson/browser/xmlw3cdom.js", "js/johnson/cli.js", "js/johnson/prelude.js", "js/johnson/template.js", "lib/hoe.rb", "lib/johnson.rb", "lib/johnson/cli.rb", "lib/johnson/cli/options.rb", "lib/johnson/error.rb", "lib/johnson/nodes.rb", "lib/johnson/nodes/binary_node.rb", "lib/johnson/nodes/for.rb", "lib/johnson/nodes/for_in.rb", "lib/johnson/nodes/function.rb", "lib/johnson/nodes/list.rb", "lib/johnson/nodes/node.rb", "lib/johnson/nodes/ternary_node.rb", "lib/johnson/parser.rb", "lib/johnson/parser/syntax_error.rb", "lib/johnson/runtime.rb", "lib/johnson/spidermonkey/context.rb", "lib/johnson/spidermonkey/debugger.rb", "lib/johnson/spidermonkey/immutable_node.rb", "lib/johnson/spidermonkey/js_land_proxy.rb", "lib/johnson/spidermonkey/mutable_tree_visitor.rb", "lib/johnson/spidermonkey/ruby_land_proxy.rb", "lib/johnson/spidermonkey/runtime.rb", "lib/johnson/version.rb", "lib/johnson/visitable.rb", "lib/johnson/visitors.rb", "lib/johnson/visitors/dot_visitor.rb", "lib/johnson/visitors/ecma_visitor.rb", "lib/johnson/visitors/enumerating_visitor.rb", "lib/johnson/visitors/sexp_visitor.rb", "lib/rails/init.rb", "test/assets/index.html", "test/assets/jquery_test.html", "test/helper.rb", "test/johnson/browser_test.rb", "test/johnson/conversions/array_test.rb", "test/johnson/conversions/boolean_test.rb", "test/johnson/conversions/callable_test.rb", "test/johnson/conversions/file_test.rb", "test/johnson/conversions/nil_test.rb", "test/johnson/conversions/number_test.rb", "test/johnson/conversions/regexp_test.rb", "test/johnson/conversions/string_test.rb", "test/johnson/conversions/struct_test.rb", "test/johnson/conversions/symbol_test.rb", "test/johnson/conversions/thread_test.rb", "test/johnson/error_test.rb", "test/johnson/extensions_test.rb", "test/johnson/nodes/array_literal_test.rb", "test/johnson/nodes/array_node_test.rb", "test/johnson/nodes/binary_node_test.rb", "test/johnson/nodes/bracket_access_test.rb", "test/johnson/nodes/delete_test.rb", "test/johnson/nodes/do_while_test.rb", "test/johnson/nodes/dot_accessor_test.rb", "test/johnson/nodes/export_test.rb", "test/johnson/nodes/for_test.rb", "test/johnson/nodes/function_test.rb", "test/johnson/nodes/if_test.rb", "test/johnson/nodes/import_test.rb", "test/johnson/nodes/label_test.rb", "test/johnson/nodes/object_literal_test.rb", "test/johnson/nodes/return_test.rb", "test/johnson/nodes/semi_test.rb", "test/johnson/nodes/switch_test.rb", "test/johnson/nodes/ternary_test.rb", "test/johnson/nodes/throw_test.rb", "test/johnson/nodes/try_node_test.rb", "test/johnson/nodes/typeof_test.rb", "test/johnson/nodes/unary_node_test.rb", "test/johnson/nodes/void_test.rb", "test/johnson/nodes/while_test.rb", "test/johnson/nodes/with_test.rb", "test/johnson/prelude_test.rb", "test/johnson/runtime_test.rb", "test/johnson/spidermonkey/context_test.rb", "test/johnson/spidermonkey/immutable_node_test.rb", "test/johnson/spidermonkey/js_land_proxy_test.rb", "test/johnson/spidermonkey/ruby_land_proxy_test.rb", "test/johnson/spidermonkey/runtime_test.rb", "test/johnson/version_test.rb", "test/johnson/visitors/dot_visitor_test.rb", "test/johnson/visitors/enumerating_visitor_test.rb", "test/johnson_test.rb", "test/jquery_units/test.js", "test/jquery_units/test_helper.js", "test/jquery_units/units/ajax.js", "test/jquery_units/units/core.js", "test/jquery_units/units/event.js", "test/jquery_units/units/fx.js", "test/jquery_units/units/offset.js", "test/jquery_units/units/selector.js", "test/jspec/helper.js", "test/jspec/jspec.js", "test/jspec/simple_spec.js", "test/parser_test.rb", "todo/.keep", "vendor/spidermonkey/.cvsignore", "vendor/spidermonkey/Makefile.in", "vendor/spidermonkey/Makefile.ref", "vendor/spidermonkey/README.html", "vendor/spidermonkey/SpiderMonkey.rsp", "vendor/spidermonkey/Y.js", "vendor/spidermonkey/build.mk", "vendor/spidermonkey/config.mk", "vendor/spidermonkey/config/AIX4.1.mk", "vendor/spidermonkey/config/AIX4.2.mk", "vendor/spidermonkey/config/AIX4.3.mk", "vendor/spidermonkey/config/Darwin.mk", "vendor/spidermonkey/config/Darwin1.3.mk", "vendor/spidermonkey/config/Darwin1.4.mk", "vendor/spidermonkey/config/Darwin5.2.mk", "vendor/spidermonkey/config/Darwin5.3.mk", "vendor/spidermonkey/config/HP-UXB.10.10.mk", "vendor/spidermonkey/config/HP-UXB.10.20.mk", "vendor/spidermonkey/config/HP-UXB.11.00.mk", "vendor/spidermonkey/config/IRIX.mk", "vendor/spidermonkey/config/IRIX5.3.mk", "vendor/spidermonkey/config/IRIX6.1.mk", "vendor/spidermonkey/config/IRIX6.2.mk", "vendor/spidermonkey/config/IRIX6.3.mk", "vendor/spidermonkey/config/IRIX6.5.mk", "vendor/spidermonkey/config/Linux_All.mk", "vendor/spidermonkey/config/Mac_OS10.0.mk", "vendor/spidermonkey/config/OSF1V4.0.mk", "vendor/spidermonkey/config/OSF1V5.0.mk", "vendor/spidermonkey/config/SunOS4.1.4.mk", "vendor/spidermonkey/config/SunOS5.10.mk", "vendor/spidermonkey/config/SunOS5.3.mk", "vendor/spidermonkey/config/SunOS5.4.mk", "vendor/spidermonkey/config/SunOS5.5.1.mk", "vendor/spidermonkey/config/SunOS5.5.mk", "vendor/spidermonkey/config/SunOS5.6.mk", "vendor/spidermonkey/config/SunOS5.7.mk", "vendor/spidermonkey/config/SunOS5.8.mk", "vendor/spidermonkey/config/SunOS5.9.mk", "vendor/spidermonkey/config/WINNT4.0.mk", "vendor/spidermonkey/config/WINNT5.0.mk", "vendor/spidermonkey/config/WINNT5.1.mk", "vendor/spidermonkey/config/WINNT5.2.mk", "vendor/spidermonkey/config/WINNT6.0.mk", "vendor/spidermonkey/config/dgux.mk", "vendor/spidermonkey/editline/Makefile.ref", "vendor/spidermonkey/editline/README", "vendor/spidermonkey/editline/editline.3", "vendor/spidermonkey/editline/editline.c", "vendor/spidermonkey/editline/editline.h", "vendor/spidermonkey/editline/sysunix.c", "vendor/spidermonkey/editline/unix.h", "vendor/spidermonkey/fdlibm/.cvsignore", "vendor/spidermonkey/fdlibm/Makefile.in", "vendor/spidermonkey/fdlibm/Makefile.ref", "vendor/spidermonkey/fdlibm/e_acos.c", "vendor/spidermonkey/fdlibm/e_acosh.c", "vendor/spidermonkey/fdlibm/e_asin.c", "vendor/spidermonkey/fdlibm/e_atan2.c", "vendor/spidermonkey/fdlibm/e_atanh.c", "vendor/spidermonkey/fdlibm/e_cosh.c", "vendor/spidermonkey/fdlibm/e_exp.c", "vendor/spidermonkey/fdlibm/e_fmod.c", "vendor/spidermonkey/fdlibm/e_gamma.c", "vendor/spidermonkey/fdlibm/e_gamma_r.c", "vendor/spidermonkey/fdlibm/e_hypot.c", "vendor/spidermonkey/fdlibm/e_j0.c", "vendor/spidermonkey/fdlibm/e_j1.c", "vendor/spidermonkey/fdlibm/e_jn.c", "vendor/spidermonkey/fdlibm/e_lgamma.c", "vendor/spidermonkey/fdlibm/e_lgamma_r.c", "vendor/spidermonkey/fdlibm/e_log.c", "vendor/spidermonkey/fdlibm/e_log10.c", "vendor/spidermonkey/fdlibm/e_pow.c", "vendor/spidermonkey/fdlibm/e_rem_pio2.c", "vendor/spidermonkey/fdlibm/e_remainder.c", "vendor/spidermonkey/fdlibm/e_scalb.c", "vendor/spidermonkey/fdlibm/e_sinh.c", "vendor/spidermonkey/fdlibm/e_sqrt.c", "vendor/spidermonkey/fdlibm/fdlibm.h", "vendor/spidermonkey/fdlibm/fdlibm.mak", "vendor/spidermonkey/fdlibm/fdlibm.mdp", "vendor/spidermonkey/fdlibm/k_cos.c", "vendor/spidermonkey/fdlibm/k_rem_pio2.c", "vendor/spidermonkey/fdlibm/k_sin.c", "vendor/spidermonkey/fdlibm/k_standard.c", "vendor/spidermonkey/fdlibm/k_tan.c", "vendor/spidermonkey/fdlibm/s_asinh.c", "vendor/spidermonkey/fdlibm/s_atan.c", "vendor/spidermonkey/fdlibm/s_cbrt.c", "vendor/spidermonkey/fdlibm/s_ceil.c", "vendor/spidermonkey/fdlibm/s_copysign.c", "vendor/spidermonkey/fdlibm/s_cos.c", "vendor/spidermonkey/fdlibm/s_erf.c", "vendor/spidermonkey/fdlibm/s_expm1.c", "vendor/spidermonkey/fdlibm/s_fabs.c", "vendor/spidermonkey/fdlibm/s_finite.c", "vendor/spidermonkey/fdlibm/s_floor.c", "vendor/spidermonkey/fdlibm/s_frexp.c", "vendor/spidermonkey/fdlibm/s_ilogb.c", "vendor/spidermonkey/fdlibm/s_isnan.c", "vendor/spidermonkey/fdlibm/s_ldexp.c", "vendor/spidermonkey/fdlibm/s_lib_version.c", "vendor/spidermonkey/fdlibm/s_log1p.c", "vendor/spidermonkey/fdlibm/s_logb.c", "vendor/spidermonkey/fdlibm/s_matherr.c", "vendor/spidermonkey/fdlibm/s_modf.c", "vendor/spidermonkey/fdlibm/s_nextafter.c", "vendor/spidermonkey/fdlibm/s_rint.c", "vendor/spidermonkey/fdlibm/s_scalbn.c", "vendor/spidermonkey/fdlibm/s_signgam.c", "vendor/spidermonkey/fdlibm/s_significand.c", "vendor/spidermonkey/fdlibm/s_sin.c", "vendor/spidermonkey/fdlibm/s_tan.c", "vendor/spidermonkey/fdlibm/s_tanh.c", "vendor/spidermonkey/fdlibm/w_acos.c", "vendor/spidermonkey/fdlibm/w_acosh.c", "vendor/spidermonkey/fdlibm/w_asin.c", "vendor/spidermonkey/fdlibm/w_atan2.c", "vendor/spidermonkey/fdlibm/w_atanh.c", "vendor/spidermonkey/fdlibm/w_cosh.c", "vendor/spidermonkey/fdlibm/w_exp.c", "vendor/spidermonkey/fdlibm/w_fmod.c", "vendor/spidermonkey/fdlibm/w_gamma.c", "vendor/spidermonkey/fdlibm/w_gamma_r.c", "vendor/spidermonkey/fdlibm/w_hypot.c", "vendor/spidermonkey/fdlibm/w_j0.c", "vendor/spidermonkey/fdlibm/w_j1.c", "vendor/spidermonkey/fdlibm/w_jn.c", "vendor/spidermonkey/fdlibm/w_lgamma.c", "vendor/spidermonkey/fdlibm/w_lgamma_r.c", "vendor/spidermonkey/fdlibm/w_log.c", "vendor/spidermonkey/fdlibm/w_log10.c", "vendor/spidermonkey/fdlibm/w_pow.c", "vendor/spidermonkey/fdlibm/w_remainder.c", "vendor/spidermonkey/fdlibm/w_scalb.c", "vendor/spidermonkey/fdlibm/w_sinh.c", "vendor/spidermonkey/fdlibm/w_sqrt.c", "vendor/spidermonkey/javascript-trace.d", "vendor/spidermonkey/js.c", "vendor/spidermonkey/js.mak", "vendor/spidermonkey/js.mdp", "vendor/spidermonkey/js.msg", "vendor/spidermonkey/js.pkg", "vendor/spidermonkey/js3240.rc", "vendor/spidermonkey/jsOS240.def", "vendor/spidermonkey/jsapi.c", "vendor/spidermonkey/jsapi.h", "vendor/spidermonkey/jsarena.c", "vendor/spidermonkey/jsarena.h", "vendor/spidermonkey/jsarray.c", "vendor/spidermonkey/jsarray.h", "vendor/spidermonkey/jsatom.c", "vendor/spidermonkey/jsatom.h", "vendor/spidermonkey/jsbit.h", "vendor/spidermonkey/jsbool.c", "vendor/spidermonkey/jsbool.h", "vendor/spidermonkey/jsclist.h", "vendor/spidermonkey/jscntxt.c", "vendor/spidermonkey/jscntxt.h", "vendor/spidermonkey/jscompat.h", "vendor/spidermonkey/jsconfig.h", "vendor/spidermonkey/jsconfig.mk", "vendor/spidermonkey/jscpucfg.c", "vendor/spidermonkey/jscpucfg.h", "vendor/spidermonkey/jsdate.c", "vendor/spidermonkey/jsdate.h", "vendor/spidermonkey/jsdbgapi.c", "vendor/spidermonkey/jsdbgapi.h", "vendor/spidermonkey/jsdhash.c", "vendor/spidermonkey/jsdhash.h", "vendor/spidermonkey/jsdtoa.c", "vendor/spidermonkey/jsdtoa.h", "vendor/spidermonkey/jsdtracef.c", "vendor/spidermonkey/jsdtracef.h", "vendor/spidermonkey/jsemit.c", "vendor/spidermonkey/jsemit.h", "vendor/spidermonkey/jsexn.c", "vendor/spidermonkey/jsexn.h", "vendor/spidermonkey/jsfile.c", "vendor/spidermonkey/jsfile.h", "vendor/spidermonkey/jsfile.msg", "vendor/spidermonkey/jsfun.c", "vendor/spidermonkey/jsfun.h", "vendor/spidermonkey/jsgc.c", "vendor/spidermonkey/jsgc.h", "vendor/spidermonkey/jshash.c", "vendor/spidermonkey/jshash.h", "vendor/spidermonkey/jsify.pl", "vendor/spidermonkey/jsinterp.c", "vendor/spidermonkey/jsinterp.h", "vendor/spidermonkey/jsinvoke.c", "vendor/spidermonkey/jsiter.c", "vendor/spidermonkey/jsiter.h", "vendor/spidermonkey/jskeyword.tbl", "vendor/spidermonkey/jskwgen.c", "vendor/spidermonkey/jslibmath.h", "vendor/spidermonkey/jslock.c", "vendor/spidermonkey/jslock.h", "vendor/spidermonkey/jslocko.asm", "vendor/spidermonkey/jslog2.c", "vendor/spidermonkey/jslong.c", "vendor/spidermonkey/jslong.h", "vendor/spidermonkey/jsmath.c", "vendor/spidermonkey/jsmath.h", "vendor/spidermonkey/jsnum.c", "vendor/spidermonkey/jsnum.h", "vendor/spidermonkey/jsobj.c", "vendor/spidermonkey/jsobj.h", "vendor/spidermonkey/jsopcode.c", "vendor/spidermonkey/jsopcode.h", "vendor/spidermonkey/jsopcode.tbl", "vendor/spidermonkey/jsotypes.h", "vendor/spidermonkey/jsparse.c", "vendor/spidermonkey/jsparse.h", "vendor/spidermonkey/jsprf.c", "vendor/spidermonkey/jsprf.h", "vendor/spidermonkey/jsproto.tbl", "vendor/spidermonkey/jsprvtd.h", "vendor/spidermonkey/jspubtd.h", "vendor/spidermonkey/jsregexp.c", "vendor/spidermonkey/jsregexp.h", "vendor/spidermonkey/jsreops.tbl", "vendor/spidermonkey/jsscan.c", "vendor/spidermonkey/jsscan.h", "vendor/spidermonkey/jsscope.c", "vendor/spidermonkey/jsscope.h", "vendor/spidermonkey/jsscript.c", "vendor/spidermonkey/jsscript.h", "vendor/spidermonkey/jsshell.msg", "vendor/spidermonkey/jsstddef.h", "vendor/spidermonkey/jsstr.c", "vendor/spidermonkey/jsstr.h", "vendor/spidermonkey/jstypes.h", "vendor/spidermonkey/jsutil.c", "vendor/spidermonkey/jsutil.h", "vendor/spidermonkey/jsxdrapi.c", "vendor/spidermonkey/jsxdrapi.h", "vendor/spidermonkey/jsxml.c", "vendor/spidermonkey/jsxml.h", "vendor/spidermonkey/lock_SunOS.s", "vendor/spidermonkey/perfect.js", "vendor/spidermonkey/plify_jsdhash.sed", "vendor/spidermonkey/prmjtime.c", "vendor/spidermonkey/prmjtime.h", "vendor/spidermonkey/resource.h", "vendor/spidermonkey/rules.mk", "vendor/spidermonkey/win32.order"]
|
15
|
+
s.has_rdoc = true
|
16
|
+
s.homepage = %q{http://github.com/jbarnette/johnson/wikis}
|
17
|
+
s.rdoc_options = ["--main", "README.rdoc"]
|
18
|
+
s.require_paths = ["lib", "ext"]
|
19
|
+
s.rubyforge_project = %q{johnson}
|
20
|
+
s.rubygems_version = %q{1.2.0}
|
21
|
+
s.summary = %q{Johnson wraps JavaScript in a loving Ruby embrace.}
|
22
|
+
s.test_files = ["test/johnson/browser_test.rb", "test/johnson/conversions/array_test.rb", "test/johnson/conversions/boolean_test.rb", "test/johnson/conversions/callable_test.rb", "test/johnson/conversions/file_test.rb", "test/johnson/conversions/nil_test.rb", "test/johnson/conversions/number_test.rb", "test/johnson/conversions/regexp_test.rb", "test/johnson/conversions/string_test.rb", "test/johnson/conversions/struct_test.rb", "test/johnson/conversions/symbol_test.rb", "test/johnson/conversions/thread_test.rb", "test/johnson/error_test.rb", "test/johnson/extensions_test.rb", "test/johnson/nodes/array_literal_test.rb", "test/johnson/nodes/array_node_test.rb", "test/johnson/nodes/binary_node_test.rb", "test/johnson/nodes/bracket_access_test.rb", "test/johnson/nodes/delete_test.rb", "test/johnson/nodes/do_while_test.rb", "test/johnson/nodes/dot_accessor_test.rb", "test/johnson/nodes/export_test.rb", "test/johnson/nodes/for_test.rb", "test/johnson/nodes/function_test.rb", "test/johnson/nodes/if_test.rb", "test/johnson/nodes/import_test.rb", "test/johnson/nodes/label_test.rb", "test/johnson/nodes/object_literal_test.rb", "test/johnson/nodes/return_test.rb", "test/johnson/nodes/semi_test.rb", "test/johnson/nodes/switch_test.rb", "test/johnson/nodes/ternary_test.rb", "test/johnson/nodes/throw_test.rb", "test/johnson/nodes/try_node_test.rb", "test/johnson/nodes/typeof_test.rb", "test/johnson/nodes/unary_node_test.rb", "test/johnson/nodes/void_test.rb", "test/johnson/nodes/while_test.rb", "test/johnson/nodes/with_test.rb", "test/johnson/prelude_test.rb", "test/johnson/runtime_test.rb", "test/johnson/spidermonkey/context_test.rb", "test/johnson/spidermonkey/immutable_node_test.rb", "test/johnson/spidermonkey/js_land_proxy_test.rb", "test/johnson/spidermonkey/ruby_land_proxy_test.rb", "test/johnson/spidermonkey/runtime_test.rb", "test/johnson/version_test.rb", "test/johnson/visitors/dot_visitor_test.rb", "test/johnson/visitors/enumerating_visitor_test.rb", "test/johnson_test.rb", "test/parser_test.rb"]
|
23
|
+
|
24
|
+
if s.respond_to? :specification_version then
|
25
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
26
|
+
s.specification_version = 2
|
27
|
+
|
28
|
+
if current_version >= 3 then
|
29
|
+
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
30
|
+
else
|
31
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
32
|
+
end
|
33
|
+
else
|
34
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
35
|
+
end
|
36
|
+
end
|
data/lib/hoe.rb
CHANGED
@@ -429,13 +429,6 @@ class Hoe #:nodoc:
|
|
429
429
|
puts spec.to_ruby
|
430
430
|
end
|
431
431
|
|
432
|
-
desc "Generate #{name}.gemspec"
|
433
|
-
task :gemspec do
|
434
|
-
File.open("#{name}.gemspec", "w") do |f|
|
435
|
-
f.write spec.to_ruby
|
436
|
-
end
|
437
|
-
end
|
438
|
-
|
439
432
|
self.lib_files = spec.files.grep(/^(lib|ext)/)
|
440
433
|
self.bin_files = spec.files.grep(/^bin/)
|
441
434
|
self.test_files = spec.files.grep(/^test/)
|
data/lib/johnson/cli/options.rb
CHANGED
@@ -7,13 +7,19 @@ module Johnson #:nodoc:
|
|
7
7
|
alias_method :parse!, :new
|
8
8
|
end
|
9
9
|
|
10
|
-
attr_reader :
|
10
|
+
attr_reader :arguments
|
11
|
+
attr_reader :expressions
|
12
|
+
attr_reader :files_to_preload
|
13
|
+
attr_reader :file_to_evaluate
|
14
|
+
attr_reader :load_paths
|
15
|
+
attr_reader :paths_to_require
|
11
16
|
|
12
17
|
def initialize(*args)
|
13
18
|
argv = args.flatten
|
14
19
|
@expressions = []
|
15
20
|
@load_paths = []
|
16
21
|
@files_to_preload = []
|
22
|
+
@paths_to_require = []
|
17
23
|
|
18
24
|
parser = OptionParser.new do |parser|
|
19
25
|
parser.banner = "Usage: johnson [options] [file.js] [-- jsargs]"
|
@@ -30,9 +36,9 @@ module Johnson #:nodoc:
|
|
30
36
|
parser.on("-i [FILE]", "Evaluate [FILE] before interaction") do |file|
|
31
37
|
@files_to_preload << file
|
32
38
|
end
|
33
|
-
|
34
|
-
parser.on("-
|
35
|
-
@
|
39
|
+
|
40
|
+
parser.on("-r [PATH]", "Require [PATH] before executing") do |path|
|
41
|
+
@paths_to_require << path
|
36
42
|
end
|
37
43
|
|
38
44
|
parser.on("-h", "-?", "--help", "Show this message") do
|
data/lib/johnson/version.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
module Johnson #:nodoc:
|
2
|
-
|
3
|
-
|
2
|
+
major, minor, tiny = 1, 0, 0
|
3
|
+
nano = ENV['RELEASE'] ? nil : Time.now.strftime("%Y%m%d%H%M")
|
4
|
+
|
5
|
+
VERSION = [major, minor, tiny, nano].compact.join('.').freeze
|
4
6
|
end
|
data/lib/johnson.rb
CHANGED
@@ -42,5 +42,16 @@ module Johnson
|
|
42
42
|
assert_equal(10, break_times)
|
43
43
|
assert_equal(2, @runtime['some_number'])
|
44
44
|
end
|
45
|
+
|
46
|
+
#def test_try_to_gc
|
47
|
+
# 10.times {
|
48
|
+
# thread = Thread.new do
|
49
|
+
# rt = Johnson::Runtime.new
|
50
|
+
# rt.evaluate('new Date()').to_s
|
51
|
+
# end
|
52
|
+
# thread.join
|
53
|
+
# GC.start
|
54
|
+
# }
|
55
|
+
#end
|
45
56
|
end
|
46
57
|
end
|
@@ -21,6 +21,12 @@ module Johnson
|
|
21
21
|
@runtime["y"] = proxy
|
22
22
|
assert(@runtime.evaluate("x === y"))
|
23
23
|
end
|
24
|
+
|
25
|
+
def test_reponds_to?
|
26
|
+
proxy = @runtime.evaluate("x = {}")
|
27
|
+
assert ! proxy.respond_to?(:foo)
|
28
|
+
assert ! proxy.respond_to?("foo")
|
29
|
+
end
|
24
30
|
|
25
31
|
def test_array_indexable
|
26
32
|
proxy = @runtime.evaluate("var x = [1,2,3]; x")
|
@@ -0,0 +1,462 @@
|
|
1
|
+
# -*- Mode: makefile -*-
|
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 of the GNU General Public License Version 2 or later (the "GPL"),
|
28
|
+
# or 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
|
+
DEPTH = ../..
|
41
|
+
topsrcdir = @top_srcdir@
|
42
|
+
srcdir = @srcdir@
|
43
|
+
VPATH = @srcdir@
|
44
|
+
|
45
|
+
include $(DEPTH)/config/autoconf.mk
|
46
|
+
|
47
|
+
MODULE = js
|
48
|
+
LIBRARY_NAME = mozjs
|
49
|
+
LIB_IS_C_ONLY = 1
|
50
|
+
GRE_MODULE = 1
|
51
|
+
|
52
|
+
ifdef GNU_CC
|
53
|
+
ifdef INTEL_CC
|
54
|
+
# icc gets special optimize flags
|
55
|
+
ifdef MOZ_PROFILE_GENERATE
|
56
|
+
MODULE_OPTIMIZE_FLAGS = -O0
|
57
|
+
else
|
58
|
+
MODULE_OPTIMIZE_FLAGS = -O2 -ip
|
59
|
+
#XXX: do we want different INTERP_OPTIMIZER flags here?
|
60
|
+
endif
|
61
|
+
else
|
62
|
+
MODULE_OPTIMIZE_FLAGS = -Os -fstrict-aliasing $(MOZ_OPTIMIZE_SIZE_TWEAK)
|
63
|
+
# Special optimization flags for jsinterp.c
|
64
|
+
INTERP_OPTIMIZER = -O3 -fstrict-aliasing
|
65
|
+
endif
|
66
|
+
else
|
67
|
+
ifeq ($(OS_ARCH),SunOS)
|
68
|
+
MODULE_OPTIMIZE_FLAGS = -xO4
|
69
|
+
endif
|
70
|
+
ifeq ($(OS_ARCH),WINNT)
|
71
|
+
MODULE_OPTIMIZE_FLAGS = -O2 -GL
|
72
|
+
endif
|
73
|
+
endif
|
74
|
+
|
75
|
+
ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
|
76
|
+
LIBRARY_NAME = js$(MOZ_BITS)$(VERSION_NUMBER)
|
77
|
+
RESFILE = js$(MOZ_BITS)40.res
|
78
|
+
endif
|
79
|
+
|
80
|
+
PACKAGE_FILE = js.pkg
|
81
|
+
|
82
|
+
# JavaScript must be built shared, even for static builds, as it is used by
|
83
|
+
# other modules which are always built shared. Failure to do so results in
|
84
|
+
# the js code getting copied into xpinstall and jsd as well as mozilla-bin,
|
85
|
+
# and then the static data cells used for locking no longer work.
|
86
|
+
|
87
|
+
ifndef JS_STATIC_BUILD
|
88
|
+
FORCE_SHARED_LIB = 1
|
89
|
+
endif
|
90
|
+
|
91
|
+
CSRCS = \
|
92
|
+
jsapi.c \
|
93
|
+
jsarena.c \
|
94
|
+
jsarray.c \
|
95
|
+
jsatom.c \
|
96
|
+
jsbool.c \
|
97
|
+
jscntxt.c \
|
98
|
+
jsdate.c \
|
99
|
+
jsdbgapi.c \
|
100
|
+
jsdhash.c \
|
101
|
+
jsdtoa.c \
|
102
|
+
jsemit.c \
|
103
|
+
jsexn.c \
|
104
|
+
jsfun.c \
|
105
|
+
jsgc.c \
|
106
|
+
jshash.c \
|
107
|
+
jsinterp.c \
|
108
|
+
jsinvoke.c \
|
109
|
+
jsiter.c \
|
110
|
+
jslock.c \
|
111
|
+
jslog2.c \
|
112
|
+
jslong.c \
|
113
|
+
jsmath.c \
|
114
|
+
jsnum.c \
|
115
|
+
jsobj.c \
|
116
|
+
jsopcode.c \
|
117
|
+
jsparse.c \
|
118
|
+
jsprf.c \
|
119
|
+
jsregexp.c \
|
120
|
+
jsscan.c \
|
121
|
+
jsscope.c \
|
122
|
+
jsscript.c \
|
123
|
+
jsstr.c \
|
124
|
+
jsutil.c \
|
125
|
+
jsxdrapi.c \
|
126
|
+
jsxml.c \
|
127
|
+
prmjtime.c \
|
128
|
+
$(NULL)
|
129
|
+
|
130
|
+
ifdef HAVE_DTRACE
|
131
|
+
CSRCS += \
|
132
|
+
jsdtracef.c
|
133
|
+
endif
|
134
|
+
|
135
|
+
EXPORTS = \
|
136
|
+
jsautocfg.h \
|
137
|
+
jsautokw.h \
|
138
|
+
js.msg \
|
139
|
+
jsapi.h \
|
140
|
+
jsarray.h \
|
141
|
+
jsarena.h \
|
142
|
+
jsatom.h \
|
143
|
+
jsbit.h \
|
144
|
+
jsbool.h \
|
145
|
+
jsclist.h \
|
146
|
+
jscntxt.h \
|
147
|
+
jscompat.h \
|
148
|
+
jsconfig.h \
|
149
|
+
jsdate.h \
|
150
|
+
jsdbgapi.h \
|
151
|
+
jsdhash.h \
|
152
|
+
jsdtoa.h \
|
153
|
+
jsemit.h \
|
154
|
+
jsfun.h \
|
155
|
+
jsgc.h \
|
156
|
+
jshash.h \
|
157
|
+
jsinterp.h \
|
158
|
+
jsiter.h \
|
159
|
+
jslock.h \
|
160
|
+
jslong.h \
|
161
|
+
jsmath.h \
|
162
|
+
jsnum.h \
|
163
|
+
jsobj.h \
|
164
|
+
jsopcode.tbl \
|
165
|
+
jsopcode.h \
|
166
|
+
jsotypes.h \
|
167
|
+
jsparse.h \
|
168
|
+
jsprf.h \
|
169
|
+
jsproto.tbl \
|
170
|
+
jsprvtd.h \
|
171
|
+
jspubtd.h \
|
172
|
+
jsregexp.h \
|
173
|
+
jsscan.h \
|
174
|
+
jsscope.h \
|
175
|
+
jsscript.h \
|
176
|
+
jsstddef.h \
|
177
|
+
jsstr.h \
|
178
|
+
jstypes.h \
|
179
|
+
jsutil.h \
|
180
|
+
jsxdrapi.h \
|
181
|
+
jsxml.h \
|
182
|
+
$(NULL)
|
183
|
+
|
184
|
+
ifdef HAVE_DTRACE
|
185
|
+
EXPORTS += \
|
186
|
+
jsdtracef.h \
|
187
|
+
javascript-trace.h \
|
188
|
+
$(NULL)
|
189
|
+
endif
|
190
|
+
|
191
|
+
ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
|
192
|
+
EXPORTS += jscpucfg.h
|
193
|
+
endif
|
194
|
+
|
195
|
+
JS_SAFE_ARENA = 1
|
196
|
+
|
197
|
+
DASH_R = -r
|
198
|
+
|
199
|
+
ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH)))
|
200
|
+
SDK_LIBRARY = $(IMPORT_LIBRARY)
|
201
|
+
else
|
202
|
+
SDK_LIBRARY = $(SHARED_LIBRARY)
|
203
|
+
endif
|
204
|
+
|
205
|
+
include $(topsrcdir)/config/config.mk
|
206
|
+
|
207
|
+
EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
|
208
|
+
|
209
|
+
ifdef MOZ_MEMORY
|
210
|
+
ifeq ($(OS_ARCH),SunOS)
|
211
|
+
EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,jemalloc,$(DIST)/lib)
|
212
|
+
endif
|
213
|
+
endif
|
214
|
+
|
215
|
+
# When using gcc the assembly is inlined in the C-file (see jslock.c)
|
216
|
+
ifeq ($(OS_ARCH),SunOS)
|
217
|
+
ifneq (86,$(findstring 86,$(OS_TEST)))
|
218
|
+
ifndef GNU_CC
|
219
|
+
ASFILES = lock_$(OS_ARCH).s
|
220
|
+
endif
|
221
|
+
endif
|
222
|
+
endif
|
223
|
+
|
224
|
+
ifndef BUILD_OPT
|
225
|
+
MOCHAFILE = 1
|
226
|
+
endif
|
227
|
+
|
228
|
+
ifndef NSBUILDROOT
|
229
|
+
JSJAVA_STUBHEADERS = \
|
230
|
+
-I$(topsrcdir)/sun-java/include/_gen \
|
231
|
+
-I$(topsrcdir)/sun-java/netscape/javascript/_jri \
|
232
|
+
-I$(topsrcdir)/sun-java/netscape/security/_jri
|
233
|
+
else
|
234
|
+
JSJAVA_STUBHEADERS = -I$(JRI_GEN_DIR) -I$(JDK_GEN_DIR)
|
235
|
+
endif
|
236
|
+
|
237
|
+
JSJAVA_CFLAGS = \
|
238
|
+
-I$(topsrcdir)/sun-java/md-include \
|
239
|
+
-I$(topsrcdir)/sun-java/include \
|
240
|
+
$(JSJAVA_STUBHEADERS)
|
241
|
+
|
242
|
+
# Define keyword generator before rules.mk, see bug 323979 comment 50
|
243
|
+
|
244
|
+
HOST_SIMPLE_PROGRAMS += host_jskwgen$(HOST_BIN_SUFFIX)
|
245
|
+
GARBAGE += jsautokw.h host_jskwgen$(HOST_BIN_SUFFIX)
|
246
|
+
|
247
|
+
ifdef HAVE_DTRACE
|
248
|
+
ifneq ($(OS_ARCH),Darwin)
|
249
|
+
DTRACE_PROBE_OBJ = $(LIBRARY_NAME)-dtrace.$(OBJ_SUFFIX)
|
250
|
+
endif
|
251
|
+
MOZILLA_DTRACE_SRC = $(srcdir)/javascript-trace.d
|
252
|
+
endif
|
253
|
+
|
254
|
+
include $(topsrcdir)/config/rules.mk
|
255
|
+
|
256
|
+
DEFINES += -DEXPORT_JS_API
|
257
|
+
|
258
|
+
INCLUDES += -I$(srcdir)
|
259
|
+
|
260
|
+
# MSVC '-Gy' cc flag and '/OPT:REF' linker flag cause JS_GetArgument and
|
261
|
+
# JS_GetLocalVariable to be folded to the same address by the linker,
|
262
|
+
# leading to a crash on startup. See bug 151066. So, in optimized builds,
|
263
|
+
# add the /OPT:NOICF flag, which turns off 'identical COMDAT folding'.
|
264
|
+
#
|
265
|
+
# N.B.: 'identical COMDAT folding' that folds functions whose addresses
|
266
|
+
# are taken violates the ISO C and C++ standards.
|
267
|
+
ifndef MOZ_DEBUG
|
268
|
+
ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
|
269
|
+
LDFLAGS += -OPT:NOICF
|
270
|
+
endif
|
271
|
+
endif
|
272
|
+
|
273
|
+
GARBAGE += jscpucfg.o jsautocfg.h jsautocfg.tmp jscpucfg
|
274
|
+
|
275
|
+
ifneq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH)))
|
276
|
+
TARGETS += jscpucfg$(HOST_BIN_SUFFIX)
|
277
|
+
endif
|
278
|
+
|
279
|
+
ifdef JS_SAFE_ARENA
|
280
|
+
DEFINES += -DJS_USE_SAFE_ARENA
|
281
|
+
endif
|
282
|
+
|
283
|
+
ifdef JS_THREADSAFE
|
284
|
+
DEFINES += -DJS_THREADSAFE
|
285
|
+
endif
|
286
|
+
|
287
|
+
ifdef JS_NO_THIN_LOCKS
|
288
|
+
DEFINES += -DJS_USE_ONLY_NSPR_LOCKS
|
289
|
+
endif
|
290
|
+
|
291
|
+
ifdef JS_VERSION
|
292
|
+
DEFINES += -DJS_VERSION=$(JS_VERSION)
|
293
|
+
endif
|
294
|
+
|
295
|
+
ifneq ($(findstring -L,$(NSPR_LIBS)),)
|
296
|
+
NSPR_STATIC_PATH = $(subst -L,,$(findstring -L,$(NSPR_LIBS)))
|
297
|
+
else
|
298
|
+
NSPR_STATIC_PATH = $(DIST)/lib
|
299
|
+
endif
|
300
|
+
|
301
|
+
ifdef MOZ_SHARK
|
302
|
+
DEFINES += -DMOZ_SHARK
|
303
|
+
CFLAGS += -F/System/Library/PrivateFrameworks
|
304
|
+
LDFLAGS += -F/System/Library/PrivateFrameworks -framework CHUD
|
305
|
+
endif
|
306
|
+
|
307
|
+
LDFLAGS += $(pathsubst -l%,$(NSPR_STATIC_PATH)/%.a,$(NSPR_LIBS))
|
308
|
+
|
309
|
+
# BeOS and HP-UX do not require the extra linking of "-lm"
|
310
|
+
ifeq (,$(filter BeOS HP-UX WINNT WINCE OpenVMS,$(OS_ARCH)))
|
311
|
+
LDFLAGS += -lm
|
312
|
+
endif
|
313
|
+
|
314
|
+
# Prevent floating point errors caused by VC++ optimizations
|
315
|
+
ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
|
316
|
+
ifeq (,$(filter-out 1200 1300 1310,$(_MSC_VER)))
|
317
|
+
CFLAGS += -Op
|
318
|
+
else
|
319
|
+
CFLAGS += -fp:precise
|
320
|
+
endif
|
321
|
+
endif # WINNT
|
322
|
+
|
323
|
+
ifeq ($(OS_ARCH),FreeBSD)
|
324
|
+
LDFLAGS += -pthread
|
325
|
+
endif
|
326
|
+
ifeq ($(OS_ARCH),IRIX)
|
327
|
+
ifdef USE_N32
|
328
|
+
DASH_R += -n32
|
329
|
+
endif
|
330
|
+
endif
|
331
|
+
ifeq ($(OS_ARCH),Linux)
|
332
|
+
LDFLAGS += -ldl
|
333
|
+
endif
|
334
|
+
ifeq ($(OS_ARCH),OSF1)
|
335
|
+
LDFLAGS += -lc_r
|
336
|
+
endif
|
337
|
+
ifeq ($(OS_ARCH),SunOS)
|
338
|
+
ifeq ($(TARGET_CPU),sparc)
|
339
|
+
|
340
|
+
ifdef JS_ULTRASPARC_OPTS
|
341
|
+
DEFINES += -DULTRA_SPARC
|
342
|
+
ifdef GNU_CC
|
343
|
+
CFLAGS += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0
|
344
|
+
CXXFLAGS += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0,-K,PIC
|
345
|
+
else
|
346
|
+
ASFLAGS += -xarch=v8plus -DULTRA_SPARC -P -L -D_ASM -D__STDC__=0 -K PIC
|
347
|
+
endif # GNU_CC
|
348
|
+
endif # JS_ULTRASPARC_OPTS
|
349
|
+
|
350
|
+
endif
|
351
|
+
ifeq ($(OS_RELEASE),4.1)
|
352
|
+
LDFLAGS += -ldl -lnsl
|
353
|
+
else
|
354
|
+
LDFLAGS += -lposix4 -ldl -lnsl -lsocket
|
355
|
+
endif
|
356
|
+
endif
|
357
|
+
|
358
|
+
# Allow building jsinterp.c with special optimization flags
|
359
|
+
ifdef INTERP_OPTIMIZER
|
360
|
+
jsinterp.$(OBJ_SUFFIX): MODULE_OPTIMIZE_FLAGS=$(INTERP_OPTIMIZER)
|
361
|
+
endif
|
362
|
+
|
363
|
+
ifeq ($(OS_ARCH),IRIX)
|
364
|
+
ifndef GNU_CC
|
365
|
+
_COMPILE_CFLAGS = $(patsubst -O%,-O1,$(COMPILE_CFLAGS))
|
366
|
+
jsapi.o jsxdrapi.o jsarena.o jsarray.o jsatom.o jsemit.o jsfun.o jsinterp.o jsregexp.o jsparse.o jsopcode.o jsscript.o: %.o: %.c Makefile.in
|
367
|
+
$(REPORT_BUILD)
|
368
|
+
@$(MAKE_DEPS_AUTO_CC)
|
369
|
+
$(CC) -o $@ -c $(_COMPILE_CFLAGS) $<
|
370
|
+
endif
|
371
|
+
endif
|
372
|
+
|
373
|
+
# An AIX Optimization bug causes PR_dtoa() & JS_dtoa to produce wrong result.
|
374
|
+
# This suppresses optimization for this single compilation unit.
|
375
|
+
ifeq ($(OS_ARCH),AIX)
|
376
|
+
jsatom.o: jsatom.c Makefile.in
|
377
|
+
$(REPORT_BUILD)
|
378
|
+
@$(MAKE_DEPS_AUTO_CC)
|
379
|
+
$(CC) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<
|
380
|
+
jsdtoa.o: jsdtoa.c Makefile.in
|
381
|
+
$(REPORT_BUILD)
|
382
|
+
@$(MAKE_DEPS_AUTO_CC)
|
383
|
+
$(CC) -o $@ -c $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(COMPILE_CFLAGS)) $<
|
384
|
+
endif
|
385
|
+
|
386
|
+
jsopcode.h jsopcode.c: jsopcode.tbl
|
387
|
+
|
388
|
+
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH)))
|
389
|
+
jsautocfg.h:
|
390
|
+
touch $@
|
391
|
+
else
|
392
|
+
ifeq ($(OS_ARCH),WINCE)
|
393
|
+
jsautocfg.h:
|
394
|
+
touch $@
|
395
|
+
else
|
396
|
+
jsautocfg.h: jscpucfg$(HOST_BIN_SUFFIX)
|
397
|
+
@rm -f $@ jsautocfg.tmp
|
398
|
+
./jscpucfg > jsautocfg.tmp
|
399
|
+
mv jsautocfg.tmp $@
|
400
|
+
endif
|
401
|
+
endif
|
402
|
+
|
403
|
+
# jscpucfg is a strange target
|
404
|
+
# Needs to be built with the host compiler but needs to include
|
405
|
+
# the mdcpucfg for the target so it needs the appropriate target defines
|
406
|
+
ifdef HOST_NSPR_MDCPUCFG
|
407
|
+
HOST_CC := $(HOST_CC) -DMDCPUCFG=$(TARGET_NSPR_MDCPUCFG)
|
408
|
+
HOST_CFLAGS := $(patsubst -DXP_%,,$(HOST_CFLAGS))
|
409
|
+
endif
|
410
|
+
|
411
|
+
ifdef CROSS_COMPILE
|
412
|
+
# jscpucfg needs to know when it's supposed to produce a config for the target
|
413
|
+
JSCPUCFG_DEFINES = $(ACDEFINES)
|
414
|
+
|
415
|
+
# This is incredibly hacky. Darwin NSPR uses the same MDCPUCFG for multiple
|
416
|
+
# processors, and determines which processor to configure for based on
|
417
|
+
# #ifdef i386. This macro is among the NSPR defines, but is also automatically
|
418
|
+
# defined by the compiler when building for i386. It therefore needs to be
|
419
|
+
# defined here if targeting i386, and explicitly undefined otherwise.
|
420
|
+
ifeq ($(OS_ARCH),Darwin)
|
421
|
+
ifeq ($(TARGET_CPU),powerpc)
|
422
|
+
JSCPUCFG_DEFINES += -Ui386
|
423
|
+
else
|
424
|
+
JSCPUCFG_DEFINES += -Di386=1
|
425
|
+
endif
|
426
|
+
endif
|
427
|
+
endif
|
428
|
+
|
429
|
+
ifeq ($(OS_ARCH),QNX)
|
430
|
+
ifneq ($(OS_TARGET),NTO)
|
431
|
+
# QNX's compiler apparently can't build a binary directly from a source file.
|
432
|
+
jscpucfg.o: jscpucfg.c Makefile.in
|
433
|
+
$(HOST_CC) $(HOST_CFLAGS) -c $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) -o $@ $<
|
434
|
+
|
435
|
+
jscpucfg: jscpucfg.o
|
436
|
+
$(HOST_CC) $(HOST_CFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) -o $@ $<
|
437
|
+
endif
|
438
|
+
else
|
439
|
+
ifeq ($(OS_ARCH),WINCE)
|
440
|
+
jscpucfg$(HOST_BIN_SUFFIX):
|
441
|
+
echo no need to build jscpucfg $<
|
442
|
+
else
|
443
|
+
jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.c Makefile.in
|
444
|
+
$(HOST_CC) $(HOST_CFLAGS) $(JSCPUCFG_DEFINES) $(DEFINES) $(NSPR_CFLAGS) $(OUTOPTION)$@ $<
|
445
|
+
endif
|
446
|
+
endif
|
447
|
+
|
448
|
+
# Extra dependancies and rules for keyword switch code
|
449
|
+
jsscan.$(OBJ_SUFFIX): jsautokw.h jskeyword.tbl
|
450
|
+
|
451
|
+
host_jskwgen.$(OBJ_SUFFIX): jsconfig.h jskeyword.tbl
|
452
|
+
|
453
|
+
jsautokw.h: host_jskwgen$(HOST_BIN_SUFFIX)
|
454
|
+
./host_jskwgen$(HOST_BIN_SUFFIX) $@
|
455
|
+
|
456
|
+
ifdef HAVE_DTRACE
|
457
|
+
javascript-trace.h: $(srcdir)/javascript-trace.d
|
458
|
+
dtrace -h -s $(srcdir)/javascript-trace.d -o javascript-trace.h.in
|
459
|
+
sed 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \
|
460
|
+
javascript-trace.h.in > javascript-trace.h
|
461
|
+
endif
|
462
|
+
|