| OLD | NEW | 
|---|
| 1 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer.src.generated.sdk; | 5 library analyzer.src.generated.sdk; | 
| 6 | 6 | 
| 7 import 'dart:collection'; | 7 import 'dart:collection'; | 
| 8 | 8 | 
| 9 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; | 
|  | 10 import 'package:analyzer/dart/ast/visitor.dart'; | 
| 10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; | 11 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; | 
| 11 import 'package:analyzer/src/generated/source.dart' | 12 import 'package:analyzer/src/generated/source.dart' | 
| 12     show ContentCache, Source, UriKind; | 13     show ContentCache, Source, UriKind; | 
| 13 | 14 | 
| 14 /** | 15 /** | 
| 15  * A Dart SDK installed in a specified location. | 16  * A Dart SDK installed in a specified location. | 
| 16  */ | 17  */ | 
| 17 abstract class DartSdk { | 18 abstract class DartSdk { | 
| 18   /** | 19   /** | 
| 19    * The short name of the dart SDK 'async' library. | 20    * The short name of the dart SDK 'async' library. | 
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 177    * [_useDart2jsPaths] is `true`. | 178    * [_useDart2jsPaths] is `true`. | 
| 178    */ | 179    */ | 
| 179   SdkLibrariesReader_LibraryBuilder(this._useDart2jsPaths); | 180   SdkLibrariesReader_LibraryBuilder(this._useDart2jsPaths); | 
| 180 | 181 | 
| 181   /** | 182   /** | 
| 182    * Return the library map that was populated by visiting the AST structure | 183    * Return the library map that was populated by visiting the AST structure | 
| 183    * parsed from the contents of the libraries file. | 184    * parsed from the contents of the libraries file. | 
| 184    */ | 185    */ | 
| 185   LibraryMap get librariesMap => _librariesMap; | 186   LibraryMap get librariesMap => _librariesMap; | 
| 186 | 187 | 
| 187 |  | 
| 188   // To be backwards-compatible the new categories field is translated to | 188   // To be backwards-compatible the new categories field is translated to | 
| 189   // an old approximation. | 189   // an old approximation. | 
| 190   String convertCategories(String categories) { | 190   String convertCategories(String categories) { | 
| 191     switch (categories) { | 191     switch (categories) { | 
| 192       case "": return "Internal"; | 192       case "": | 
| 193       case "Client": return "Client"; | 193         return "Internal"; | 
| 194       case "Server": return "Server"; | 194       case "Client": | 
| 195       case "Client,Server": return "Shared"; | 195         return "Client"; | 
| 196       case "Client,Server,Embedded": return "Shared"; | 196       case "Server": | 
|  | 197         return "Server"; | 
|  | 198       case "Client,Server": | 
|  | 199         return "Shared"; | 
|  | 200       case "Client,Server,Embedded": | 
|  | 201         return "Shared"; | 
| 197     } | 202     } | 
| 198     return "Shared"; | 203     return "Shared"; | 
| 199   } | 204   } | 
| 200 | 205 | 
| 201   @override | 206   @override | 
| 202   Object visitMapLiteralEntry(MapLiteralEntry node) { | 207   Object visitMapLiteralEntry(MapLiteralEntry node) { | 
| 203     String libraryName = null; | 208     String libraryName = null; | 
| 204     Expression key = node.key; | 209     Expression key = node.key; | 
| 205     if (key is SimpleStringLiteral) { | 210     if (key is SimpleStringLiteral) { | 
| 206       libraryName = "$_LIBRARY_PREFIX${key.value}"; | 211       libraryName = "$_LIBRARY_PREFIX${key.value}"; | 
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 391     _platforms |= DART2JS_PLATFORM; | 396     _platforms |= DART2JS_PLATFORM; | 
| 392   } | 397   } | 
| 393 | 398 | 
| 394   /** | 399   /** | 
| 395    * Record that this library can be run on the VM. | 400    * Record that this library can be run on the VM. | 
| 396    */ | 401    */ | 
| 397   void setVmLibrary() { | 402   void setVmLibrary() { | 
| 398     _platforms |= VM_PLATFORM; | 403     _platforms |= VM_PLATFORM; | 
| 399   } | 404   } | 
| 400 } | 405 } | 
| OLD | NEW | 
|---|