Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String#length should be available when using opal/mini.rb #2438

Merged
merged 1 commit into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions opal/corelib/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,12 @@ def intern
`self.toString()`
end

def length
`self.length`
end

alias size length

def lines(separator = $/, chomp: false, &block)
e = each_line(separator, chomp: chomp, &block)
block ? self : e.to_a
Expand Down
6 changes: 0 additions & 6 deletions opal/corelib/string/encoding.rb
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,6 @@ def initialize_copy(other)
}
end

def length
`self.length`
end

alias size length

# stub
def valid_encoding?
true
Expand Down