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

Side by Side Diff: dart/frog/leg/native_handler.dart

Issue 9689045: Library privacy. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 9 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
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 #library('native'); 5 #library('native');
6 #import('../../lib/uri/uri.dart'); 6 #import('../../lib/uri/uri.dart');
7 #import('leg.dart'); 7 #import('leg.dart');
8 #import('elements/elements.dart'); 8 #import('elements/elements.dart');
9 #import('scanner/scannerlib.dart'); 9 #import('scanner/scannerlib.dart');
10 #import('ssa/ssa.dart'); 10 #import('ssa/ssa.dart');
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 arguments.add('#'); 217 arguments.add('#');
218 }); 218 });
219 String foreignParameters = Strings.join(arguments, ','); 219 String foreignParameters = Strings.join(arguments, ',');
220 220
221 String dartMethodName; 221 String dartMethodName;
222 String nativeMethodName = element.name.slowToString(); 222 String nativeMethodName = element.name.slowToString();
223 String nativeMethodCall; 223 String nativeMethodCall;
224 224
225 if (element.kind == ElementKind.FUNCTION) { 225 if (element.kind == ElementKind.FUNCTION) {
226 dartMethodName = builder.compiler.namer.instanceMethodName( 226 dartMethodName = builder.compiler.namer.instanceMethodName(
227 element.name, parameters.parameterCount); 227 element.getLibrary(), element.name, parameters.parameterCount);
228 nativeMethodCall = '$receiver$nativeMethodName($foreignParameters)'; 228 nativeMethodCall = '$receiver$nativeMethodName($foreignParameters)';
229 } else if (element.kind == ElementKind.GETTER) { 229 } else if (element.kind == ElementKind.GETTER) {
230 dartMethodName = builder.compiler.namer.getterName(element.name); 230 dartMethodName = builder.compiler.namer.getterName(
231 element.getLibrary(), element.name);
231 nativeMethodCall = '$receiver$nativeMethodName'; 232 nativeMethodCall = '$receiver$nativeMethodName';
232 } else if (element.kind == ElementKind.SETTER) { 233 } else if (element.kind == ElementKind.SETTER) {
233 dartMethodName = builder.compiler.namer.setterName(element.name); 234 dartMethodName = builder.compiler.namer.setterName(
235 element.getLibrary(), element.name);
234 nativeMethodCall = '$receiver$nativeMethodName = $foreignParameters'; 236 nativeMethodCall = '$receiver$nativeMethodName = $foreignParameters';
235 } else { 237 } else {
236 builder.compiler.internalError('unexpected kind: "${element.kind}"', 238 builder.compiler.internalError('unexpected kind: "${element.kind}"',
237 element: element); 239 element: element);
238 } 240 }
239 241
240 HInstruction thenInstruction; 242 HInstruction thenInstruction;
241 void visitThen() { 243 void visitThen() {
242 DartString jsCode = new DartString.literal(nativeMethodCall); 244 DartString jsCode = new DartString.literal(nativeMethodCall);
243 thenInstruction = 245 thenInstruction =
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 const LiteralDartString('void'), 323 const LiteralDartString('void'),
322 <HInstruction>[jsClosure])); 324 <HInstruction>[jsClosure]));
323 } 325 }
324 }); 326 });
325 LiteralString jsCode = node.arguments.head; 327 LiteralString jsCode = node.arguments.head;
326 builder.push(new HForeign(jsCode.dartString, 328 builder.push(new HForeign(jsCode.dartString,
327 const LiteralDartString('Object'), 329 const LiteralDartString('Object'),
328 <HInstruction>[])); 330 <HInstruction>[]));
329 } 331 }
330 } 332 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698