| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 : js('j < #', js.number(interceptedSelectors.length)); | 230 : js('j < #', js.number(interceptedSelectors.length)); |
| 231 | 231 |
| 232 statements.add(js.statement(''' | 232 statements.add(js.statement(''' |
| 233 // If we are loading a deferred library the object class will not be in | 233 // If we are loading a deferred library the object class will not be in |
| 234 // the collectedClasses so objectClassObject is undefined, and we skip | 234 // the collectedClasses so objectClassObject is undefined, and we skip |
| 235 // setting up the names. | 235 // setting up the names. |
| 236 if (objectClassObject) { | 236 if (objectClassObject) { |
| 237 for (var j = 0; j < shortNames.length; j++) { | 237 for (var j = 0; j < shortNames.length; j++) { |
| 238 var type = 0; | 238 var type = 0; |
| 239 var shortName = shortNames[j]; | 239 var shortName = shortNames[j]; |
| 240 if (shortName[0] == "${namer.getterPrefix[0]}") type = 1; | 240 if (shortName.indexOf("${namer.getterPrefix}") == 0) type = 1; |
| 241 if (shortName[0] == "${namer.setterPrefix[0]}") type = 2; | 241 if (shortName.indexOf("${namer.setterPrefix}") == 0) type = 2; |
| 242 // Generate call to: | 242 // Generate call to: |
| 243 // | 243 // |
| 244 // createInvocationMirror(String name, internalName, type, | 244 // createInvocationMirror(String name, internalName, type, |
| 245 // arguments, argumentNames) | 245 // arguments, argumentNames) |
| 246 // | 246 // |
| 247 | 247 |
| 248 // This 'if' is either a static choice or dynamic choice depending on | 248 // This 'if' is either a static choice or dynamic choice depending on |
| 249 // [isIntercepted]. | 249 // [isIntercepted]. |
| 250 if (#isIntercepted) { | 250 if (#isIntercepted) { |
| 251 objectClassObject[shortName] = | 251 objectClassObject[shortName] = |
| (...skipping 130 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 |