Chromium Code Reviews| Index: lib/html/scripts/systemnative.py |
| diff --git a/lib/html/scripts/systemnative.py b/lib/html/scripts/systemnative.py |
| index 28005474e9c5d6b54fc6a04c388876dbf4806f05..14189bab17a2eef240d6a0928861f895e01e3fe6 100644 |
| --- a/lib/html/scripts/systemnative.py |
| +++ b/lib/html/scripts/systemnative.py |
| @@ -825,17 +825,25 @@ class NativeImplementationGenerator(systembase.BaseGenerator): |
| # Emit arguments. |
| start_index = 1 if needs_receiver else 0 |
| for i, argument in enumerate(arguments): |
| + type_info = self._TypeInfo(argument.type.id) |
| argument_expression_template, type, cls, function = \ |
| - self._TypeInfo(argument.type.id).to_native_info(argument, self._interface.id) |
| + type_info.to_native_info(argument, self._interface.id) |
| if ((IsOptional(argument) and not self._IsArgumentOptionalInWebCore(node, argument)) or |
| (argument.ext_attrs.get('Optional') == 'DefaultIsNullString')): |
| function += 'WithNullCheck' |
| argument_name = DartDomNameOfAttribute(argument) |
| + if type_info.pass_native_by_ref(): |
| + invocation_template =\ |
| + ' $TYPE $ARGUMENT_NAME;\n'\ |
|
podivilov
2012/09/14 08:06:06
nit: unnecessary trailing \
Anton Muhin
2012/09/14 12:32:58
No, it's necessary. Another option would be to pu
|
| + ' $CLS::$FUNCTION($ARGUMENT_NAME, Dart_GetNativeArgument(args, $INDEX), exception);\n' |
|
podivilov
2012/09/14 08:06:06
nit: Dart_GetNativeArgument should come first.
Anton Muhin
2012/09/14 12:32:58
Done.
|
| + else: |
| + invocation_template =\ |
| + ' $TYPE $ARGUMENT_NAME = $CLS::$FUNCTION(Dart_GetNativeArgument(args, $INDEX), exception);\n' |
| body_emitter.Emit( |
| - '\n' |
| - ' $TYPE $ARGUMENT_NAME = $CLS::$FUNCTION(Dart_GetNativeArgument(args, $INDEX), exception);\n' |
| + '\n' + |
| + invocation_template + |
| ' if (exception)\n' |
| ' goto fail;\n', |
| TYPE=type, |