Skip to content

Commit

Permalink
Eliminate remaining argument list boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Nov 21, 2024
1 parent 5d498fb commit b9d21a8
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 131 deletions.
15 changes: 10 additions & 5 deletions java/src/json/ext/GeneratorState.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ static GeneratorState fromState(ThreadContext context, RuntimeInfo info,

// if the given parameter is a Hash, pass it to the instantiator
if (context.getRuntime().getHash().isInstance(opts)) {
return (GeneratorState)klass.newInstance(context,
new IRubyObject[] {opts}, Block.NULL_BLOCK);
return (GeneratorState)klass.newInstance(context, opts, Block.NULL_BLOCK);
}
}

Expand Down Expand Up @@ -194,9 +193,15 @@ static GeneratorState fromState(ThreadContext context, RuntimeInfo info,
* <dd>set to <code>true</code> if U+2028, U+2029 and forward slashes should be escaped
* in the json output to make it safe to include in a JavaScript tag (default: <code>false</code>)
*/
@JRubyMethod(optional=1, visibility=Visibility.PRIVATE)
public IRubyObject initialize(ThreadContext context, IRubyObject[] args) {
_configure(context, args.length > 0 ? args[0] : null);
@JRubyMethod(visibility=Visibility.PRIVATE)
public IRubyObject initialize(ThreadContext context) {
_configure(context, null);
return this;
}

@JRubyMethod(visibility=Visibility.PRIVATE)
public IRubyObject initialize(ThreadContext context, IRubyObject arg0) {
_configure(context, arg0);
return this;
}

Expand Down
Loading

0 comments on commit b9d21a8

Please sign in to comment.