class JSON::TruffleRuby::Generator::State

def generate_json(obj, buf)

Handles @allow_nan, @buffer_initial_length, other ivars must be the default value (see above)
def generate_json(obj, buf)
bj
ash
<< '{'
t = true
each_pair do |k,v|
f << ',' unless first
y_str = k.to_s
 key_str.class == String
fast_serialize_string(key_str, buf)
sif key_str.is_a?(String)
generate_json(key_str, buf)
se
raise TypeError, "#{k.class}#to_s returns an instance of #{key_str.class}, expected a String"
d
f << ':'
nerate_json(v, buf)
rst = false
<< '}'
rray
<< '['
t = true
each do |e|
f << ',' unless first
nerate_json(e, buf)
rst = false
<< ']'
tring
bj.class == String
st_serialize_string(obj, buf)

f << obj.to_json(self)
nteger
<< obj.to_s
te: Float is handled this way since Float#to_s is slow anyway
<< obj.to_json(self)