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

Unified Diff: lib/compiler/implementation/js_backend/emitter.dart

Issue 10911062: Codegen support for the argument definition test. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « lib/compiler/implementation/enqueue.dart ('k') | lib/compiler/implementation/resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/js_backend/emitter.dart
===================================================================
--- lib/compiler/implementation/js_backend/emitter.dart (revision 11813)
+++ lib/compiler/implementation/js_backend/emitter.dart (working copy)
@@ -9,9 +9,17 @@
class ClosureInvocationElement extends FunctionElement {
ClosureInvocationElement(SourceString name,
FunctionElement other)
- : super.from(name, other, other.enclosingElement);
+ : super.from(name, other, other.enclosingElement),
+ methodElement = other;
isInstanceMember() => true;
+
+ Element getOutermostEnclosingMemberOrTopLevel() => methodElement;
+
+ /**
+ * The [member] this invocation refers to.
+ */
+ Element methodElement;
}
/**
@@ -331,6 +339,9 @@
int count = 0;
int indexOfLastOptionalArgumentInParameters = positionalArgumentCount - 1;
+ TreeElements elements =
+ compiler.enqueuer.resolution.getCachedElements(member);
+
parameters.forEachParameter((Element element) {
String jsName = JsNames.getValid(element.name.slowToString());
if (count < positionalArgumentCount) {
@@ -344,6 +355,11 @@
// one in the real method (which is in Dart source order).
argumentsBuffer[count] = jsName;
parametersBuffer[selector.positionalArgumentCount + index] = jsName;
+ // Note that [elements] may be null for a synthetized [member].
+ } else if (elements != null && elements.isParameterChecked(element)) {
+ CodeBuffer argumentBuffer = new CodeBuffer();
+ handler.writeConstant(argumentBuffer, SentinelConstant.SENTINEL);
+ argumentsBuffer[count] = argumentBuffer.toString();
} else {
Constant value = handler.initialVariableValues[element];
if (value == null) {
« no previous file with comments | « lib/compiler/implementation/enqueue.dart ('k') | lib/compiler/implementation/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698