| 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 dart2js_incremental.library_updater; | 5 library dart2js_incremental.library_updater; |
| 6 | 6 |
| 7 import 'dart:async' show | 7 import 'dart:async' show |
| 8 Future; | 8 Future; |
| 9 | 9 |
| 10 import 'dart:convert' show | 10 import 'dart:convert' show |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 | 410 |
| 411 // TODO(ahe): Compute statements, that is initializers. | 411 // TODO(ahe): Compute statements, that is initializers. |
| 412 List<jsAst.Statement> statements = <jsAst.Statement>[]; | 412 List<jsAst.Statement> statements = <jsAst.Statement>[]; |
| 413 | 413 |
| 414 updates.add( | 414 updates.add( |
| 415 js.statement( | 415 js.statement( |
| 416 '# = function $name(#) {#}', [access, arguments, statements])); | 416 '# = function $name(#) {#}', [access, arguments, statements])); |
| 417 } | 417 } |
| 418 | 418 |
| 419 for (ClassElementX cls in newClasses) { | 419 for (ClassElementX cls in newClasses) { |
| 420 // TODO(ahe): Set up superclasses. | 420 if (cls.isObject) continue; |
| 421 jsAst.Node classAccess = namer.elementAccess(cls); |
| 422 jsAst.Node superAccess = namer.elementAccess(cls.superclass); |
| 423 |
| 424 updates.add( |
| 425 js.statement( |
| 426 r'self.$dart_unsafe_eval.inheritFrom(#, #)', |
| 427 [classAccess, superAccess])); |
| 421 } | 428 } |
| 422 | 429 |
| 423 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 430 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
| 424 if (!element.isField) { | 431 if (!element.isField) { |
| 425 updates.add(computeMemberUpdateJs(element)); | 432 updates.add(computeMemberUpdateJs(element)); |
| 426 } | 433 } |
| 427 } | 434 } |
| 428 for (RemovedFunctionUpdate update in removals) { | 435 for (RemovedFunctionUpdate update in removals) { |
| 429 update.writeUpdateJsOn(updates); | 436 update.writeUpdateJsOn(updates); |
| 430 } | 437 } |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 | 713 |
| 707 abstract class JsFeatures { | 714 abstract class JsFeatures { |
| 708 Compiler get compiler; | 715 Compiler get compiler; |
| 709 | 716 |
| 710 JavaScriptBackend get backend => compiler.backend; | 717 JavaScriptBackend get backend => compiler.backend; |
| 711 | 718 |
| 712 Namer get namer => backend.namer; | 719 Namer get namer => backend.namer; |
| 713 | 720 |
| 714 CodeEmitterTask get emitter => backend.emitter; | 721 CodeEmitterTask get emitter => backend.emitter; |
| 715 } | 722 } |
| OLD | NEW |