403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
|
# File 'lib/mini_racer/truffleruby.rb', line 403
def self.set_flag_as_str!(flag)
unless flag.is_a?(String)
raise TypeError,
"wrong type argument #{flag.class} (should be a string)"
end
raise ArgumentError, "flag contains NUL byte" if flag.include?("\0")
normalized = flag.start_with?("--") ? flag : "--#{flag}"
raise ArgumentError, "flag too long" if normalized.bytesize >= 256
if Context.instance_variable_get(:@context_initialized)
raise MiniRacer::PlatformAlreadyInitialized,
"The platform is already initialized."
end
if "--use_strict" == flag
Context.instance_variable_set(:@use_strict, true)
end
end
|