Skip to content

Commit a3850e7

Browse files
authored
Merge pull request #3714 from nobu/use-method_defined
Use `method_defined?` instead of `instance_methods.include?`
2 parents 0bc452b + 6da384d commit a3850e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/prism/polyfill/scan_byte.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require "strscan"
44

55
# Polyfill for StringScanner#scan_byte, which didn't exist until Ruby 3.4.
6-
if !(StringScanner.instance_methods.include?(:scan_byte))
6+
if !(StringScanner.method_defined?(:scan_byte))
77
StringScanner.include(
88
Module.new {
99
def scan_byte # :nodoc:

0 commit comments

Comments
 (0)