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

Side by Side Diff: runtime/lib/invocation_mirror_patch.dart

Issue 1359503002: Spec says empty namedArguments is const {}, not const <Symbol, dynamic>{}. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests/language/invocation_mirror_empty_arguments_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class _InvocationMirror implements Invocation { 5 class _InvocationMirror implements Invocation {
6 // Constants describing the invocation type. 6 // Constants describing the invocation type.
7 // _FIELD cannot be generated by regular invocation mirrors. 7 // _FIELD cannot be generated by regular invocation mirrors.
8 static const int _METHOD = 0; 8 static const int _METHOD = 0;
9 static const int _GETTER = 1; 9 static const int _GETTER = 1;
10 static const int _SETTER = 2; 10 static const int _SETTER = 2;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 return _positionalArguments; 74 return _positionalArguments;
75 } 75 }
76 76
77 Map<Symbol, dynamic> get namedArguments { 77 Map<Symbol, dynamic> get namedArguments {
78 if (_namedArguments == null) { 78 if (_namedArguments == null) {
79 int numArguments = _argumentsDescriptor[0] - 1; // Exclude receiver. 79 int numArguments = _argumentsDescriptor[0] - 1; // Exclude receiver.
80 int numPositionalArguments = _argumentsDescriptor[1] - 1; 80 int numPositionalArguments = _argumentsDescriptor[1] - 1;
81 int numNamedArguments = numArguments - numPositionalArguments; 81 int numNamedArguments = numArguments - numPositionalArguments;
82 if (numNamedArguments == 0) { 82 if (numNamedArguments == 0) {
83 return _namedArguments = const <Symbol, dynamic>{}; 83 return _namedArguments = const {};
84 } 84 }
85 _namedArguments = new Map<Symbol, dynamic>(); 85 _namedArguments = new Map<Symbol, dynamic>();
86 for (int i = 0; i < numNamedArguments; i++) { 86 for (int i = 0; i < numNamedArguments; i++) {
87 String arg_name = _argumentsDescriptor[2 + 2*i]; 87 String arg_name = _argumentsDescriptor[2 + 2*i];
88 var arg_value = _arguments[_argumentsDescriptor[3 + 2*i]]; 88 var arg_value = _arguments[_argumentsDescriptor[3 + 2*i]];
89 _namedArguments[new internal.Symbol.unvalidated(arg_name)] = 89 _namedArguments[new internal.Symbol.unvalidated(arg_name)] =
90 arg_value; 90 arg_value;
91 } 91 }
92 _namedArguments = new Map.unmodifiable(_namedArguments); 92 _namedArguments = new Map.unmodifiable(_namedArguments);
93 } 93 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 static _allocateInvocationMirror(String functionName, 130 static _allocateInvocationMirror(String functionName,
131 List argumentsDescriptor, 131 List argumentsDescriptor,
132 List arguments, 132 List arguments,
133 bool isSuperInvocation) { 133 bool isSuperInvocation) {
134 return new _InvocationMirror(functionName, 134 return new _InvocationMirror(functionName,
135 argumentsDescriptor, 135 argumentsDescriptor,
136 arguments, 136 arguments,
137 isSuperInvocation); 137 isSuperInvocation);
138 } 138 }
139 } 139 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/invocation_mirror_empty_arguments_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698