Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: lib/dom/scripts/systemnative.py

Issue 10821010: Automatically support fancy Console methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/scripts/systemnative.py
diff --git a/lib/dom/scripts/systemnative.py b/lib/dom/scripts/systemnative.py
index ee1054028c7c1dba41ad027231ddcab6f2b1b8c7..f410895e618cf3852b95956df674bd9254456fd5 100644
--- a/lib/dom/scripts/systemnative.py
+++ b/lib/dom/scripts/systemnative.py
@@ -679,6 +679,9 @@ class NativeImplementationGenerator(systembase.BaseGenerator):
self._cpp_impl_includes.add('"ScriptArguments.h"')
self._cpp_impl_includes.add('"ScriptCallStack.h"')
cpp_arguments = ['scriptArguments', 'scriptCallStack']
+ # WebKit uses scriptArguments to reconstruct last argument, so
+ # it's not needed and should be just removed.
+ arguments = arguments[:-1]
podivilov 2012/08/21 12:03:27 It does the opposite to DatabaseBuilder.AddMissing
Anton Muhin 2012/08/21 12:04:33 I'd be glad to, but I need proper signatures for a
if ext_attrs.get('CallWith') == 'ScriptExecutionContext':
raises_exceptions = True
@@ -687,8 +690,8 @@ class NativeImplementationGenerator(systembase.BaseGenerator):
if 'ImplementedBy' in ext_attrs:
assert needs_receiver
- cpp_arguments.append('receiver')
self._cpp_impl_includes.add('"%s.h"' % ext_attrs['ImplementedBy'])
+ cpp_arguments.append('receiver')
if 'NamedConstructor' in ext_attrs:
raises_exceptions = True
@@ -792,19 +795,11 @@ class NativeImplementationGenerator(systembase.BaseGenerator):
' RefPtr<ScriptCallStack> scriptCallStack(DartUtilities::createScriptCallStack());\n'
' if (!scriptCallStack->size())\n'
' return;\n',
- INDEX=len(arguments))
+ INDEX=len(arguments) + 1)
# Process Dart cpp_arguments.
- start_index = 0
- if needs_receiver:
- start_index = 1
- for (i, argument) in enumerate(arguments):
- if (i == len(arguments) - 1 and
- self._interface.id == 'Console' and
- argument.id == 'arg'):
- # FIXME: we are skipping last argument here because it was added in
- # supplemental dart.idl. Cleanup dart.idl and remove this check.
- break
+ start_index = 1 if needs_receiver else 0
+ for i, argument in enumerate(arguments):
argument_expression = self._GenerateToNative(body_emitter, argument, start_index + i)
cpp_arguments.append(argument_expression)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698