Bug #12031
Make ERB work with --enable-frozen-string-literal
Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.0dev (2016-01-26) [i386-openbsd]
Description
ERB currently does not work with --enable-frozen-string-literal:
$ echo "a" | RUBYOPT=--enable-frozen-string-literal erb -:1:in `concat': can't modify frozen String (RuntimeError) from -:1:in `<main>' from /usr/local/lib/ruby/2.3/erb.rb:864:in `eval' from /usr/local/lib/ruby/2.3/erb.rb:864:in `result' from /usr/local/lib/ruby/2.3/erb.rb:846:in `run' from /usr/local/bin/erb23:149:in `run' from /usr/local/bin/erb23:170:in `<main>'
The attached patch makes it work with --enable-frozen-string-literal:
$ echo "a" | RUBYOPT=--enable-frozen-string-literal RUBYLIB=~/ruby/lib erb a
Files
Associated revisions
erb.rb: frozen-string-literal safe
- lib/erb.rb (ERB#set_eoutvar): explicitly make mutable string as a buffer to make ERB work with --enable-frozen-string-literal. [ruby-core:73561] [Bug #12031]
erb.rb: frozen-string-literal safe
- lib/erb.rb (ERB#set_eoutvar): explicitly make mutable string as a buffer to make ERB work with --enable-frozen-string-literal. [ruby-core:73561] [Bug #12031]
erb.rb: frozen-string-literal safe
- lib/erb.rb (ERB#set_eoutvar): explicitly make mutable string as a buffer to make ERB work with --enable-frozen-string-literal. [ruby-core:73561] [Bug #12031]
erb.rb: frozen-string-literal safe
- lib/erb.rb (ERB#set_eoutvar): explicitly make mutable string as a buffer to make ERB work with --enable-frozen-string-literal. [ruby-core:73561] [Bug #12031]
History
Updated by nobu (Nobuyoshi Nakada) about 3 years ago
- Status changed from Open to Closed
erb.rb: frozen-string-literal safe
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e