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

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

Issue 1241583008: Make invocation namedArguments unmodifiable. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 if (numNamedArguments == 0) { 82 if (numNamedArguments == 0) {
83 return _namedArguments = const <Symbol, dynamic>{}; 83 return _namedArguments = const <Symbol, dynamic>{};
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 } 93 }
93 return _namedArguments; 94 return _namedArguments;
94 } 95 }
95 96
96 bool get isMethod { 97 bool get isMethod {
97 if (_type == null) { 98 if (_type == null) {
98 _setMemberNameAndType(); 99 _setMemberNameAndType();
99 } 100 }
100 return (_type & _TYPE_MASK) == _METHOD; 101 return (_type & _TYPE_MASK) == _METHOD;
101 } 102 }
(...skipping 27 matching lines...) Expand all
129 static _allocateInvocationMirror(String functionName, 130 static _allocateInvocationMirror(String functionName,
130 List argumentsDescriptor, 131 List argumentsDescriptor,
131 List arguments, 132 List arguments,
132 bool isSuperInvocation) { 133 bool isSuperInvocation) {
133 return new _InvocationMirror(functionName, 134 return new _InvocationMirror(functionName,
134 argumentsDescriptor, 135 argumentsDescriptor,
135 arguments, 136 arguments,
136 isSuperInvocation); 137 isSuperInvocation);
137 } 138 }
138 } 139 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698