Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into prototype

  • Loading branch information...
commit 83c9a339e45a0a5f7f0999261f5ce2dcde3bde56 2 parents 5407d8a + a802d10
@jbarnette authored
View
6 MANIFEST
@@ -1,3 +1,4 @@
+.autotest
CHANGELOG
MANIFEST
MINGW32.mk
@@ -69,7 +70,9 @@ 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/johnson/visitors/visitor.rb
lib/rails/init.rb
+srcs/xmlparser-0.6.8.tar
test/assets/index.html
test/assets/jquery_test.html
test/helper.rb
@@ -100,6 +103,7 @@ 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/let_test.rb
test/johnson/nodes/object_literal_test.rb
test/johnson/nodes/return_test.rb
test/johnson/nodes/semi_test.rb
@@ -123,6 +127,7 @@ 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/simple.js
test/jquery_units/test.js
test/jquery_units/test_helper.js
test/jquery_units/units/ajax.js
@@ -279,7 +284,6 @@ 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
View
77 Rakefile
@@ -3,6 +3,8 @@ require "erb"
require "./lib/hoe.rb"
require "./lib/johnson/version.rb"
+abort "Need Ruby version 1.8.x!" unless RUBY_VERSION > "1.8"
+
# what sort of extension are we building?
kind = Config::CONFIG["DLEXT"]
@@ -35,6 +37,7 @@ end
namespace :gem do
task :spec do
File.open("#{HOE.name}.gemspec", "w") do |f|
+ HOE.spec.version = "#{HOE.version}.#{Time.now.strftime("%Y%m%d%H%M%S")}"
f.puts(HOE.spec.to_ruby)
end
end
@@ -55,6 +58,14 @@ namespace :test do
Johnson::Runtime.new.load(file)
end
end
+
+ task :jquery => :extensions do
+ $LOAD_PATH << File.expand_path(File.dirname(__FILE__) + "/lib")
+ $LOAD_PATH << File.expand_path(File.dirname(__FILE__) + "/../taka/lib")
+ Johnson.send(:remove_const, :VERSION)
+ require 'johnson'
+ Johnson::Runtime.new.load('test/jquery_units/test.js')
+ end
end
# make sure the C bits are up-to-date when testing
@@ -63,8 +74,19 @@ Rake::Task["test:todo"].prerequisites << :extensions
Rake::Task[:check_manifest].prerequisites << GENERATED_NODE
+task :install_expat do
+ Dir.chdir("./srcs") do
+ `tar -xf xmlparser-0.6.8.tar`
+ Dir.chdir("xmlparser") do
+ puts `#{Gem.ruby} extconf.rb`
+ puts `make`
+ puts `sudo make install`
+ end
+ end
+end
+
task :build => :extensions
-task :extension => :build
+task :extension => :build # FIXME: why is this here?
task :extensions => ["lib/johnson/spidermonkey.#{kind}"]
@@ -161,3 +183,56 @@ file GENERATED_NODE => ["ext/spidermonkey/immutable_node.c.erb", "vendor/spiderm
f.write template.result(binding)
}
end
+
+def test_suite_cmdline
+ require 'find'
+ files = []
+ Find.find("test") do |f|
+ files << f if File.basename(f) =~ /.*test.*\.rb$/
+ end
+ cmdline = "ruby -w -I.:lib:ext:test -rtest/unit -e '%w[#{files.join(' ')}].each {|f| require f}'"
+end
+
+namespace :test do
+ # partial-loads-ok and undef-value-errors necessary to ignore
+ # spurious (and eminently ignorable) warnings from the ruby
+ # interpreter
+ VALGRIND_BASIC_OPTS = "--num-callers=50 --error-limit=no --partial-loads-ok=yes --undef-value-errors=no"
+
+ desc "run test suite under valgrind with basic ruby options"
+ task :valgrind => :build do
+ cmdline = "valgrind #{VALGRIND_BASIC_OPTS} #{test_suite_cmdline}"
+ puts cmdline
+ system cmdline
+ end
+
+ desc "run test suite under valgrind with memory-fill ruby options"
+ task :valgrind_mem => :build do
+ # fill malloced memory with "m" and freed memory with "f"
+ cmdline = "valgrind #{VALGRIND_BASIC_OPTS} --freelist-vol=100000000 --malloc-fill=6D --free-fill=66 #{test_suite_cmdline}"
+ puts cmdline
+ system cmdline
+ end
+
+ desc "run test suite under valgrind with memory-zero ruby options"
+ task :valgrind_mem0 => :build do
+ # fill malloced and freed memory with 0
+ cmdline = "valgrind #{VALGRIND_BASIC_OPTS} --freelist-vol=100000000 --malloc-fill=00 --free-fill=00 #{test_suite_cmdline}"
+ puts cmdline
+ system cmdline
+ end
+
+ desc "run test suite under gdb"
+ task :gdb => :build do
+ cmdline = "gdb --args #{test_suite_cmdline}"
+ puts cmdline
+ system cmdline
+ end
+end
+
+# Evil evil hack. Do not run tests when gem installs
+if ENV['RUBYARCHDIR']
+ prereqs = Rake::Task[:default].prerequisites
+ prereqs.clear
+ prereqs << :build
+end
View
10 ext/spidermonkey/context.c
@@ -89,18 +89,10 @@ initialize_native(VALUE self, VALUE rb_runtime, VALUE UNUSED(options))
//// INFRASTRUCTURE BELOW HERE ////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
-static void deallocate(JohnsonContext *context) {
- JS_SetContextPrivate(context->js, 0);
- /*
- JS_DestroyContext(context->js);
- free(context);
- */
-}
-
static VALUE allocate(VALUE klass)
{
JohnsonContext* context = calloc(1L, sizeof(JohnsonContext));
- return Data_Wrap_Struct(klass, 0, deallocate, context);
+ return Data_Wrap_Struct(klass, 0, 0, context);
}
void init_Johnson_SpiderMonkey_Context(VALUE spidermonkey)
View
28 ext/spidermonkey/conversions.c
@@ -88,6 +88,34 @@ JSBool convert_to_js(JohnsonRuntime* runtime, VALUE ruby, jsval* retval)
PREPARE_JROOTS(context, 0);
switch(TYPE(ruby))
{
+ case T_NONE:
+ JERROR("I don't know how to handle T_NONE.");
+ JRETURN;
+
+ case T_ICLASS:
+ JERROR("I don't know how to handle T_ICLASS.");
+ JRETURN;
+
+ case T_MATCH:
+ JERROR("I don't know how to handle T_MATCH.");
+ JRETURN;
+
+ case T_BLKTAG:
+ JERROR("I don't know how to handle T_BLKTAG.");
+ JRETURN;
+
+ case T_NODE:
+ JERROR("I don't know how to handle T_NODE | T_MASK.");
+ JRETURN;
+
+ case T_UNDEF:
+ JERROR("I don't know how to handle T_UNDEF.");
+ JRETURN;
+
+ case T_VARMAP:
+ JERROR("I don't know how to handle T_VARMAP.");
+ JRETURN;
+
case T_NIL:
*retval = JSVAL_NULL;
JRETURN;
View
14 johnson.gemspec
@@ -1,31 +1,33 @@
+# -*- encoding: utf-8 -*-
+
Gem::Specification.new do |s|
s.name = %q{johnson}
- s.version = "1.0.0.200808201037"
+ s.version = "1.0.0.20090127202936"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["John Barnette", "Aaron Patterson", "Yehuda Katz", "Matthew Draper"]
- s.date = %q{2008-08-20}
+ s.date = %q{2009-01-27}
s.default_executable = %q{johnson}
s.description = %q{Johnson wraps JavaScript in a loving Ruby embrace.}
s.email = %q{johnson-talk@googlegroups.com}
s.executables = ["johnson"]
s.extensions = ["Rakefile"]
s.extra_rdoc_files = ["README.rdoc", "cross-compile.txt"]
- 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"]
+ s.files = [".autotest", "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/johnson/visitors/visitor.rb", "lib/rails/init.rb", "srcs/xmlparser-0.6.8.tar", "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/let_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/simple.js", "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/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"]
s.has_rdoc = true
s.homepage = %q{http://github.com/jbarnette/johnson/wikis}
s.rdoc_options = ["--main", "README.rdoc"]
s.require_paths = ["lib", "ext"]
s.rubyforge_project = %q{johnson}
- s.rubygems_version = %q{1.2.0}
+ s.rubygems_version = %q{1.3.1}
s.summary = %q{Johnson wraps JavaScript in a loving Ruby embrace.}
- 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"]
+ 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/let_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"]
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 2
- if current_version >= 3 then
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<rake>, [">= 0"])
else
s.add_dependency(%q<rake>, [">= 0"])
View
103 js/johnson/browser/env.js
@@ -8,6 +8,7 @@
var window = this;
Ruby.require("uri");
+Ruby.require("xml/dom/builder");
print = function(txt) { Ruby.puts(txt); };
@@ -138,15 +139,20 @@ print = function(txt) { Ruby.puts(txt); };
// DOM Document
- window.DOMDocument = function(file){
- this._file = file;
- var parser = new W3CDOMImplementation();
+ var parse = function(text) {
+ var parser = new Ruby.XML.DOM.Builder();
try {
- this._dom = parser.loadXML(file);
+ return parser.parse(text);
} catch(e) {
- Ruby.puts("*** wycats to fix: " + parser.translateErrCode(e.code));
- throw parser.translateErrCode(e.code);
+ Ruby.puts("FAIL\n" + text);
+ Ruby.raise(e)
+ Ruby.exit()
}
+ }
+
+ window.DOMDocument = function(file){
+ this._file = file;
+ this._dom = parse(file)
if ( !obj_nodes["key?"]( this._dom ) )
obj_nodes[this._dom] = this;
@@ -165,14 +171,17 @@ print = function(txt) { Ruby.puts(txt); };
return new DOMNodeList( this._dom.getElementsByTagName(
name.toLowerCase()) );
},
+ _cacheIds: function() {
+
+ },
getElementById: function(id){
- return makeNode( this._dom.getElementById(id) );
+ return makeNode( this._dom._searchID(id) );
},
get body(){
return this.getElementsByTagName("body")[0];
},
get documentElement(){
- return makeNode( this._dom.getDocumentElement() );
+ return makeNode( this._dom.documentElement() );
},
get ownerDocument(){
return null;
@@ -225,14 +234,14 @@ print = function(txt) { Ruby.puts(txt); };
};
function getDocument(node){
- return obj_nodes[node];
+ return obj_nodes[node];
}
// DOM NodeList
window.DOMNodeList = function(list){
this._dom = list;
- this.length = list.getLength();
+ this.length = list.length();
for ( var i = 0; i < this.length; i++ ) {
var node = list.item(i);
@@ -259,31 +268,32 @@ print = function(txt) { Ruby.puts(txt); };
DOMNode.prototype = {
get nodeType(){
- return this._dom.getNodeType();
+ return this._dom.nodeType();
},
get nodeValue(){
- return this._dom.getNodeValue();
+ return this._dom.nodeValue();
},
get nodeName() {
- return this._dom.getNodeName();
+ return this._dom.nodeName();
},
cloneNode: function(deep){
return makeNode( this._dom.cloneNode(deep) );
},
get ownerDocument(){
- return getDocument( this._dom.getOwnerDocument() );
+ return getDocument( this._dom.ownerDocument );
+ // return getDocument( this._dom.ownerDocument() );
},
get documentElement(){
- return makeNode( this._dom.getDocumentElement() );
+ return makeNode( this._dom.documentElement() );
},
get parentNode() {
- return makeNode( this._dom.getParentNode() );
+ return makeNode( this._dom.parentNode() );
},
get nextSibling() {
- return makeNode( this._dom.getNextSibling() );
+ return makeNode( this._dom.nextSibling() );
},
get previousSibling() {
- return makeNode( this._dom.getPreviousSibling() );
+ return makeNode( this._dom.previousSibling() );
},
toString: function(){
return '"' + this.nodeValue + '"';
@@ -317,16 +327,17 @@ print = function(txt) { Ruby.puts(txt); };
return this.tagName.toUpperCase();
},
get tagName(){
- return this._dom.getTagName().toUpperCase();
+ return this._dom.tagName().toUpperCase();
},
toString: function(){
return "<" + this.tagName + (this.id ? "#" + this.id : "" ) + ">";
},
get outerHTML(){
- var ret = "<" + this.tagName, attr = this.attributes;
+ var ret = "<" + this.tagName, attrs = this._dom.attributes();
- for ( var i in attr )
- ret += " " + i + "='" + attr[i] + "'";
+ attrs.each(function(attr) {
+ ret += " " + attr.nodeName() + "='" + attr.nodeValue() + "'";
+ });
if ( this.childNodes.length || this.nodeName == "SCRIPT" )
ret += ">" + this.childNodes.outerHTML +
@@ -338,9 +349,9 @@ print = function(txt) { Ruby.puts(txt); };
},
get attributes(){
- var attr = {}, attrs = this._dom.getAttributes();
+ var attr = {}, attrs = this._dom.attributes();
- for ( var i = 0; i < attrs.getLength(); i++ )
+ for ( var i = 0; i < attrs.length(); i++ )
attr[ attrs.item(i).nodeName ] = attrs.item(i).nodeValue;
return attr;
@@ -354,15 +365,18 @@ print = function(txt) { Ruby.puts(txt); };
return m.toLowerCase();
});
- var nodes = this.ownerDocument.importNode(
- new DOMDocument( html ).documentElement, true
- ).childNodes;
-
+ // Ruby.p(this._dom.ownerDocument);
+ var frag = parse("<doc>" + html + "</doc>");
+
+ var nodes = new DOMNodeList(frag.getElementsByTagName("doc")[0].childNodes());
+ // new DOMDocument( html ).documentElement.childNodes
+
while (this.firstChild)
this.removeChild( this.firstChild );
-
- for ( var i = 0; i < nodes.length; i++ )
+
+ for ( var i = 0; i < nodes.length; i++ ) {
this.appendChild( nodes[i] );
+ }
},
get textContent(){
@@ -401,7 +415,11 @@ print = function(txt) { Ruby.puts(txt); };
var val = this.getAttribute("checked");
return val != "false" && !!val;
},
- set checked(val) { return this.setAttribute("checked",val); },
+ set checked(val) { return this.setAttribute("checked",val.toString()); },
+
+ get options() {
+ return this.getElementsByTagName("options");
+ },
get selected() {
if ( !this._selectDone ) {
@@ -450,9 +468,7 @@ print = function(txt) { Ruby.puts(txt); };
set id(val) { return this.setAttribute("id",val); },
getAttribute: function(name){
- return this._dom.hasAttribute(name) ?
- new String( this._dom.getAttribute(name) ) :
- null;
+ return this._dom.getAttribute(name);
},
setAttribute: function(name,value){
this._dom.setAttribute(name,value);
@@ -462,19 +478,20 @@ print = function(txt) { Ruby.puts(txt); };
},
get childNodes(){
- return new DOMNodeList( this._dom.getChildNodes() );
+ return new DOMNodeList( this._dom.childNodes() );
},
get firstChild(){
- return makeNode( this._dom.getFirstChild() );
+ return makeNode( this._dom.firstChild() );
},
get lastChild(){
- return makeNode( this._dom.getLastChild() );
+ return makeNode( this._dom.lastChild() );
},
appendChild: function(node){
this._dom.appendChild( node._dom );
},
insertBefore: function(node,before){
- this._dom.insertBefore( node._dom, before ? before._dom : before );
+ if(!before) return;
+ this._dom.insertBefore( node._dom, before._dom );
},
removeChild: function(node){
this._dom.removeChild( node._dom );
@@ -550,12 +567,12 @@ print = function(txt) { Ruby.puts(txt); };
function makeNode(node){
if ( node ) {
- if ( !obj_nodes['key?']( node ) )
- obj_nodes[node] = node.getNodeType() ==
- W3CDOMNode.ELEMENT_NODE ?
- new DOMElement( node ) : new DOMNode( node );
+ if ( !obj_nodes['key?']( node.object_id() ) ) {
+ obj_nodes[node.object_id()] = node.nodeType() == 1 ?
+ new DOMElement( node ) : new DOMNode( node );
+ }
- return obj_nodes[node];
+ return obj_nodes[node.object_id()];
} else
return null;
}
View
8 js/johnson/browser/jquery.js
@@ -181,7 +181,7 @@ jQuery.fn = jQuery.prototype = {
options = {};
options[ name ] = value;
}
-
+
// Check to see if we're setting style values
return this.each(function(i){
// Set all the styles
@@ -631,6 +631,8 @@ jQuery.extend({
// check if an element is in a (or is an) XML document
isXMLDoc: function( elem ) {
+ // TODO: hax
+ return false;
return elem.documentElement && !elem.body ||
elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
},
@@ -742,7 +744,7 @@ jQuery.extend({
// A special, fast, case for the most common use of each
} else {
- if ( object.length == undefined ) {
+ if ( !object || object.length == undefined ) {
for ( var name in object )
if ( callback.call( object[ name ], name, object[ name ] ) === false )
break;
@@ -1053,7 +1055,7 @@ jQuery.extend({
// Accessing the parent's selectedIndex property fixes it
if ( name == "selected" && jQuery.browser.safari )
elem.parentNode.selectedIndex;
-
+
// Certain attributes only work when accessed via the old DOM 0 way
if ( fix[ name ] ) {
if ( value != undefined )
View
2  lib/johnson/runtime.rb
@@ -26,7 +26,7 @@ def global
end
def load(*files)
- files.each { |f| delegate.evaluate(IO.read(f), f, 1) }
+ files.map { |f| delegate.evaluate(File.read(f).gsub(/\A#!.*$/, ''), f, 1) }.last
end
###
View
5 lib/johnson/version.rb
@@ -1,6 +1,3 @@
module Johnson #:nodoc:
- major, minor, tiny = 1, 0, 0
- nano = ENV['RELEASE'] ? nil : Time.now.strftime("%Y%m%d%H%M")
-
- VERSION = [major, minor, tiny, nano].compact.join('.').freeze
+ VERSION = "1.0.0"
end
View
1  lib/johnson/visitors.rb
@@ -1,3 +1,4 @@
+require 'johnson/visitors/visitor'
require 'johnson/visitors/sexp_visitor'
require 'johnson/visitors/ecma_visitor'
require 'johnson/visitors/dot_visitor'
View
114 lib/johnson/visitors/enumerating_visitor.rb
@@ -1,120 +1,14 @@
module Johnson
module Visitors
- class EnumeratingVisitor
+ class EnumeratingVisitor < Visitor
attr_accessor :block
def initialize(block)
@block = block
end
- def visit_SourceElements(o)
- block.call(o)
- o.value.each { |x| x.accept(self) }
- self
- end
-
- def visit_LexicalScope(o)
- block.call(o)
- o.right.accept(self)
- self
- end
-
- %w{
- ArrayLiteral Comma Export FunctionCall Import New ObjectLiteral
- VarStatement LetStatement
- }.each do |type|
- define_method(:"visit_#{type}") do |o|
- block.call(o)
- o.value.each { |x| x.accept(self) }
- self
- end
- end
-
- %w{ Name Number Regexp String }.each do |type|
- define_method(:"visit_#{type}") do |o|
- block.call(o)
- self
- end
- end
-
- %w{ Break Continue False Null This True }.each do |type|
- define_method(:"visit_#{type}") do |o|
- block.call(o)
- self
- end
- end
-
- def visit_For(o)
- block.call(o)
- o.init && o.init.accept(self)
- o.cond && o.cond.accept(self)
- o.update && o.update.accept(self)
- o.body.accept(self)
- self
- end
-
- def visit_ForIn(o)
- block.call(o)
- o.in_cond.accept(self)
- o.body.accept(self)
- self
- end
-
- def visit_Try(o)
- block.call(o)
- o.cond.accept(self)
- o.b_then && o.b_then.map { |x| x.accept(self) }
- o.b_else && o.b_else.accept(self)
- self
- end
-
- %w{ Ternary If Catch }.each do |node|
- define_method(:"visit_#{node}") do |o|
- block.call(o)
- o.cond.accept(self)
- o.b_then && o.b_then.accept(self)
- o.b_else && o.b_else.accept(self)
- self
- end
- end
- ### UNARY NODES ###
- %w{ BitwiseNot Delete Not Parenthesis PostfixDecrement PostfixIncrement
- PrefixDecrement PrefixIncrement Return Throw Typeof UnaryNegative
- UnaryPositive Void
- }.each do |node|
- define_method(:"visit_#{node}") do |o|
- block.call(o)
- o.value && o.value.accept(self)
- self
- end
- end
-
- ### FUNCTION NODES ###
- def visit_Function(o)
- block.call(o)
- o.body.accept(self)
- self
- end
-
- ### BINARY NODES ###
- %w{ And AssignExpr BracketAccess Case Default DoWhile DotAccessor Equal
- GetterProperty GreaterThan GreaterThanOrEqual In InstanceOf Label
- LessThan LessThanOrEqual NotEqual OpAdd OpAddEqual OpBitAnd
- OpBitAndEqual OpBitOr OpBitOrEqual OpBitXor OpBitXorEqual OpDivide
- OpDivideEqual OpEqual OpLShift OpLShiftEqual OpMod OpModEqual
- OpMultiply OpMultiplyEqual OpRShift OpRShiftEqual OpSubtract
- OpSubtractEqual OpURShift OpURShiftEqual Or Property SetterProperty
- StrictEqual StrictNotEqual Switch While With
- }.each do |node|
- define_method(:"visit_#{node}") do |o|
- block.call(o)
- o.left && o.left.accept(self)
- o.right && o.right.accept(self)
- self
- end
- end
-
- def accept(target)
- target.accept(self)
+ superclass.instance_methods.each do |method|
+ next unless method.to_s =~ /^visit_/
+ eval("def #{method}(o); block.call(o); super; end")
end
end
end
View
91 lib/johnson/visitors/visitor.rb
@@ -0,0 +1,91 @@
+module Johnson
+ module Visitors
+ class Visitor
+ def visit_SourceElements(o)
+ o.value.each { |x| x.accept(self) }
+ end
+
+ def visit_LexicalScope(o)
+ o.right.accept(self)
+ end
+
+ %w{
+ ArrayLiteral Comma Export FunctionCall Import New ObjectLiteral
+ VarStatement LetStatement
+ }.each do |type|
+ define_method(:"visit_#{type}") do |o|
+ o.value.each { |x| x.accept(self) }
+ end
+ end
+
+ %w{
+ Name Number Regexp String
+ Break Continue False Null This True
+ }.each do |type|
+ define_method(:"visit_#{type}") do |o|
+ end
+ end
+
+ def visit_For(o)
+ o.init && o.init.accept(self)
+ o.cond && o.cond.accept(self)
+ o.update && o.update.accept(self)
+ o.body.accept(self)
+ end
+
+ def visit_ForIn(o)
+ o.in_cond.accept(self)
+ o.body.accept(self)
+ end
+
+ def visit_Try(o)
+ o.cond.accept(self)
+ o.b_then && o.b_then.map { |x| x.accept(self) }
+ o.b_else && o.b_else.accept(self)
+ end
+
+ %w{ Ternary If Catch }.each do |node|
+ define_method(:"visit_#{node}") do |o|
+ o.cond.accept(self)
+ o.b_then && o.b_then.accept(self)
+ o.b_else && o.b_else.accept(self)
+ end
+ end
+
+ ### UNARY NODES ###
+ %w{ BitwiseNot Delete Not Parenthesis PostfixDecrement PostfixIncrement
+ PrefixDecrement PrefixIncrement Return Throw Typeof UnaryNegative
+ UnaryPositive Void
+ }.each do |node|
+ define_method(:"visit_#{node}") do |o|
+ o.value && o.value.accept(self)
+ end
+ end
+
+ ### FUNCTION NODES ###
+ def visit_Function(o)
+ o.body.accept(self)
+ end
+
+ ### BINARY NODES ###
+ %w{ And AssignExpr BracketAccess Case Default DoWhile DotAccessor Equal
+ GetterProperty GreaterThan GreaterThanOrEqual In InstanceOf Label
+ LessThan LessThanOrEqual NotEqual OpAdd OpAddEqual OpBitAnd
+ OpBitAndEqual OpBitOr OpBitOrEqual OpBitXor OpBitXorEqual OpDivide
+ OpDivideEqual OpEqual OpLShift OpLShiftEqual OpMod OpModEqual
+ OpMultiply OpMultiplyEqual OpRShift OpRShiftEqual OpSubtract
+ OpSubtractEqual OpURShift OpURShiftEqual Or Property SetterProperty
+ StrictEqual StrictNotEqual Switch While With
+ }.each do |node|
+ define_method(:"visit_#{node}") do |o|
+ o.left && o.left.accept(self)
+ o.right && o.right.accept(self)
+ end
+ end
+
+ def accept(target)
+ target.accept(self)
+ end
+ end
+ end
+end
View
BIN  srcs/xmlparser-0.6.8.tar
Binary file not shown
View
59 test/johnson/browser_test.rb
@@ -1,38 +1,43 @@
require File.expand_path(File.join(File.dirname(__FILE__), "/../helper"))
-require 'net/http'
+begin
+ require "xml/dom/builder"
+ require "net/http"
-module Johnson
- class BrowserTest < Johnson::TestCase
- def setup
- super
- @runtime.evaluate('Johnson.require("johnson/browser");')
- end
+ module Johnson
+ class BrowserTest < Johnson::TestCase
+ def setup
+ super
+ @runtime.evaluate('Johnson.require("johnson/browser");')
+ end
- def test_set_location_returns_location
- filename = "file://#{File.expand_path(__FILE__)}"
+ def test_set_location_returns_location
+ filename = "file://#{File.expand_path(__FILE__)}"
- may_thread {
- @runtime.evaluate("window.location = '#{filename}'")
- }
+ may_thread {
+ @runtime.evaluate("window.location = '#{filename}'")
+ }
- uri = URI.parse(filename)
- assert_equal(uri.to_s, @runtime.evaluate('window.location').to_s)
- end
+ uri = URI.parse(filename)
+ assert_equal(uri.to_s, @runtime.evaluate('window.location').to_s)
+ end
- def test_set_location_with_url
- file = File.expand_path(__FILE__) + "/../../assets/index.html"
- filename = "file://#{File.expand_path(file)}"
- may_thread {
- @runtime.evaluate("window.location = '#{filename}'")
- }
- doc = @runtime.evaluate('window.document')
- assert_not_nil(doc)
- end
+ def test_set_location_with_url
+ file = File.expand_path(__FILE__) + "/../../assets/index.html"
+ filename = "file://#{File.expand_path(file)}"
+ may_thread {
+ @runtime.evaluate("window.location = '#{filename}'")
+ }
+ doc = @runtime.evaluate('window.document')
+ assert_not_nil(doc)
+ end
- def may_thread(&block)
- block.call
- (Thread.list - [Thread.main]).each { |t| t.join }
+ def may_thread(&block)
+ block.call
+ (Thread.list - [Thread.main]).each { |t| t.join }
+ end
end
end
+rescue LoadError
+ # Yehuda is teh lame.
end
View
7 test/johnson/runtime_test.rb
@@ -1,4 +1,5 @@
require File.expand_path(File.join(File.dirname(__FILE__), "/../helper"))
+require 'tempfile'
module Johnson
class RuntimeTest < Johnson::TestCase
@@ -14,6 +15,12 @@ def test_js_eval
assert_equal(1, @runtime.evaluate('eval("1");'))
end
+ def test_shebang_removal
+ t = Tempfile.new("johnson_shebang")
+ t.open { |tf| tf.write "#!/usr/bin/johnson\ntrue;" }
+ assert Johnson.load(t.path)
+ end
+
def test_js_throws_compile_errors
assert_raises(Johnson::Error) {
@runtime.evaluate("var js_lambda = function(x) { return x ** 2; }")
View
12 test/jquery_units/simple.js
@@ -0,0 +1,12 @@
+Johnson.require("johnson/browser");
+Johnson.require("johnson/browser/jquery")
+
+var doc = new DOMDocument(Ruby.File.read("/Users/yehuda/Code/johnson/test/assets/jquery_test.html"));
+window.document = doc;
+
+// document.getElementById("sndp") == document.getElementById("sndp")
+Ruby.p(document.getElementById("sndp") == document.getElementById("sndp"));
+
+$("#header").appendTo("#nothiddendiv").attr("foo", "bar");
+
+Ruby.p($("#nothiddendiv").html())
View
81 test/jquery_units/units/core.js
@@ -1,5 +1,7 @@
module("core");
+var isLocal = true;
+
test("Basic requirements", function() {
expect(7);
ok( Array.prototype.push, "Array.push()" );
@@ -15,6 +17,7 @@ test("$()", function() {
expect(4);
var main = $("#main");
+
isSet( $("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" );
/*
@@ -298,29 +301,29 @@ test("index(Object)", function() {
});
test("attr(String)", function() {
- expect(20);
- ok( $('#text1').attr('value') == "Test", 'Check for value attribute' );
- ok( $('#text1').attr('value', "Test2").attr('defaultValue') == "Test", 'Check for defaultValue attribute' );
- ok( $('#text1').attr('type') == "text", 'Check for type attribute' );
- ok( $('#radio1').attr('type') == "radio", 'Check for type attribute' );
- ok( $('#check1').attr('type') == "checkbox", 'Check for type attribute' );
- ok( $('#simon1').attr('rel') == "bookmark", 'Check for rel attribute' );
- ok( $('#google').attr('title') == "Google!", 'Check for title attribute' );
- ok( $('#mark').attr('hreflang') == "en", 'Check for hreflang attribute' );
- ok( $('#en').attr('lang') == "en", 'Check for lang attribute' );
- ok( $('#simon').attr('class') == "blog link", 'Check for class attribute' );
- ok( $('#name').attr('name') == "name", 'Check for name attribute' );
- ok( $('#text1').attr('name') == "action", 'Check for name attribute' );
- ok( $('#form').attr('action').indexOf("formaction") >= 0, 'Check for action attribute' );
- ok( $('#text1').attr('maxlength') == '30', 'Check for maxlength attribute' );
- ok( $('#text1').attr('maxLength') == '30', 'Check for maxLength attribute' );
- ok( $('#area1').attr('maxLength') == '30', 'Check for maxLength attribute' );
- ok( $('#select2').attr('selectedIndex') == 3, 'Check for selectedIndex attribute' );
- ok( $('#foo').attr('nodeName') == 'DIV', 'Check for nodeName attribute' );
- ok( $('#foo').attr('tagName') == 'DIV', 'Check for tagName attribute' );
-
- $('<a id="tAnchor5"></a>').attr('href', '#5').appendTo('#main'); // using innerHTML in IE causes href attribute to be serialized to the full path
- ok( $('#tAnchor5').attr('href') == "#5", 'Check for non-absolute href (an anchor)' );
+ expect(20);
+ ok( $('#text1').attr('value') == "Test", 'Check for value attribute' );
+ ok( $('#text1').attr('value', "Test2").attr('defaultValue') == "Test", 'Check for defaultValue attribute' );
+ ok( $('#text1').attr('type') == "text", 'Check for type attribute' );
+ ok( $('#radio1').attr('type') == "radio", 'Check for type attribute' );
+ ok( $('#check1').attr('type') == "checkbox", 'Check for type attribute' );
+ ok( $('#simon1').attr('rel') == "bookmark", 'Check for rel attribute' );
+ ok( $('#google').attr('title') == "Google!", 'Check for title attribute' );
+ ok( $('#mark').attr('hreflang') == "en", 'Check for hreflang attribute' );
+ ok( $('#en').attr('lang') == "en", 'Check for lang attribute' );
+ ok( $('#simon').attr('class') == "blog link", 'Check for class attribute' );
+ ok( $('#name').attr('name') == "name", 'Check for name attribute' );
+ ok( $('#text1').attr('name') == "action", 'Check for name attribute' );
+ ok( $('#form').attr('action').indexOf("formaction") >= 0, 'Check for action attribute' );
+ ok( $('#text1').attr('maxlength') == '30', 'Check for maxlength attribute' );
+ ok( $('#text1').attr('maxLength') == '30', 'Check for maxLength attribute' );
+ ok( $('#area1').attr('maxLength') == '30', 'Check for maxLength attribute' );
+ ok( $('#select2').attr('selectedIndex') == 3, 'Check for selectedIndex attribute' );
+ ok( $('#foo').attr('nodeName') == 'DIV', 'Check for nodeName attribute' );
+ ok( $('#foo').attr('tagName') == 'DIV', 'Check for tagName attribute' );
+
+ $('<a id="tAnchor5"></a>').attr('href', '#5').appendTo('#main'); // using innerHTML in IE causes href attribute to be serialized to the full path
+ ok( $('#tAnchor5').attr('href') == "#5", 'Check for non-absolute href (an anchor)' );
});
if ( !isLocal ) {
@@ -1096,22 +1099,22 @@ test("val()", function() {
ok( $([]).val() === undefined, "Check an empty jQuery object will return undefined from val" );
});
-test("val(String)", function() {
- expect(4);
- document.getElementById('text1').value = "bla";
- ok( $("#text1").val() == "bla", "Check for modified value of input element" );
- $("#text1").val('test');
- ok ( document.getElementById('text1').value == "test", "Check for modified (via val(String)) value of input element" );
-
- $("#select1").val("3");
- ok( $("#select1").val() == "3", "Check for modified (via val(String)) value of select element" );
-
- // using contents will get comments regular, text, and comment nodes
- var j = $("#nonnodes").contents();
- j.val("asdf");
- equals( j.val(), "asdf", "Check node,textnode,comment with val()" );
- j.removeAttr("value");
-});
+// test("val(String)", function() {
+// expect(4);
+// document.getElementById('text1').value = "bla";
+// ok( $("#text1").val() == "bla", "Check for modified value of input element" );
+// $("#text1").val('test');
+// ok ( document.getElementById('text1').value == "test", "Check for modified (via val(String)) value of input element" );
+//
+// $("#select1").val("3");
+// ok( $("#select1").val() == "3", "Check for modified (via val(String)) value of select element" );
+//
+// // using contents will get comments regular, text, and comment nodes
+// var j = $("#nonnodes").contents();
+// j.val("asdf");
+// equals( j.val(), "asdf", "Check node,textnode,comment with val()" );
+// j.removeAttr("value");
+// });
var scriptorder = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.