| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 part of dart2js.js_emitter.startup_emitter.model_emitter; | 5 part of dart2js.js_emitter.startup_emitter.model_emitter; |
| 6 | 6 |
| 7 /// The name of the property that stores the tear-off getter on a static | 7 /// The name of the property that stores the tear-off getter on a static |
| 8 /// function. | 8 /// function. |
| 9 /// | 9 /// |
| 10 /// This property is only used when isolates are used. | 10 /// This property is only used when isolates are used. |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 /// | 775 /// |
| 776 /// This section updates the prototype-property of all constructors in the | 776 /// This section updates the prototype-property of all constructors in the |
| 777 /// global holders. | 777 /// global holders. |
| 778 js.Statement emitPrototypes(Fragment fragment, {softDeferred = false}) { | 778 js.Statement emitPrototypes(Fragment fragment, {softDeferred = false}) { |
| 779 List<js.Statement> assignments = fragment.libraries | 779 List<js.Statement> assignments = fragment.libraries |
| 780 .expand((Library library) => library.classes) | 780 .expand((Library library) => library.classes) |
| 781 .where((Class cls) => cls.isSoftDeferred == softDeferred) | 781 .where((Class cls) => cls.isSoftDeferred == softDeferred) |
| 782 .map((Class cls) { | 782 .map((Class cls) { |
| 783 var proto = js.js.statement( | 783 var proto = js.js.statement( |
| 784 '#.prototype = #;', [classReference(cls), emitPrototype(cls)]); | 784 '#.prototype = #;', [classReference(cls), emitPrototype(cls)]); |
| 785 ClassElement element = cls.element; | 785 ClassEntity element = cls.element; |
| 786 compiler.dumpInfoTask.registerElementAst(element, proto); | 786 compiler.dumpInfoTask.registerElementAst(element, proto); |
| 787 compiler.dumpInfoTask.registerElementAst(element.library, proto); | 787 compiler.dumpInfoTask.registerElementAst(element.library, proto); |
| 788 return proto; | 788 return proto; |
| 789 }).toList(growable: false); | 789 }).toList(growable: false); |
| 790 | 790 |
| 791 return new js.Block(assignments); | 791 return new js.Block(assignments); |
| 792 } | 792 } |
| 793 | 793 |
| 794 /// Emits the prototype of the given class [cls]. | 794 /// Emits the prototype of the given class [cls]. |
| 795 /// | 795 /// |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1553 } | 1553 } |
| 1554 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", | 1554 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", |
| 1555 js.objectLiteral(interceptorsByTag))); | 1555 js.objectLiteral(interceptorsByTag))); |
| 1556 statements.add( | 1556 statements.add( |
| 1557 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); | 1557 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); |
| 1558 statements.addAll(subclassAssignments); | 1558 statements.addAll(subclassAssignments); |
| 1559 | 1559 |
| 1560 return wrapPhase('nativeSupport', statements); | 1560 return wrapPhase('nativeSupport', statements); |
| 1561 } | 1561 } |
| 1562 } | 1562 } |
| OLD | NEW |