From 8eba07aaac4b6172e3af80c011e813b71e5298f2 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Tue, 31 Oct 2023 18:19:28 +0000 Subject: [PATCH] [skip-ci] Fix doc example for JS::Object#call Close https://github.com/ruby/ruby.wasm/issues/269 --- ext/js/js-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/js/js-core.c b/ext/js/js-core.c index fa1e0308c8..c28804f2e4 100644 --- a/ext/js/js-core.c +++ b/ext/js/js-core.c @@ -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). @@ -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) */