OLD | NEW |
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 | 5 |
6 /** | 6 /** |
7 * If true, print a warning for each method that was resolved, but not | 7 * If true, print a warning for each method that was resolved, but not |
8 * compiled. | 8 * compiled. |
9 */ | 9 */ |
10 final bool REPORT_EXCESS_RESOLUTION = false; | 10 final bool REPORT_EXCESS_RESOLUTION = false; |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 boolClass = lookupSpecialClass(const SourceString('bool')); | 316 boolClass = lookupSpecialClass(const SourceString('bool')); |
317 numClass = lookupSpecialClass(const SourceString('num')); | 317 numClass = lookupSpecialClass(const SourceString('num')); |
318 intClass = lookupSpecialClass(const SourceString('int')); | 318 intClass = lookupSpecialClass(const SourceString('int')); |
319 doubleClass = lookupSpecialClass(const SourceString('double')); | 319 doubleClass = lookupSpecialClass(const SourceString('double')); |
320 stringClass = lookupSpecialClass(const SourceString('String')); | 320 stringClass = lookupSpecialClass(const SourceString('String')); |
321 functionClass = lookupSpecialClass(const SourceString('Function')); | 321 functionClass = lookupSpecialClass(const SourceString('Function')); |
322 listClass = lookupSpecialClass(const SourceString('List')); | 322 listClass = lookupSpecialClass(const SourceString('List')); |
323 closureClass = lookupSpecialClass(const SourceString('Closure')); | 323 closureClass = lookupSpecialClass(const SourceString('Closure')); |
324 dynamicClass = lookupSpecialClass(const SourceString('Dynamic')); | 324 dynamicClass = lookupSpecialClass(const SourceString('Dynamic')); |
325 nullClass = lookupSpecialClass(const SourceString('Null')); | 325 nullClass = lookupSpecialClass(const SourceString('Null')); |
326 types = new Types(dynamicClass); | 326 types = new Types(this, dynamicClass); |
327 if (!coreLibValid) { | 327 if (!coreLibValid) { |
328 cancel('core library does not contain required classes'); | 328 cancel('core library does not contain required classes'); |
329 } | 329 } |
330 | 330 |
331 jsIndexingBehaviorInterface = | 331 jsIndexingBehaviorInterface = |
332 findHelper(const SourceString('JavaScriptIndexingBehavior')); | 332 findHelper(const SourceString('JavaScriptIndexingBehavior')); |
333 } | 333 } |
334 | 334 |
335 void scanBuiltinLibraries() { | 335 void scanBuiltinLibraries() { |
336 coreImplLibrary = scanBuiltinLibrary('coreimpl'); | 336 coreImplLibrary = scanBuiltinLibrary('coreimpl'); |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 return withCurrentElement(element, | 775 return withCurrentElement(element, |
776 () => resolver.resolveSignature(element)); | 776 () => resolver.resolveSignature(element)); |
777 } | 777 } |
778 | 778 |
779 FunctionSignature resolveFunctionExpression(Element element, | 779 FunctionSignature resolveFunctionExpression(Element element, |
780 FunctionExpression node) { | 780 FunctionExpression node) { |
781 return withCurrentElement(element, | 781 return withCurrentElement(element, |
782 () => resolver.resolveFunctionExpression(element, node)); | 782 () => resolver.resolveFunctionExpression(element, node)); |
783 } | 783 } |
784 | 784 |
785 FunctionSignature resolveTypedef(TypedefElement element) { | 785 void resolveTypedef(TypedefElement element) { |
786 return withCurrentElement(element, | 786 withCurrentElement(element, |
787 () => resolver.resolveTypedef(element)); | 787 () => resolver.resolveTypedef(element)); |
788 } | 788 } |
789 | 789 |
790 FunctionType computeFunctionType(Element element, | 790 FunctionType computeFunctionType(Element element, |
791 FunctionSignature signature) { | 791 FunctionSignature signature) { |
792 return withCurrentElement(element, | 792 return withCurrentElement(element, |
793 () => resolver.computeFunctionType(element, signature)); | 793 () => resolver.computeFunctionType(element, signature)); |
794 } | 794 } |
795 | 795 |
796 Constant compileVariable(VariableElement element) { | 796 Constant compileVariable(VariableElement element) { |
797 return withCurrentElement(element, () { | 797 return withCurrentElement(element, () { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 final endOffset = end.charOffset + end.slowCharCount; | 946 final endOffset = end.charOffset + end.slowCharCount; |
947 | 947 |
948 // [begin] and [end] might be the same for the same empty token. This | 948 // [begin] and [end] might be the same for the same empty token. This |
949 // happens for instance when scanning '$$'. | 949 // happens for instance when scanning '$$'. |
950 assert(endOffset >= beginOffset); | 950 assert(endOffset >= beginOffset); |
951 return f(beginOffset, endOffset); | 951 return f(beginOffset, endOffset); |
952 } | 952 } |
953 | 953 |
954 String toString() => 'SourceSpan($uri, $begin, $end)'; | 954 String toString() => 'SourceSpan($uri, $begin, $end)'; |
955 } | 955 } |
OLD | NEW |