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

Side by Side Diff: sdk/lib/_internal/lib/js_mirrors.dart

Issue 416873002: Don't include class-static functions in library mirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typos. Created 6 years, 4 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart._js_mirrors; 5 library dart._js_mirrors;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'dart:collection' show 9 import 'dart:collection' show
10 UnmodifiableListView, 10 UnmodifiableListView,
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 String unmangledName = mangledGlobalNames[name]; 419 String unmangledName = mangledGlobalNames[name];
420 if (unmangledName == null || 420 if (unmangledName == null ||
421 JS('bool', "!!#['\$getterStub']", jsFunction)) { 421 JS('bool', "!!#['\$getterStub']", jsFunction)) {
422 // If there is no unmangledName, [jsFunction] is either a synthetic 422 // If there is no unmangledName, [jsFunction] is either a synthetic
423 // implementation detail, or something that is excluded 423 // implementation detail, or something that is excluded
424 // by @MirrorsUsed. 424 // by @MirrorsUsed.
425 // If it has a getterStub property it is a synthetic stub. 425 // If it has a getterStub property it is a synthetic stub.
426 // TODO(floitsch): Remove the getterStub hack. 426 // TODO(floitsch): Remove the getterStub hack.
427 continue; 427 continue;
428 } 428 }
429 bool isConstructor = unmangledName.startsWith('new '); 429 bool isStatic = true;
430 bool isStatic = !isConstructor; // Top-level functions are static, but 430 bool isConstructor = false;
431 // constructors are not.
432 if (isConstructor) {
433 unmangledName = unmangledName.substring(4).replaceAll(r'$', '.');
434 }
435 JsMethodMirror mirror = 431 JsMethodMirror mirror =
436 new JsMethodMirror.fromUnmangledName( 432 new JsMethodMirror.fromUnmangledName(
437 unmangledName, jsFunction, isStatic, isConstructor); 433 unmangledName, jsFunction, isStatic, isConstructor);
438 result.add(mirror); 434 result.add(mirror);
439 mirror._owner = this; 435 mirror._owner = this;
440 } 436 }
441 return _cachedFunctionMirrors = result; 437 return _cachedFunctionMirrors = result;
442 } 438 }
443 439
444 List<VariableMirror> get _fields { 440 List<VariableMirror> get _fields {
(...skipping 2471 matching lines...) Expand 10 before | Expand all | Expand 10 after
2916 // have a part (following a '.') that starts with '_'. 2912 // have a part (following a '.') that starts with '_'.
2917 const int UNDERSCORE = 0x5f; 2913 const int UNDERSCORE = 0x5f;
2918 if (name.isEmpty) return true; 2914 if (name.isEmpty) return true;
2919 int index = -1; 2915 int index = -1;
2920 do { 2916 do {
2921 if (name.codeUnitAt(index + 1) == UNDERSCORE) return false; 2917 if (name.codeUnitAt(index + 1) == UNDERSCORE) return false;
2922 index = name.indexOf('.', index + 1); 2918 index = name.indexOf('.', index + 1);
2923 } while (index >= 0 && index + 1 < name.length); 2919 } while (index >= 0 && index + 1 < name.length);
2924 return true; 2920 return true;
2925 } 2921 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698