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

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

Issue 139663003: Fix 16099: Invocation's positionalArguments contains an immutable array. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/vm/bootstrap_natives.h » ('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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 60 }
61 61
62 List get positionalArguments { 62 List get positionalArguments {
63 if (_positionalArguments == null) { 63 if (_positionalArguments == null) {
64 int numPositionalArguments = _argumentsDescriptor[1]; 64 int numPositionalArguments = _argumentsDescriptor[1];
65 // Don't count receiver. 65 // Don't count receiver.
66 if (numPositionalArguments == 1) { 66 if (numPositionalArguments == 1) {
67 return _positionalArguments = const []; 67 return _positionalArguments = const [];
68 } 68 }
69 // Exclude receiver. 69 // Exclude receiver.
70 _positionalArguments = _arguments.sublist(1, numPositionalArguments); 70 _positionalArguments =
71 new _ImmutableList._from(_arguments, 1, numPositionalArguments - 1);
71 } 72 }
72 return _positionalArguments; 73 return _positionalArguments;
73 } 74 }
74 75
75 Map<Symbol, dynamic> get namedArguments { 76 Map<Symbol, dynamic> get namedArguments {
76 if (_namedArguments == null) { 77 if (_namedArguments == null) {
77 int numArguments = _argumentsDescriptor[0] - 1; // Exclude receiver. 78 int numArguments = _argumentsDescriptor[0] - 1; // Exclude receiver.
78 int numPositionalArguments = _argumentsDescriptor[1] - 1; 79 int numPositionalArguments = _argumentsDescriptor[1] - 1;
79 int numNamedArguments = numArguments - numPositionalArguments; 80 int numNamedArguments = numArguments - numPositionalArguments;
80 if (numNamedArguments == 0) { 81 if (numNamedArguments == 0) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 static _allocateInvocationMirror(String functionName, 128 static _allocateInvocationMirror(String functionName,
128 List argumentsDescriptor, 129 List argumentsDescriptor,
129 List arguments, 130 List arguments,
130 bool isSuperInvocation) { 131 bool isSuperInvocation) {
131 return new _InvocationMirror(functionName, 132 return new _InvocationMirror(functionName,
132 argumentsDescriptor, 133 argumentsDescriptor,
133 arguments, 134 arguments,
134 isSuperInvocation); 135 isSuperInvocation);
135 } 136 }
136 } 137 }
OLDNEW
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698