| 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 library compiler_helper; | 5 library compiler_helper; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import "package:expect/expect.dart"; | 8 import "package:expect/expect.dart"; |
| 9 | 9 |
| 10 import 'package:compiler/compiler_new.dart'; | 10 import 'package:compiler/compiler_new.dart'; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 enableMinification: minify, | 71 enableMinification: minify, |
| 72 disableInlining: disableInlining, | 72 disableInlining: disableInlining, |
| 73 trustJSInteropTypeAnnotations: trustJSInteropTypeAnnotations, | 73 trustJSInteropTypeAnnotations: trustJSInteropTypeAnnotations, |
| 74 outputProvider: outputCollector); | 74 outputProvider: outputCollector); |
| 75 await compiler.init(); | 75 await compiler.init(); |
| 76 compiler.parseScript(code); | 76 compiler.parseScript(code); |
| 77 LibraryElement mainApp = compiler.mainApp; | 77 LibraryElement mainApp = compiler.mainApp; |
| 78 MethodElement element = mainApp.find(entry); | 78 MethodElement element = mainApp.find(entry); |
| 79 if (element == null) return null; | 79 if (element == null) return null; |
| 80 compiler.phase = Compiler.PHASE_RESOLVING; | 80 compiler.phase = Compiler.PHASE_RESOLVING; |
| 81 compiler.processQueue(compiler.enqueuer.resolution, element, | 81 compiler.processQueue( |
| 82 compiler.frontendStrategy.elementEnvironment, |
| 83 compiler.enqueuer.resolution, |
| 84 element, |
| 82 compiler.libraryLoader.libraries); | 85 compiler.libraryLoader.libraries); |
| 83 ResolutionWorkItem resolutionWork = | 86 ResolutionWorkItem resolutionWork = |
| 84 new ResolutionWorkItem(compiler.resolution, element); | 87 new ResolutionWorkItem(compiler.resolution, element); |
| 85 resolutionWork.run(); | 88 resolutionWork.run(); |
| 86 ClosedWorld closedWorld = compiler.closeResolution().closedWorld; | 89 ClosedWorld closedWorld = compiler.closeResolution().closedWorld; |
| 87 CodegenWorkItem work = | 90 CodegenWorkItem work = |
| 88 new ElementCodegenWorkItem(compiler.backend, closedWorld, element); | 91 new ElementCodegenWorkItem(compiler.backend, closedWorld, element); |
| 89 compiler.phase = Compiler.PHASE_COMPILING; | 92 compiler.phase = Compiler.PHASE_COMPILING; |
| 90 work.run(); | 93 work.run(); |
| 91 js.JavaScriptBackend backend = compiler.backend; | 94 js.JavaScriptBackend backend = compiler.backend; |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } | 301 } |
| 299 } | 302 } |
| 300 | 303 |
| 301 return checker; | 304 return checker; |
| 302 } | 305 } |
| 303 | 306 |
| 304 RegExp _directivePattern = new RegExp( | 307 RegExp _directivePattern = new RegExp( |
| 305 // \1 \2 \3 | 308 // \1 \2 \3 |
| 306 r'''// *(present|absent): *(?:"([^"]*)"|'([^'']*)')''', | 309 r'''// *(present|absent): *(?:"([^"]*)"|'([^'']*)')''', |
| 307 multiLine: true); | 310 multiLine: true); |
| OLD | NEW |