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

Side by Side Diff: lib/compiler/implementation/resolver.dart

Issue 10824275: Revert "Refactor Library/CompilationUnit and how we define local Scope." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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) 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 interface TreeElements { 5 interface TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 Selector getSelector(Send send); 7 Selector getSelector(Send send);
8 Type getType(TypeAnnotation annotation); 8 Type getType(TypeAnnotation annotation);
9 } 9 }
10 10
(...skipping 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 } else { 1877 } else {
1878 cls.allSupertypes = const EmptyLink<Type>(); 1878 cls.allSupertypes = const EmptyLink<Type>();
1879 } 1879 }
1880 } 1880 }
1881 1881
1882 /** 1882 /**
1883 * Add a synthetic nullary constructor if there are no other 1883 * Add a synthetic nullary constructor if there are no other
1884 * constructors. 1884 * constructors.
1885 */ 1885 */
1886 void addDefaultConstructorIfNeeded(ClassElement element) { 1886 void addDefaultConstructorIfNeeded(ClassElement element) {
1887 if (element.hasConstructor) return; 1887 if (element.constructors.length != 0) return;
1888 SynthesizedConstructorElement constructor = 1888 SynthesizedConstructorElement constructor =
1889 new SynthesizedConstructorElement(element); 1889 new SynthesizedConstructorElement(element);
1890 element.addToScope(constructor, compiler); 1890 element.constructors[element.name] = constructor;
1891 Type returnType = compiler.types.voidType; 1891 Type returnType = compiler.types.voidType;
1892 constructor.type = new FunctionType(returnType, const EmptyLink<Type>(), 1892 constructor.type = new FunctionType(returnType, const EmptyLink<Type>(),
1893 constructor); 1893 constructor);
1894 constructor.cachedNode = 1894 constructor.cachedNode =
1895 new FunctionExpression(new Identifier(element.position()), 1895 new FunctionExpression(new Identifier(element.position()),
1896 new NodeList.empty(), 1896 new NodeList.empty(),
1897 new Block(new NodeList.empty()), 1897 new Block(new NodeList.empty()),
1898 null, null, null, null); 1898 null, null, null, null);
1899 } 1899 }
1900 1900
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
2310 TopScope(LibraryElement library) : super(null, library); 2310 TopScope(LibraryElement library) : super(null, library);
2311 Element lookup(SourceString name) { 2311 Element lookup(SourceString name) {
2312 return library.find(name); 2312 return library.find(name);
2313 } 2313 }
2314 2314
2315 Element add(Element newElement) { 2315 Element add(Element newElement) {
2316 throw "Cannot add an element in the top scope"; 2316 throw "Cannot add an element in the top scope";
2317 } 2317 }
2318 String toString() => '$element'; 2318 String toString() => '$element';
2319 } 2319 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/patch_parser.dart ('k') | lib/compiler/implementation/scanner/class_element_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698