Skip to content

Commit 8eba07a

Browse files
[skip-ci] Fix doc example for JS::Object#call
Close #269
1 parent 28caf7f commit 8eba07a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/js/js-core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ static VALUE _rb_js_proc_to_js(VALUE obj) {
520520
* return {
521521
* method1: function(str, num) {
522522
* // str is a JavaScript string and num is a JavaScript number.
523-
* str.length + num
523+
* return str.length + num
524524
* },
525525
* method2: function(rbObject) {
526526
* // Call String#upcase method for the given Ruby object (RbValue).
@@ -529,8 +529,8 @@ static VALUE _rb_js_proc_to_js(VALUE obj) {
529529
* }
530530
* JS
531531
* # Non JS::Object args are automatically converted to JS::Object by `to_js`.
532-
* js_obj[:method1].call("Hello", 5) # => 10
533-
* js_obj[:method2].call(JS::Object.wrap("Hello, Ruby"))
532+
* js_obj.method1("Hello", 5) # => 10
533+
* js_obj.method2(JS::Object.wrap("Hello, Ruby"))
534534
* # => "HELLO, RUBY" (JS::Object)
535535
*/
536536

0 commit comments

Comments
 (0)