| 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.full_emitter; | 5 part of dart2js.js_emitter.full_emitter; |
| 6 | 6 |
| 7 class NsmEmitter extends CodeEmitterHelper { | 7 class NsmEmitter extends CodeEmitterHelper { |
| 8 final List<Selector> trivialNsmHandlers = <Selector>[]; | 8 final List<Selector> trivialNsmHandlers = <Selector>[]; |
| 9 | 9 |
| 10 /// If this is true then we can generate the noSuchMethod handlers at startup | 10 /// If this is true then we can generate the noSuchMethod handlers at startup |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 js.stringPart(",")), | 153 js.stringPart(",")), |
| 154 addQuotes: true); | 154 addQuotes: true); |
| 155 | 155 |
| 156 if (!minify) { | 156 if (!minify) { |
| 157 sortedLongs = sorted.map((selector) => | 157 sortedLongs = sorted.map((selector) => |
| 158 selector.invocationMirrorMemberName); | 158 selector.invocationMirrorMemberName); |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 // Startup code that loops over the method names and puts handlers on the | 161 // Startup code that loops over the method names and puts handlers on the |
| 162 // Object class to catch noSuchMethod invocations. | 162 // Object class to catch noSuchMethod invocations. |
| 163 ClassElement objectClass = compiler.objectClass; | 163 ClassElement objectClass = compiler.coreClasses.objectClass; |
| 164 jsAst.Expression createInvocationMirror = backend.emitter | 164 jsAst.Expression createInvocationMirror = backend.emitter |
| 165 .staticFunctionAccess(backend.helpers.createInvocationMirror); | 165 .staticFunctionAccess(backend.helpers.createInvocationMirror); |
| 166 if (useDiffEncoding) { | 166 if (useDiffEncoding) { |
| 167 statements.add(js.statement('''{ | 167 statements.add(js.statement('''{ |
| 168 var objectClassObject = processedClasses.collected[#objectClass], | 168 var objectClassObject = processedClasses.collected[#objectClass], |
| 169 nameSequences = #diffEncoding.split("."), | 169 nameSequences = #diffEncoding.split("."), |
| 170 shortNames = []; | 170 shortNames = []; |
| 171 if (objectClassObject instanceof Array) | 171 if (objectClassObject instanceof Array) |
| 172 objectClassObject = objectClassObject[1]; | 172 objectClassObject = objectClassObject[1]; |
| 173 for (var j = 0; j < nameSequences.length; ++j) { | 173 for (var j = 0; j < nameSequences.length; ++j) { |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 } | 382 } |
| 383 | 383 |
| 384 String get value { | 384 String get value { |
| 385 if (_cachedValue == null) { | 385 if (_cachedValue == null) { |
| 386 _cachedValue = _computeDiffEncoding(); | 386 _cachedValue = _computeDiffEncoding(); |
| 387 } | 387 } |
| 388 | 388 |
| 389 return _cachedValue; | 389 return _cachedValue; |
| 390 } | 390 } |
| 391 } | 391 } |
| OLD | NEW |