| 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 part of js_backend; | 5 part of js_backend; | 
| 6 | 6 | 
| 7 class CodeEmitterNoEvalTask extends CodeEmitterTask { | 7 class CodeEmitterNoEvalTask extends CodeEmitterTask { | 
| 8   CodeEmitterNoEvalTask(Compiler compiler, | 8   CodeEmitterNoEvalTask(Compiler compiler, | 
| 9                         Namer namer, | 9                         Namer namer, | 
| 10                         bool generateSourceMap) | 10                         bool generateSourceMap) | 
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 101     // d needs both a getter and a setter. Then we produce: | 101     // d needs both a getter and a setter. Then we produce: | 
| 102     // - a constructor (directly into the given [buffer]): | 102     // - a constructor (directly into the given [buffer]): | 
| 103     //   function A(b, c, d) { this.b = b, this.c = c, this.d = d; } | 103     //   function A(b, c, d) { this.b = b, this.c = c, this.d = d; } | 
| 104     // - getters and setters (stored in the [explicitGettersSetters] list): | 104     // - getters and setters (stored in the [explicitGettersSetters] list): | 
| 105     //   get$c : function() { return this.c; } | 105     //   get$c : function() { return this.c; } | 
| 106     //   get$d : function() { return this.d; } | 106     //   get$d : function() { return this.d; } | 
| 107     //   set$d : function(x) { this.d = x; } | 107     //   set$d : function(x) { this.d = x; } | 
| 108     List<String> fields = <String>[]; | 108     List<String> fields = <String>[]; | 
| 109     visitClassFields(classElement, (Element member, | 109     visitClassFields(classElement, (Element member, | 
| 110                                     String name, | 110                                     String name, | 
|  | 111                                     String accessorName, | 
| 111                                     bool needsGetter, | 112                                     bool needsGetter, | 
| 112                                     bool needsSetter, | 113                                     bool needsSetter, | 
| 113                                     bool needsCheckedSetter) { | 114                                     bool needsCheckedSetter) { | 
| 114       fields.add(name); | 115       fields.add(name); | 
| 115     }); | 116     }); | 
| 116 | 117 | 
| 117     List<String> argumentNames = fields; | 118     List<String> argumentNames = fields; | 
| 118     if (fields.length < ($z - $a)) { | 119     if (fields.length < ($z - $a)) { | 
| 119       argumentNames = new List<String>(fields.length); | 120       argumentNames = new List<String>(fields.length); | 
| 120       for (int i = 0; i < fields.length; i++) { | 121       for (int i = 0; i < fields.length; i++) { | 
| (...skipping 19 matching lines...) Expand all  Loading... | 
| 140     if (emitEndingComma) buffer.add(', '); | 141     if (emitEndingComma) buffer.add(', '); | 
| 141   } | 142   } | 
| 142 | 143 | 
| 143   bool getterAndSetterCanBeImplementedByFieldSpec(Element member, | 144   bool getterAndSetterCanBeImplementedByFieldSpec(Element member, | 
| 144                                                   String name, | 145                                                   String name, | 
| 145                                                   bool needsGetter, | 146                                                   bool needsGetter, | 
| 146                                                   bool needsSetter) { | 147                                                   bool needsSetter) { | 
| 147     return false; | 148     return false; | 
| 148   } | 149   } | 
| 149 } | 150 } | 
| OLD | NEW | 
|---|