Actions
Bug #12031
closedMake ERB work with --enable-frozen-string-literal
Status:
Closed
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
Updated by nobu (Nobuyoshi Nakada) almost 9 years ago
- Status changed from Open to Closed
Applied in changeset r53682.
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]
Actions
Like0
Like0