Skip to content

Commit

Permalink
[skip-ci] Fix doc example for JS::Object#call
Browse files Browse the repository at this point in the history
Close #269
  • Loading branch information
kateinoigakukun committed Oct 31, 2023
1 parent 28caf7f commit 8eba07a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ext/js/js-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ static VALUE _rb_js_proc_to_js(VALUE obj) {
* return {
* method1: function(str, num) {
* // str is a JavaScript string and num is a JavaScript number.
* str.length + num
* return str.length + num
* },
* method2: function(rbObject) {
* // Call String#upcase method for the given Ruby object (RbValue).
Expand All @@ -529,8 +529,8 @@ static VALUE _rb_js_proc_to_js(VALUE obj) {
* }
* JS
* # Non JS::Object args are automatically converted to JS::Object by `to_js`.
* js_obj[:method1].call("Hello", 5) # => 10
* js_obj[:method2].call(JS::Object.wrap("Hello, Ruby"))
* js_obj.method1("Hello", 5) # => 10
* js_obj.method2(JS::Object.wrap("Hello, Ruby"))
* # => "HELLO, RUBY" (JS::Object)
*/

Expand Down

0 comments on commit 8eba07a

Please sign in to comment.