| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 /// This class should morph into something that makes it easy to build | 7 /// This class should morph into something that makes it easy to build |
| 8 /// JavaScript representations of libraries, class-sides, and instance-sides. | 8 /// JavaScript representations of libraries, class-sides, and instance-sides. |
| 9 /// Initially, it is just a placeholder for code that is moved from | 9 /// Initially, it is just a placeholder for code that is moved from |
| 10 /// [CodeEmitterTask]. | 10 /// [CodeEmitterTask]. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 List tearOffInfo = [new jsAst.LiteralString(callSelectorString)]; | 110 List tearOffInfo = [new jsAst.LiteralString(callSelectorString)]; |
| 111 | 111 |
| 112 for (ParameterStubMethod stub in method.parameterStubs) { | 112 for (ParameterStubMethod stub in method.parameterStubs) { |
| 113 String invocationName = stub.name; | 113 String invocationName = stub.name; |
| 114 emitter.interceptorEmitter | 114 emitter.interceptorEmitter |
| 115 .recordMangledNameOfMemberMethod(member, invocationName); | 115 .recordMangledNameOfMemberMethod(member, invocationName); |
| 116 | 116 |
| 117 expressions.add(stub.code); | 117 expressions.add(stub.code); |
| 118 if (member.isInstanceMember) { | 118 if (member.isInstanceMember) { |
| 119 expressions.add(js.string(invocationName)); | 119 expressions.add(js.string(invocationName)); |
| 120 } else { | |
| 121 // TOOD(floitsch): Since we know when reading static data versus | |
| 122 // instance data, we can eliminate this element. | |
| 123 expressions.add(js('null')); | |
| 124 } | 120 } |
| 125 String callName = stub.callName; | 121 String callName = stub.callName; |
| 126 String callSelectorString = (callName == null) ? 'null' : '"$callName"'; | 122 String callSelectorString = (callName == null) ? 'null' : '"$callName"'; |
| 127 tearOffInfo.add(new jsAst.LiteralString(callSelectorString)); | 123 tearOffInfo.add(new jsAst.LiteralString(callSelectorString)); |
| 128 } | 124 } |
| 129 | 125 |
| 130 expressions | 126 expressions |
| 131 ..addAll(tearOffInfo) | 127 ..addAll(tearOffInfo) |
| 132 ..add((tearOffName == null || member.isAccessor) | 128 ..add((tearOffName == null || member.isAccessor) |
| 133 ? js("null") : js.string(tearOffName)) | 129 ? js("null") : js.string(tearOffName)) |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 jsAst.ArrayInitializer arrayInit = | 172 jsAst.ArrayInitializer arrayInit = |
| 177 new jsAst.ArrayInitializer(expressions.toList()); | 173 new jsAst.ArrayInitializer(expressions.toList()); |
| 178 compiler.dumpInfoTask.registerElementAst(member, | 174 compiler.dumpInfoTask.registerElementAst(member, |
| 179 builder.addProperty(name, arrayInit)); | 175 builder.addProperty(name, arrayInit)); |
| 180 } | 176 } |
| 181 | 177 |
| 182 void addMemberField(Field field, ClassBuilder builder) { | 178 void addMemberField(Field field, ClassBuilder builder) { |
| 183 // For now, do nothing. | 179 // For now, do nothing. |
| 184 } | 180 } |
| 185 } | 181 } |
| OLD | NEW |