diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-13 05:24:26 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-13 05:24:26 +0000 |
commit | a747366aec6a83103bda6572d06bc4979ffa3f49 (patch) | |
tree | af0909ff3a35c3e7d7f997013cdced781350640f | |
parent | 51f64b032a93d9521962e0ea11fa77536c8df602 (diff) |
reverted r38318.
rubyspec reports that there is incompatibility.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@38359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/erb.rb | 11 | ||||
-rw-r--r-- | test/erb/test_erb.rb | 10 | ||||
-rw-r--r-- | version.h | 6 |
4 files changed, 5 insertions, 27 deletions
@@ -30,11 +30,6 @@ Tue Dec 11 19:15:51 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> * parse.y (parser_here_document): flush string content between new line and :string_embexpr. [ruby-core:48703] [Bug #7255] -Tue Dec 11 19:01:45 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> - - * lib/erb.rb (ERB#run, ERB#result): eval under isolated bindings for - safe concurrent use. [ruby-core:47638] [Bug #7046] - Tue Dec 11 17:53:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> * compile.c (iseq_compile_each): count flip-flop state in local iseq diff --git a/lib/erb.rb b/lib/erb.rb index 8ff8e115ab..bb47943a86 100644 --- a/lib/erb.rb +++ b/lib/erb.rb @@ -1,4 +1,3 @@ -# -*- coding: us-ascii -*- # = ERB -- Ruby Templating # # Author:: Masatoshi SEKI @@ -817,7 +816,7 @@ class ERB end # Generate results and print them. (see ERB#result) - def run(b=new_toplevel) + def run(b=TOPLEVEL_BINDING) print self.result(b) end @@ -829,7 +828,7 @@ class ERB # _b_ accepts a Binding or Proc object which is used to set the context of # code evaluation. # - def result(b=new_toplevel) + def result(b=TOPLEVEL_BINDING) if @safe_level proc { $SAFE = @safe_level @@ -840,12 +839,6 @@ class ERB end end - def new_toplevel - # New binding each time *near* toplevel for unspecified runs - TOPLEVEL_BINDING.dup - end - private :new_toplevel - # Define _methodname_ as instance method of _mod_ from compiled ruby source. # # example: diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb index 6fe59a68b6..05d255623a 100644 --- a/test/erb/test_erb.rb +++ b/test/erb/test_erb.rb @@ -1,4 +1,3 @@ -# -*- coding: us-ascii -*- require 'test/unit' require 'erb' @@ -38,15 +37,6 @@ class TestERB < Test::Unit::TestCase } assert_match(/\Atest filename:1\b/, e.backtrace[0]) end - - def test_concurrent_default_binding - template1 = 'one <%= ERB.new(template2).result %>' - - eval 'template2 = "two"', TOPLEVEL_BINDING - - bug7046 = '[ruby-core:47638]' - assert_equal("one two", ERB.new(template1).result, bug7046) - end end class TestERBCore < Test::Unit::TestCase @@ -1,10 +1,10 @@ #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 340 +#define RUBY_PATCHLEVEL 341 -#define RUBY_RELEASE_DATE "2012-12-11" +#define RUBY_RELEASE_DATE "2012-12-13" #define RUBY_RELEASE_YEAR 2012 #define RUBY_RELEASE_MONTH 12 -#define RUBY_RELEASE_DAY 11 +#define RUBY_RELEASE_DAY 13 #include "ruby/version.h" |