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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart

Issue 1252543002: dart2js: Set the name to `null` for parameter stubs of static functions. (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 | « pkg/compiler/lib/src/js_emitter/model.dart ('k') | no next file » | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 class ParameterStubGenerator { 7 class ParameterStubGenerator {
8 static final Set<Selector> emptySelectorSet = new Set<Selector>(); 8 static final Set<Selector> emptySelectorSet = new Set<Selector>();
9 9
10 final Namer namer; 10 final Namer namer;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 'return this.#(#);', 141 'return this.#(#);',
142 [namer.instanceMethodName(member), argumentsBuffer]); 142 [namer.instanceMethodName(member), argumentsBuffer]);
143 } 143 }
144 } else { 144 } else {
145 body = js.statement('return #(#)', 145 body = js.statement('return #(#)',
146 [emitter.staticFunctionAccess(member), argumentsBuffer]); 146 [emitter.staticFunctionAccess(member), argumentsBuffer]);
147 } 147 }
148 148
149 jsAst.Fun function = js('function(#) { #; }', [parametersBuffer, body]); 149 jsAst.Fun function = js('function(#) { #; }', [parametersBuffer, body]);
150 150
151 jsAst.Name name = namer.invocationName(selector); 151 jsAst.Name name = member.isStatic ? null : namer.invocationName(selector);
152 jsAst.Name callName = 152 jsAst.Name callName =
153 (callSelector != null) ? namer.invocationName(callSelector) : null; 153 (callSelector != null) ? namer.invocationName(callSelector) : null;
154 return new ParameterStubMethod(name, callName, function); 154 return new ParameterStubMethod(name, callName, function);
155 } 155 }
156 156
157 // We fill the lists depending on possible/invoked selectors. For example, 157 // We fill the lists depending on possible/invoked selectors. For example,
158 // take method foo: 158 // take method foo:
159 // foo(a, b, {c, d}); 159 // foo(a, b, {c, d});
160 // 160 //
161 // We may have multiple ways of calling foo: 161 // We may have multiple ways of calling foo:
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 generateParameterStub(member, selector, null); 274 generateParameterStub(member, selector, null);
275 if (stub != null) { 275 if (stub != null) {
276 stubs.add(stub); 276 stubs.add(stub);
277 } 277 }
278 } 278 }
279 } 279 }
280 280
281 return stubs; 281 return stubs;
282 } 282 }
283 } 283 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/model.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698