Skip to content

Commit

Permalink
Merge pull request #73 from janvennemann/TIMOB-23751-1_2_X
Browse files Browse the repository at this point in the history
[TIMOB-23751] Pass arguments to block callback (1.2.X)
  • Loading branch information
hansemannn committed Sep 12, 2016
2 parents eba7494 + ae10921 commit d4a777f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion metabase/ios/lib/generate/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function generateBlockWrapper (state, json, block) {
});
code.push('\t\t\targs = @[' + argnames.join(', ') + '];');
}
code.push('\t\t\t[HyperloopUtils invokeCallback:callback args:nil thisObject:callback];');
code.push('\t\t\t[HyperloopUtils invokeCallback:callback args:' + (args.length ? 'args' : 'nil') + ' thisObject:callback];');
code.push('\t\t};');
code.push('\t\tif ([NSThread isMainThread]) {');
code.push('\t\t\tCallback();');
Expand Down
2 changes: 1 addition & 1 deletion metabase/ios/lib/generate/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ function generateMethodBody (state, json, method, preamble, instance, thisobj, a
process.exit(1);
}
block.arguments.forEach(function (ba, i) {
preamble.push('\t\tif (arguments.length > ' +i + ' && arguments[' + i + ']) {');
preamble.push('\t\tif (arguments.length > ' +i + ' && arguments[' + i + '] !== null) {');
var wrapper = getResultWrapper(state, json, ba, instance);
preamble.push('\t\t\targs.push(' + wrapper + 'arguments[' + i + ']' + (wrapper ? ')': '') + ');');
preamble.push('\t\t} else {');
Expand Down

0 comments on commit d4a777f

Please sign in to comment.